From gvanrossum@users.sourceforge.net Thu Nov 1 04:11:08 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 31 Oct 2001 20:11:08 -0800 Subject: [Python-checkins] CVS: python/dist/src PLAN.txt,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv1495 Modified Files: PLAN.txt Log Message: __del__ is done -- except for the GC issue. Index: PLAN.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PLAN.txt,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PLAN.txt 2001/10/26 04:31:54 1.16 --- PLAN.txt 2001/11/01 04:11:06 1.17 *************** *** 5,13 **** ------------------------- - Add __del__ handlers? I asked for a motivation on python-dev and - nobody piped up. Yet I expect it will be asked for later. Are there - GC issues? Doesn't the GC make an exception for classic classes with - a __del__ handler? - Support mixed multiple inheritance from classic and new-style classes? That would be cool and make new-style classes much more usable (it --- 5,8 ---- *************** *** 38,41 **** --- 33,41 ---- Done (mostly) ------------- + + Add __del__ handlers? I asked for a motivation on python-dev and + nobody piped up. Yet I expect it will be asked for later. *** Are + there GC issues? Doesn't the GC make an exception for classic classes + with a __del__ handler? This part is *not* yet dealt with. *** Assignment to __dict__. From bwarsaw@users.sourceforge.net Thu Nov 1 05:30:37 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 31 Oct 2001 21:30:37 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0004.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv13713 Modified Files: pep-0004.txt Log Message: minor typo Index: pep-0004.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0004.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0004.txt 2000/10/04 22:40:30 1.1 --- pep-0004.txt 2001/11/01 05:30:35 1.2 *************** *** 9,13 **** Introduction ! When new modules where added to the standard Python library in the past, it was not possible to foresee whether they would still be useful in the future. Even though Python "Comes With Batteries --- 9,13 ---- Introduction ! When new modules were added to the standard Python library in the past, it was not possible to foresee whether they would still be useful in the future. Even though Python "Comes With Batteries From anthonybaxter@users.sourceforge.net Thu Nov 1 11:30:08 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Thu, 01 Nov 2001 03:30:08 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules binascii.c,2.28,2.28.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv700 Modified Files: Tag: release21-maint binascii.c Log Message: backport fixes from 2.32 and 2.29: Change the limit on the input size for b2a_base64 to what will fit in memory, rather than the standard's 57. This fixes SF bug #473009. This closes bug #430849 (internal error produced by binascii.a2b_base64) Index: binascii.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/binascii.c,v retrieving revision 2.28 retrieving revision 2.28.4.1 diff -C2 -d -r2.28 -r2.28.4.1 *** binascii.c 2001/01/09 02:11:57 2.28 --- binascii.c 2001/11/01 11:30:06 2.28.4.1 *************** *** 127,131 **** #define BASE64_PAD '=' ! #define BASE64_MAXBIN 57 /* Max binary chunk size (76 char line) */ static unsigned char table_b2a_base64[] = --- 127,133 ---- #define BASE64_PAD '=' ! ! /* Max binary chunk size; limited only by available memory */ ! #define BASE64_MAXBIN (INT_MAX/2 - sizeof(PyStringObject)) static unsigned char table_b2a_base64[] = *************** *** 336,339 **** --- 338,345 ---- return NULL; + if ( ascii_len == 0) { + PyErr_SetString(Error, "Cannot decode empty input"); + return NULL; + } bin_len = ((ascii_len+3)/4)*3; /* Upper bound, corrected later */ From anthonybaxter@users.sourceforge.net Thu Nov 1 11:38:46 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Thu, 01 Nov 2001 03:38:46 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules _codecsmodule.c,2.6,2.6.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv2317 Modified Files: Tag: release21-maint _codecsmodule.c Log Message: backport of fix from 2.7 Fix for bug [ #433047 ] missing args to PyArg_ParseTuple Index: _codecsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_codecsmodule.c,v retrieving revision 2.6 retrieving revision 2.6.6.1 diff -C2 -d -r2.6 -r2.6.6.1 *** _codecsmodule.c 2000/09/21 21:09:45 2.6 --- _codecsmodule.c 2001/11/01 11:38:44 2.6.6.1 *************** *** 441,445 **** const char *errors = NULL; ! if (!PyArg_ParseTuple(args, "O|zi:utf_16_le_encode", &str, &errors)) return NULL; --- 441,445 ---- const char *errors = NULL; ! if (!PyArg_ParseTuple(args, "O|z:utf_16_le_encode", &str, &errors)) return NULL; *************** *** 464,468 **** const char *errors = NULL; ! if (!PyArg_ParseTuple(args, "O|zi:utf_16_be_encode", &str, &errors)) return NULL; --- 464,468 ---- const char *errors = NULL; ! if (!PyArg_ParseTuple(args, "O|z:utf_16_be_encode", &str, &errors)) return NULL; From anthonybaxter@users.sourceforge.net Thu Nov 1 12:48:30 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Thu, 01 Nov 2001 04:48:30 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules parsermodule.c,2.60,2.60.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv17336 Modified Files: Tag: release21-maint parsermodule.c Log Message: backport 2.61. Properly use &&. Closes bug #434989. Index: parsermodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/parsermodule.c,v retrieving revision 2.60 retrieving revision 2.60.4.1 diff -C2 -d -r2.60 -r2.60.4.1 *** parsermodule.c 2001/01/07 05:59:59 2.60 --- parsermodule.c 2001/11/01 12:48:28 2.60.4.1 *************** *** 2525,2529 **** node* next = 0; /* node to process after this one */ ! while (res & (tree != 0)) { nch = NCH(tree); next = 0; --- 2525,2529 ---- node* next = 0; /* node to process after this one */ ! while (res && (tree != 0)) { nch = NCH(tree); next = 0; From anthonybaxter@users.sourceforge.net Thu Nov 1 12:52:30 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Thu, 01 Nov 2001 04:52:30 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules pcremodule.c,2.25,2.25.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv18031 Modified Files: Tag: release21-maint pcremodule.c Log Message: backport 2.26 [Bug #433047, reported by Armin Rigo] Remove extra 'i' character in PyArg_ParseTuple() call. Index: pcremodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pcremodule.c,v retrieving revision 2.25 retrieving revision 2.25.6.1 diff -C2 -d -r2.25 -r2.25.6.1 *** pcremodule.c 2000/09/01 23:29:27 2.25 --- pcremodule.c 2001/11/01 12:52:27 2.25.6.1 *************** *** 75,79 **** PyObject *list; ! if (!PyArg_ParseTuple(args, "t#|iiii:match", &string, &stringlen, &pos, &endpos, &options)) return NULL; if (endpos == -1) {endpos = stringlen;} --- 75,80 ---- PyObject *list; ! if (!PyArg_ParseTuple(args, "t#|iii:match", &string, &stringlen, ! &pos, &endpos, &options)) return NULL; if (endpos == -1) {endpos = stringlen;} From gvanrossum@users.sourceforge.net Thu Nov 1 13:03:32 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 01 Nov 2001 05:03:32 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0008.txt,1.4,1.5 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv20138 Modified Files: pep-0008.txt Log Message: Apply Strunk & White. (Paul Flowerman.) Index: pep-0008.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0008.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pep-0008.txt 2001/08/14 15:45:26 1.4 --- pep-0008.txt 2001/11/01 13:03:30 1.5 *************** *** 195,199 **** You can use two spaces after a sentence-ending period. ! As always when writing English, Strunk and White apply. Python coders from non-English speaking countries: please write --- 195,199 ---- You can use two spaces after a sentence-ending period. ! When writing English, Strunk and White apply. Python coders from non-English speaking countries: please write From anthonybaxter@users.sourceforge.net Thu Nov 1 13:14:45 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Thu, 01 Nov 2001 05:14:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules timemodule.c,2.110.2.1,2.110.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv22192 Modified Files: Tag: release21-maint timemodule.c Log Message: backport of 2.114: SF patch #459385 (Norman Vine): time.timezone fix for Cygwin. (skipped whitespace normalisation section of patch - this is a bugfix, not a beauty contest :) Index: timemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/timemodule.c,v retrieving revision 2.110.2.1 retrieving revision 2.110.2.2 diff -C2 -d -r2.110.2.1 -r2.110.2.2 *** timemodule.c 2001/06/27 13:01:54 2.110.2.1 --- timemodule.c 2001/11/01 13:14:43 2.110.2.2 *************** *** 600,604 **** Py_INCREF(d); moddict = d; ! #if defined(HAVE_TZNAME) && !defined(__GLIBC__) tzset(); #ifdef PYOS_OS2 --- 600,604 ---- Py_INCREF(d); moddict = d; ! #if defined(HAVE_TZNAME) && !defined(__GLIBC__) && !defined(__CYGWIN__) tzset(); #ifdef PYOS_OS2 *************** *** 618,622 **** ins(d, "daylight", PyInt_FromLong((long)daylight)); ins(d, "tzname", Py_BuildValue("(zz)", tzname[0], tzname[1])); ! #else /* !HAVE_TZNAME || __GLIBC__ */ #ifdef HAVE_TM_ZONE { --- 618,622 ---- ins(d, "daylight", PyInt_FromLong((long)daylight)); ins(d, "tzname", Py_BuildValue("(zz)", tzname[0], tzname[1])); ! #else /* !HAVE_TZNAME || __GLIBC__ || __CYGWIN__*/ #ifdef HAVE_TM_ZONE { *************** *** 674,678 **** ins(d, "tzname", Py_BuildValue("(zz)", _tzname[0], _tzname[1])); #endif /* __CYGWIN__ */ ! #endif /* !HAVE_TZNAME || __GLIBC__ */ } --- 674,678 ---- ins(d, "tzname", Py_BuildValue("(zz)", _tzname[0], _tzname[1])); #endif /* __CYGWIN__ */ ! #endif /* !HAVE_TZNAME || __GLIBC__ || __CYGWIN__*/ } From anthonybaxter@users.sourceforge.net Thu Nov 1 13:34:12 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Thu, 01 Nov 2001 05:34:12 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules structmodule.c,2.42,2.42.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv25584 Modified Files: Tag: release21-maint structmodule.c Log Message: backport tim's 2.44 Make clear in the docstring that "std" applies to both size and alignment, not just to alignment. Spotted by Guido. not normally bothering with docstring cleanups, but in this case Tim _did_ note it as a bugfix candidate, so I'll be nice :) Index: structmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/structmodule.c,v retrieving revision 2.42 retrieving revision 2.42.2.1 diff -C2 -d -r2.42 -r2.42.2.1 *** structmodule.c 2001/04/08 23:39:38 2.42 --- structmodule.c 2001/11/01 13:34:10 2.42.2.1 *************** *** 10,19 **** and also as format strings to describe the layout of data in the C struct.\n\ \n\ ! The optional first format char indicates byte ordering and alignment:\n\ ! @: native w/native alignment(default)\n\ ! =: native w/standard alignment\n\ ! <: little-endian, std. alignment\n\ ! >: big-endian, std. alignment\n\ ! !: network, std (same as >)\n\ \n\ The remaining chars indicate types of args and must match exactly;\n\ --- 10,19 ---- and also as format strings to describe the layout of data in the C struct.\n\ \n\ ! The optional first format char indicates byte order, size and alignment:\n\ ! @: native order, size & alignment (default)\n\ ! =: native order, std. size & alignment\n\ ! <: little-endian, std. size & alignment\n\ ! >: big-endian, std. size & alignment\n\ ! !: same as >\n\ \n\ The remaining chars indicate types of args and must match exactly;\n\ From anthonybaxter@users.sourceforge.net Thu Nov 1 13:58:18 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Thu, 01 Nov 2001 05:58:18 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.141.2.2,1.141.2.3 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv29965 Modified Files: Tag: release21-maint socketmodule.c Log Message: backport (partially) jeremy's 1.178 Use PySocket_Err() instead of PyErr_SetFromErrno(). The former does the right thing on Windows, the latter does not. The 'partial' is because the code's changed quite a lot and it's not clear that the two that are still there of the form return PyErr_SetFromErrno(SSLErrorObject); can be replaced with PySocket_Err() - it looks like they need the new PySSL_SetError, which is a tad large to be comfortable with just checking in without reading it further. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.141.2.2 retrieving revision 1.141.2.3 diff -C2 -d -r1.141.2.2 -r1.141.2.3 *** socketmodule.c 2001/10/19 15:17:42 1.141.2.2 --- socketmodule.c 2001/11/01 13:58:16 1.141.2.3 *************** *** 708,712 **** ifr.ifr_name[(sizeof(ifr.ifr_name))-1] = '\0'; if (ioctl(s->sock_fd, SIOCGIFINDEX, &ifr) < 0) { ! PyErr_SetFromErrno(PySocket_Error); return 0; } --- 708,712 ---- ifr.ifr_name[(sizeof(ifr.ifr_name))-1] = '\0'; if (ioctl(s->sock_fd, SIOCGIFINDEX, &ifr) < 0) { ! PySocket_Err(); return 0; } From anthonybaxter@users.sourceforge.net Thu Nov 1 14:00:13 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Thu, 01 Nov 2001 06:00:13 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.141.2.3,1.141.2.4 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv31353 Modified Files: Tag: release21-maint socketmodule.c Log Message: backport tim's 1.191: PySocketSock_connect_ex(): On Windows, return the correct Windows exit code. The patch is from Jeremy, and allows test_asynchat to run again. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.141.2.3 retrieving revision 1.141.2.4 diff -C2 -d -r1.141.2.3 -r1.141.2.4 *** socketmodule.c 2001/11/01 13:58:16 1.141.2.3 --- socketmodule.c 2001/11/01 14:00:11 1.141.2.4 *************** *** 1109,1114 **** res = connect(s->sock_fd, addr, addrlen); Py_END_ALLOW_THREADS ! if (res != 0) res = errno; return PyInt_FromLong((long) res); } --- 1109,1119 ---- res = connect(s->sock_fd, addr, addrlen); Py_END_ALLOW_THREADS ! if (res != 0) { ! #ifdef MS_WINDOWS ! res = WSAGetLastError(); ! #else res = errno; + #endif + } return PyInt_FromLong((long) res); } From jackjansen@users.sourceforge.net Thu Nov 1 14:00:21 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 01 Nov 2001 06:00:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macfsmodule.c,1.46,1.47 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv31248 Modified Files: macfsmodule.c Log Message: Under MachO-Python unconditionally import macfsn. Index: macfsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macfsmodule.c,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** macfsmodule.c 2001/10/31 22:55:08 1.46 --- macfsmodule.c 2001/11/01 14:00:19 1.47 *************** *** 40,45 **** --- 40,47 ---- #include "getapplbycreator.h" + #ifndef TARGET_API_MAC_OSX #include "pythonresources.h" extern PyMac_PrefRecord PyMac_options; + #endif #ifdef USE_TOOLBOX_OBJECT_GLUE *************** *** 1219,1223 **** --- 1221,1227 ---- PyMac_InstallNavServicesForSF(void) { + #ifndef TARGET_API_MAC_OSX if ( !PyMac_options.nonavservice ) { + #endif PyObject *m = PyImport_ImportModule("macfsn"); *************** *** 1233,1237 **** --- 1237,1243 ---- PyErr_Clear(); } + #ifndef TARGET_API_MAC_OSX } + #endif } From anthonybaxter@users.sourceforge.net Thu Nov 1 14:05:54 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Thu, 01 Nov 2001 06:05:54 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.141.2.4,1.141.2.5 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv32546 Modified Files: Tag: release21-maint socketmodule.c Log Message: backport of MvL's 1.180 Test for __sun instead of __sun__, since SUNWspro only defines the latter; gcc defines both. ...must get sparc box at home out of cupboard for testing this stuff... Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.141.2.4 retrieving revision 1.141.2.5 diff -C2 -d -r1.141.2.4 -r1.141.2.5 *** socketmodule.c 2001/11/01 14:00:11 1.141.2.4 --- socketmodule.c 2001/11/01 14:05:52 1.141.2.5 *************** *** 88,92 **** #if defined(_AIX) || defined(__osf__) #define HAVE_GETHOSTBYNAME_R_3_ARG ! #elif defined(__sun__) || defined(__sgi) #define HAVE_GETHOSTBYNAME_R_5_ARG #elif defined(linux) --- 88,92 ---- #if defined(_AIX) || defined(__osf__) #define HAVE_GETHOSTBYNAME_R_3_ARG ! #elif defined(__sun) || defined(__sgi) #define HAVE_GETHOSTBYNAME_R_5_ARG #elif defined(linux) From anthonybaxter@users.sourceforge.net Thu Nov 1 14:14:28 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Thu, 01 Nov 2001 06:14:28 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.141.2.5,1.141.2.6 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv1667 Modified Files: Tag: release21-maint socketmodule.c Log Message: partial backport of guido's 1.188. Add sendall() method, which loops until all data is written or an error occurs, and doesn't return a count. (This is my second patch from SF patch #474307, with small change to the docstring for send().) the 'partial' is because 1.188 also added a couple of Py_*_ALLOW_THREADS wrappers around SSL_read and SSL_write, and I want to check those separately. This is adding a new method to the socket object, which would normally be a bad thing to do in a bugfix release - however, in this case, it allows fixes for a nasty problem that would otherwise have a filthy filthy fix to Get It Right. Still to-do is to patch the std library modules to use sendall() where appropriate, rather than send(). Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.141.2.5 retrieving revision 1.141.2.6 diff -C2 -d -r1.141.2.5 -r1.141.2.6 *** socketmodule.c 2001/11/01 14:05:52 1.141.2.5 --- socketmodule.c 2001/11/01 14:14:26 1.141.2.6 *************** *** 60,63 **** --- 60,64 ---- - s.recvfrom(buflen [,flags]) --> string, sockaddr - s.send(string [,flags]) --> nbytes + - s.sendall(string [,flags]) # tries to send everything in a loop - s.sendto(string, [flags,] sockaddr) --> nbytes - s.setblocking(0 | 1) --> None *************** *** 1422,1430 **** static char send_doc[] = ! "send(data[, flags])\n\ \n\ Send a data string to the socket. For the optional flags\n\ ! argument, see the Unix manual."; /* s.sendto(data, [flags,] sockaddr) method */ --- 1423,1466 ---- static char send_doc[] = ! "send(data[, flags]) -> count\n\ \n\ Send a data string to the socket. For the optional flags\n\ ! argument, see the Unix manual. Return the number of bytes\n\ ! sent; this may be less than len(data) if the network is busy."; ! ! ! /* s.sendall(data [,flags]) method */ ! ! static PyObject * ! PySocketSock_sendall(PySocketSockObject *s, PyObject *args) ! { ! char *buf; ! int len, n, flags = 0, total = 0; ! if (!PyArg_ParseTuple(args, "s#|i:sendall", &buf, &len, &flags)) ! return NULL; ! Py_BEGIN_ALLOW_THREADS ! do { ! n = send(s->sock_fd, buf, len, flags); ! if (n < 0) ! break; ! total += n; ! buf += n; ! len -= n; ! } while (len > 0); ! Py_END_ALLOW_THREADS ! if (n < 0) ! return PySocket_Err(); ! Py_INCREF(Py_None); ! return Py_None; ! } + static char sendall_doc[] = + "sendall(data[, flags])\n\ + \n\ + Send a data string to the socket. For the optional flags\n\ + argument, see the Unix manual. This calls send() repeatedly\n\ + until all data is sent. If an error occurs, it's impossible\n\ + to tell how much data has been sent."; + /* s.sendto(data, [flags,] sockaddr) method */ *************** *** 1525,1528 **** --- 1561,1566 ---- {"send", (PyCFunction)PySocketSock_send, METH_VARARGS, send_doc}, + {"sendall", (PyCFunction)PySocketSock_sendall, METH_VARARGS, + sendall_doc}, {"sendto", (PyCFunction)PySocketSock_sendto, METH_VARARGS, sendto_doc}, From anthonybaxter@users.sourceforge.net Thu Nov 1 14:18:32 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Thu, 01 Nov 2001 06:18:32 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_socket.py,1.19,1.19.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv4279/Lib/test Modified Files: Tag: release21-maint test_socket.py Log Message: backport guido's 1.20 - test sktobj.sendall() needed this anyway. Index: test_socket.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_socket.py,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -C2 -d -r1.19 -r1.19.2.1 *** test_socket.py 2001/03/23 17:40:16 1.19 --- test_socket.py 2001/11/01 14:18:29 1.19.2.1 *************** *** 125,129 **** if verbose: print 'received:', data ! conn.send(data) conn.close() else: --- 125,129 ---- if verbose: print 'received:', data ! conn.sendall(data) conn.close() else: From gvanrossum@users.sourceforge.net Thu Nov 1 14:23:30 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 01 Nov 2001 06:23:30 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules gcmodule.c,2.26,2.27 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv5644 Modified Files: gcmodule.c Log Message: SF bug #477059 (my own): __del__ on new classes vs. GC. When moving objects with a __del__ attribute to a special list, look for __del__ on new-style classes with the HEAPTYPE flag set as well. (HEAPTYPE means the class was created by a class statement.) Index: gcmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gcmodule.c,v retrieving revision 2.26 retrieving revision 2.27 diff -C2 -d -r2.26 -r2.27 *** gcmodule.c 2001/10/31 23:09:35 2.26 --- gcmodule.c 2001/11/01 14:23:28 2.27 *************** *** 242,246 **** PyObject *op = FROM_GC(gc); next = gc->gc.gc_next; ! if (PyInstance_Check(op) && PyObject_HasAttr(op, delstr)) { gc_list_remove(gc); gc_list_append(gc, finalizers); --- 242,248 ---- PyObject *op = FROM_GC(gc); next = gc->gc.gc_next; ! if ((PyInstance_Check(op) || ! PyType_HasFeature(op->ob_type, Py_TPFLAGS_HEAPTYPE)) && ! PyObject_HasAttr(op, delstr)) { gc_list_remove(gc); gc_list_append(gc, finalizers); From anthonybaxter@users.sourceforge.net Thu Nov 1 14:25:41 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Thu, 01 Nov 2001 06:25:41 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.141.2.6,1.141.2.7 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv6080 Modified Files: Tag: release21-maint socketmodule.c Log Message: wrap SSL_read and SSL_write in Py_{BEGIN,END}_ALLOW_THREADS. other half of backport of guido's 1.188 Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.141.2.6 retrieving revision 1.141.2.7 diff -C2 -d -r1.141.2.6 -r1.141.2.7 *** socketmodule.c 2001/11/01 14:14:26 1.141.2.6 --- socketmodule.c 2001/11/01 14:25:38 1.141.2.7 *************** *** 2332,2336 **** --- 2332,2338 ---- return NULL; + Py_BEGIN_ALLOW_THREADS len = SSL_write(self->ssl, data, len); + Py_END_ALLOW_THREADS return PyInt_FromLong((long)len); } *************** *** 2348,2352 **** --- 2350,2356 ---- return NULL; /* Error object should already be set */ + Py_BEGIN_ALLOW_THREADS count = SSL_read(self->ssl, PyString_AsString(buf), len); + Py_END_ALLOW_THREADS res = SSL_get_error(self->ssl, count); From anthonybaxter@users.sourceforge.net Thu Nov 1 14:37:50 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Thu, 01 Nov 2001 06:37:50 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules selectmodule.c,2.50.4.2,2.50.4.3 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv10431 Modified Files: Tag: release21-maint selectmodule.c Log Message: backport barry's 2.54: 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.50.4.2 retrieving revision 2.50.4.3 diff -C2 -d -r2.50.4.2 -r2.50.4.3 *** selectmodule.c 2001/07/16 16:03:31 2.50.4.2 --- selectmodule.c 2001/11/01 14:37:48 2.50.4.3 *************** *** 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 anthonybaxter@users.sourceforge.net Thu Nov 1 14:39:43 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Thu, 01 Nov 2001 06:39:43 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules selectmodule.c,2.50.4.3,2.50.4.4 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv10834 Modified Files: Tag: release21-maint selectmodule.c Log Message: backport 2.56 from uncle tim: 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.50.4.3 retrieving revision 2.50.4.4 diff -C2 -d -r2.50.4.3 -r2.50.4.4 *** selectmodule.c 2001/11/01 14:37:48 2.50.4.3 --- selectmodule.c 2001/11/01 14:39:41 2.50.4.4 *************** *** 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; *************** *** 253,259 **** #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); --- 249,255 ---- #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 anthonybaxter@users.sourceforge.net Thu Nov 1 14:43:53 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Thu, 01 Nov 2001 06:43:53 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules selectmodule.c,2.50.4.4,2.50.4.5 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv11223 Modified Files: Tag: release21-maint selectmodule.c Log Message: backport of 2.58: Fix SF bug #474538: Memory (reference) leak in poller.register (Dave Brueck) Replace some tortuous code that was trying to be clever but forgot to DECREF the key and value, by more longwinded but obviously correct code. Index: selectmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/selectmodule.c,v retrieving revision 2.50.4.4 retrieving revision 2.50.4.5 diff -C2 -d -r2.50.4.4 -r2.50.4.5 *** selectmodule.c 2001/11/01 14:39:41 2.50.4.4 --- selectmodule.c 2001/11/01 14:43:51 2.50.4.5 *************** *** 373,376 **** --- 373,377 ---- PyObject *o, *key, *value; int fd, events = POLLIN | POLLPRI | POLLOUT; + int err; if (!PyArg_ParseTuple(args, "O|i:register", &o, &events)) { *************** *** 383,391 **** /* Add entry to the internal dictionary: the key is the file descriptor, and the value is the event mask. */ ! if ( (NULL == (key = PyInt_FromLong(fd))) || ! (NULL == (value = PyInt_FromLong(events))) || ! (PyDict_SetItem(self->dict, key, value)) == -1) { return NULL; } self->ufd_uptodate = 0; --- 384,401 ---- /* Add entry to the internal dictionary: the key is the file descriptor, and the value is the event mask. */ ! key = PyInt_FromLong(fd); ! if (key == NULL) ! return NULL; ! value = PyInt_FromLong(events); ! if (value == NULL) { ! Py_DECREF(key); return NULL; } + err = PyDict_SetItem(self->dict, key, value); + Py_DECREF(key); + Py_DECREF(value); + if (err < 0) + return NULL; + self->ufd_uptodate = 0; From jackjansen@users.sourceforge.net Thu Nov 1 14:44:17 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 01 Nov 2001 06:44:17 -0800 Subject: [Python-checkins] CVS: python/dist/src setup.py,1.63,1.64 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv11414 Modified Files: setup.py Log Message: The import check in setup.py fails on Mac OS X for Carbon-based modules if you are not building while logged in to the console (you cannot connect to the window server, so the Carbon library doesn't initialize). Added a quick hack to skip the import test, with a warning, for modules linked against Carbon. Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** setup.py 2001/10/31 12:11:48 1.63 --- setup.py 2001/11/01 14:44:15 1.64 *************** *** 155,158 **** --- 155,163 ---- (ext.name, sys.exc_info()[1])) return + # Workaround for Mac OS X: The Carbon-based modules cannot be + # reliably imported into a command-line Python + if 'Carbon' in ext.extra_link_args: + self.announce('WARNING: skipping import check for Carbon-based "%s"' % ext.name) + return try: __import__(ext.name) From anthonybaxter@users.sourceforge.net Thu Nov 1 14:55:05 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Thu, 01 Nov 2001 06:55:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules regexmodule.c,1.42,1.42.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv14062 Modified Files: Tag: release21-maint regexmodule.c Log Message: backport of (merged) 1.43 and 1.44 initregex(): this function is declared void, so the recent change to return NULL in an error case was itself an error. initregex(): Check return value of PyErr_Warn() and propagate the exception (if any.) Index: regexmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/regexmodule.c,v retrieving revision 1.42 retrieving revision 1.42.4.1 diff -C2 -d -r1.42 -r1.42.4.1 *** regexmodule.c 2001/01/22 15:29:14 1.42 --- regexmodule.c 2001/11/01 14:55:03 1.42.4.1 *************** *** 661,666 **** d = PyModule_GetDict(m); ! PyErr_Warn(PyExc_DeprecationWarning, ! "the regex module is deprecated; please use the re module"); /* Initialize regex.error exception */ --- 661,668 ---- d = PyModule_GetDict(m); ! if (PyErr_Warn(PyExc_DeprecationWarning, ! "the regex module is deprecated; " ! "please use the re module") < 0) ! return; /* Initialize regex.error exception */ From anthonybaxter@users.sourceforge.net Thu Nov 1 15:34:23 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Thu, 01 Nov 2001 07:34:23 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules gcmodule.c,2.15,2.15.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv23756 Modified Files: Tag: release21-maint gcmodule.c Log Message: one more for the night. backport of 2.26: Make the gc.collect() function respect the collection lock. This fixes SF bug 476129: "gc.collect sometimes hangs". Index: gcmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gcmodule.c,v retrieving revision 2.15 retrieving revision 2.15.6.1 diff -C2 -d -r2.15 -r2.15.6.1 *** gcmodule.c 2000/10/04 16:34:09 2.15 --- gcmodule.c 2001/11/01 15:34:20 2.15.6.1 *************** *** 44,47 **** --- 44,50 ---- 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 */ *************** *** 491,496 **** _PyGC_Insert(PyObject *op) { - /* collection lock since collecting may cause allocations */ - static int collecting = 0; #ifdef Py_DEBUG --- 494,497 ---- *************** *** 504,510 **** !collecting && !PyErr_Occurred()) { ! collecting++; collect_generations(); ! collecting--; } allocated++; --- 505,511 ---- !collecting && !PyErr_Occurred()) { ! collecting = 1; collect_generations(); ! collecting = 0; } allocated++; *************** *** 595,602 **** return NULL; ! generation = 2; ! gc_list_merge(&generation0, &generation2); ! gc_list_merge(&generation1, &generation2); ! n = collect(&generation2, &generation2); return Py_BuildValue("l", n); --- 596,610 ---- return NULL; ! if (collecting) { ! n = 0; /* already collecting, don't do anything */ ! } ! else { ! collecting = 1; ! generation = 2; ! gc_list_merge(&generation0, &generation2); ! gc_list_merge(&generation1, &generation2); ! n = collect(&generation2, &generation2); ! collecting = 0; ! } return Py_BuildValue("l", n); From nascheme@users.sourceforge.net Thu Nov 1 17:35:25 2001 From: nascheme@users.sourceforge.net (Neil Schemenauer) Date: Thu, 01 Nov 2001 09:35:25 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules gcmodule.c,2.27,2.28 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv18414 Modified Files: gcmodule.c Log Message: Add has_finalizer predictate function. Use it when deciding which objects to save in gc.garbage. This should be the last change needed to fix SF bug 477059: "__del__ on new classes vs. GC". Note that this change slightly changes the behavior of the collector. Before, if a cycle was found that contained instances with __del__ methods then all instance objects in that cycle were saved in gc.garbage. Now, only objects with __del__ methods are saved in gc.garbage. Index: gcmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gcmodule.c,v retrieving revision 2.27 retrieving revision 2.28 diff -C2 -d -r2.27 -r2.28 *** gcmodule.c 2001/11/01 14:23:28 2.27 --- gcmodule.c 2001/11/01 17:35:23 2.28 *************** *** 227,236 **** } ! /* Move all objects with finalizers (instances with __del__) */ ! static void ! move_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers) { - PyGC_Head *next; - PyGC_Head *gc = unreachable->gc.gc_next; static PyObject *delstr = NULL; if (delstr == NULL) { --- 227,234 ---- } ! /* return true of object has a finalization method */ ! static int ! has_finalizer(PyObject *op) { static PyObject *delstr = NULL; if (delstr == NULL) { *************** *** 239,248 **** Py_FatalError("PyGC: can't initialize __del__ string"); } for (; gc != unreachable; gc=next) { PyObject *op = FROM_GC(gc); next = gc->gc.gc_next; ! if ((PyInstance_Check(op) || ! PyType_HasFeature(op->ob_type, Py_TPFLAGS_HEAPTYPE)) && ! PyObject_HasAttr(op, delstr)) { gc_list_remove(gc); gc_list_append(gc, finalizers); --- 237,260 ---- Py_FatalError("PyGC: can't initialize __del__ string"); } + if ((PyInstance_Check(op) || + PyType_HasFeature(op->ob_type, Py_TPFLAGS_HEAPTYPE)) && + PyObject_HasAttr(op, delstr)) { + return 1; + } + else { + return 0; + } + } + + /* Move all objects with finalizers (instances with __del__) */ + static void + move_finalizers(PyGC_Head *unreachable, PyGC_Head *finalizers) + { + PyGC_Head *next; + PyGC_Head *gc = unreachable->gc.gc_next; for (; gc != unreachable; gc=next) { PyObject *op = FROM_GC(gc); next = gc->gc.gc_next; ! if (has_finalizer(op)) { gc_list_remove(gc); gc_list_append(gc, finalizers); *************** *** 270,274 **** { char *cname; ! /* be careful not to create new dictionaries */ PyObject *classname = inst->in_class->cl_name; if (classname != NULL && PyString_Check(classname)) --- 282,286 ---- { char *cname; ! /* simple version of instance_repr */ PyObject *classname = inst->in_class->cl_name; if (classname != NULL && PyString_Check(classname)) *************** *** 303,311 **** gc = finalizers->gc.gc_next) { PyObject *op = FROM_GC(gc); ! if ((debug & DEBUG_SAVEALL) || PyInstance_Check(op)) { ! /* If SAVEALL is not set then just append ! * instances to the list of garbage. We assume ! * that all objects in the finalizers list are ! * reachable from instances. */ PyList_Append(garbage, op); } --- 315,323 ---- gc = finalizers->gc.gc_next) { PyObject *op = FROM_GC(gc); ! if ((debug & DEBUG_SAVEALL) || has_finalizer(op)) { ! /* If SAVEALL is not set then just append objects with ! * finalizers to the list of garbage. All objects in ! * the finalizers list are reachable from those ! * objects. */ PyList_Append(garbage, op); } From fdrake@users.sourceforge.net Thu Nov 1 17:50:40 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 01 Nov 2001 09:50:40 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib pprint.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv22724 Modified Files: pprint.py Log Message: Brute-force performance hackery; buys back about 20% of the time for saferepr(), a bit less for pformat(). Index: pprint.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pprint.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** pprint.py 2001/10/09 20:53:48 1.16 --- pprint.py 2001/11/01 17:50:38 1.17 *************** *** 46,49 **** --- 46,57 ---- "PrettyPrinter"] + # cache these for faster access: + _commajoin = ", ".join + _sys_modules = sys.modules + _id = id + _len = len + _type = type + + def pprint(object, stream=None): """Pretty-print a Python object to a stream [default is sys.sydout].""" *************** *** 57,69 **** def saferepr(object): """Version of repr() which can handle recursive data structures.""" ! return _safe_repr(object, {})[0] def isreadable(object): """Determine if saferepr(object) is readable by eval().""" ! return _safe_repr(object, {})[1] def isrecursive(object): """Determine if object requires a recursive representation.""" ! return _safe_repr(object, {})[2] class PrettyPrinter: --- 65,77 ---- def saferepr(object): """Version of repr() which can handle recursive data structures.""" ! return _safe_repr(object, {}, None, 0)[0] def isreadable(object): """Determine if saferepr(object) is readable by eval().""" ! return _safe_repr(object, {}, None, 0)[1] def isrecursive(object): """Determine if object requires a recursive representation.""" ! return _safe_repr(object, {}, None, 0)[2] class PrettyPrinter: *************** *** 109,113 **** def isrecursive(self, object): self.__recursive = 0 ! self.pformat(object) return self.__recursive --- 117,121 ---- def isrecursive(self, object): self.__recursive = 0 ! self.__repr(object, {}, 0) return self.__recursive *************** *** 115,179 **** self.__recursive = 0 self.__readable = 1 ! self.pformat(object) return self.__readable and not self.__recursive def __format(self, object, stream, indent, allowance, context, level): level = level + 1 ! if context.has_key(id(object)): ! object = _Recursion(object) self.__recursive = 1 rep = self.__repr(object, context, level - 1) ! objid = id(object) ! context[objid] = 1 ! typ = type(object) ! sepLines = len(rep) > (self.__width - 1 - indent - allowance) ! ! if sepLines and typ in (ListType, TupleType): ! # Pretty-print the sequence. ! stream.write((typ is ListType) and '[' or '(') ! if self.__indent_per_level > 1: ! stream.write((self.__indent_per_level - 1) * ' ') ! length = len(object) ! if length: ! indent = indent + self.__indent_per_level ! self.__format(object[0], stream, indent, allowance + 1, ! context, level) ! if length > 1: ! for ent in object[1:]: ! stream.write(',\n' + ' '*indent) ! self.__format(ent, stream, indent, ! allowance + 1, context, level) ! indent = indent - self.__indent_per_level ! if typ is TupleType and length == 1: ! stream.write(',') ! stream.write(((typ is ListType) and ']') or ')') ! elif sepLines and typ is DictType: ! stream.write('{') ! if self.__indent_per_level > 1: ! stream.write((self.__indent_per_level - 1) * ' ') ! length = len(object) ! if length: ! indent = indent + self.__indent_per_level ! items = object.items() ! items.sort() ! key, ent = items[0] ! rep = self.__repr(key, context, level) + ': ' ! stream.write(rep) ! self.__format(ent, stream, indent + len(rep), ! allowance + 1, context, level) ! if len(items) > 1: ! for key, ent in items[1:]: ! rep = self.__repr(key, context, level) + ': ' ! stream.write(',\n' + ' '*indent + rep) ! self.__format(ent, stream, indent + len(rep), ! allowance + 1, context, level) ! indent = indent - self.__indent_per_level ! stream.write('}') ! else: ! stream.write(rep) ! del context[objid] def __repr(self, object, context, level): --- 123,198 ---- self.__recursive = 0 self.__readable = 1 ! self.__repr(object, {}, 0) return self.__readable and not self.__recursive def __format(self, object, stream, indent, allowance, context, level): level = level + 1 ! objid = _id(object) ! if objid in context: ! stream.write(_recursion(object)) self.__recursive = 1 + self.__readable = 0 + return rep = self.__repr(object, context, level - 1) ! typ = _type(object) ! sepLines = _len(rep) > (self.__width - 1 - indent - allowance) ! write = stream.write ! if sepLines: ! if typ is DictType: ! write('{') ! if self.__indent_per_level > 1: ! write((self.__indent_per_level - 1) * ' ') ! length = _len(object) ! if length: ! context[objid] = 1 ! indent = indent + self.__indent_per_level ! items = object.items() ! items.sort() ! key, ent = items[0] ! rep = self.__repr(key, context, level) ! write(rep) ! write(': ') ! self.__format(ent, stream, indent + _len(rep) + 2, ! allowance + 1, context, level) ! if length > 1: ! for key, ent in items[1:]: ! rep = self.__repr(key, context, level) ! write(',\n%s: %s' % (' '*indent, rep)) ! self.__format(ent, stream, indent + _len(rep) + 2, ! allowance + 1, context, level) ! indent = indent - self.__indent_per_level ! del context[objid] ! write('}') ! return ! if typ is ListType or typ is TupleType: ! if typ is ListType: ! write('[') ! endchar = ']' ! else: ! write('(') ! endchar = ')' ! if self.__indent_per_level > 1: ! write((self.__indent_per_level - 1) * ' ') ! length = _len(object) ! if length: ! context[objid] = 1 ! indent = indent + self.__indent_per_level ! self.__format(object[0], stream, indent, allowance + 1, ! context, level) ! if length > 1: ! for ent in object[1:]: ! write(',\n' + ' '*indent) ! self.__format(ent, stream, indent, ! allowance + 1, context, level) ! indent = indent - self.__indent_per_level ! del context[objid] ! if typ is TupleType and length == 1: ! write(',') ! write(endchar) ! return ! write(rep) def __repr(self, object, context, level): *************** *** 188,201 **** # Return triple (repr_string, isreadable, isrecursive). ! _have_module = sys.modules.has_key ! ! def _safe_repr(object, context, maxlevels=None, level=0): ! level += 1 ! typ = type(object) ! if not (typ in (DictType, ListType, TupleType, StringType) and object): ! rep = `object` ! return rep, (rep and (rep[0] != '<')), 0 ! elif typ is StringType: ! if not _have_module('locale'): return `object`, 1, 0 if "'" in object and '"' not in object: --- 207,214 ---- # Return triple (repr_string, isreadable, isrecursive). ! def _safe_repr(object, context, maxlevels, level): ! typ = _type(object) ! if typ is StringType: ! if 'locale' not in _sys_modules: return `object`, 1, 0 if "'" in object and '"' not in object: *************** *** 205,266 **** closure = "'" quotes = {"'": "\\'"} sio = StringIO() for char in object: if char.isalpha(): ! sio.write(char) else: ! sio.write(quotes.get(char, `char`[1:-1])) ! return closure + sio.getvalue() + closure, 1, 0 ! ! if context.has_key(id(object)): ! return `_Recursion(object)`, 0, 1 ! objid = id(object) ! context[objid] = 1 ! ! readable = 1 ! recursive = 0 ! startchar, endchar = {ListType: "[]", ! TupleType: "()", ! DictType: "{}"}[typ] ! if maxlevels and level > maxlevels: ! with_commas = "..." ! readable = 0 ! elif typ is DictType: components = [] for k, v in object.iteritems(): ! krepr, kreadable, krecur = _safe_repr(k, context, maxlevels, ! level) ! vrepr, vreadable, vrecur = _safe_repr(v, context, maxlevels, ! level) ! components.append("%s: %s" % (krepr, vrepr)) readable = readable and kreadable and vreadable ! recursive = recursive or krecur or vrecur ! with_commas = ", ".join(components) ! else: # list or tuple ! assert typ in (ListType, TupleType) components = [] ! for element in object: ! subrepr, subreadable, subrecur = _safe_repr( ! element, context, maxlevels, level) ! components.append(subrepr) ! readable = readable and subreadable ! recursive = recursive or subrecur ! if len(components) == 1 and typ is TupleType: ! components[0] += "," ! with_commas = ", ".join(components) - s = "%s%s%s" % (startchar, with_commas, endchar) - del context[objid] - return s, readable and not recursive, recursive ! class _Recursion: ! # represent a recursive relationship; really only used for the __repr__() ! # method... ! def __init__(self, object): ! self.__repr = "" \ ! % (type(object).__name__, id(object)) ! def __repr__(self): ! return self.__repr --- 218,310 ---- closure = "'" quotes = {"'": "\\'"} + qget = quotes.get sio = StringIO() + write = sio.write for char in object: if char.isalpha(): ! write(char) else: ! write(qget(char, `char`[1:-1])) ! return ("%s%s%s" % (closure, sio.getvalue(), closure)), 1, 0 ! if typ is DictType: ! if not object: ! return "{}", 1, 0 ! objid = _id(object) ! if maxlevels and level > maxlevels: ! return "{...}", 0, objid in context ! if objid in context: ! return _recursion(object), 0, 1 ! context[objid] = 1 ! readable = 1 ! recursive = 0 components = [] + append = components.append + level += 1 + saferepr = _safe_repr for k, v in object.iteritems(): ! krepr, kreadable, krecur = saferepr(k, context, maxlevels, level) ! vrepr, vreadable, vrecur = saferepr(v, context, maxlevels, level) ! append("%s: %s" % (krepr, vrepr)) readable = readable and kreadable and vreadable ! if krecur or vrecur: ! recursive = 1 ! del context[objid] ! return "{%s}" % _commajoin(components), readable, recursive ! if typ is ListType or typ is TupleType: ! if typ is ListType: ! if not object: ! return "[]", 1, 0 ! format = "[%s]" ! elif _len(object) == 1: ! format = "(%s,)" ! else: ! if not object: ! return "()", 1, 0 ! format = "(%s)" ! objid = _id(object) ! if maxlevels and level > maxlevels: ! return format % "...", 0, objid in context ! if objid in context: ! return _recursion(object), 0, 1 ! context[objid] = 1 ! readable = 1 ! recursive = 0 components = [] ! append = components.append ! level += 1 ! for o in object: ! orepr, oreadable, orecur = _safe_repr(o, context, maxlevels, level) ! append(orepr) ! if not oreadable: ! readable = 0 ! if orecur: ! recursive = 1 ! del context[objid] ! return format % _commajoin(components), readable, recursive ! ! rep = `object` ! return rep, (rep and not rep.startswith('<')), 0 ! def _recursion(object): ! return ("" ! % (_type(object).__name__, _id(object))) ! ! def _perfcheck(object=None): ! import time ! if object is None: ! object = [("string", (1, 2), [3, 4], {5: 6, 7: 8})] * 100000 ! p = PrettyPrinter() ! t1 = time.time() ! _safe_repr(object, {}, None, 0) ! t2 = time.time() ! p.pformat(object) ! t3 = time.time() ! print "_safe_repr:", t2 - t1 ! print "pformat:", t3 - t2 ! ! if __name__ == "__main__": ! _perfcheck() From tim_one@users.sourceforge.net Thu Nov 1 19:35:47 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 01 Nov 2001 11:35:47 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules gcmodule.c,2.28,2.29 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv20374/python/Modules Modified Files: gcmodule.c Log Message: has_finalizer(): simplified "if (complicated_bool) 1 else 0" to "complicated_bool". Index: gcmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gcmodule.c,v retrieving revision 2.28 retrieving revision 2.29 diff -C2 -d -r2.28 -r2.29 *** gcmodule.c 2001/11/01 17:35:23 2.28 --- gcmodule.c 2001/11/01 19:35:45 2.29 *************** *** 237,248 **** Py_FatalError("PyGC: can't initialize __del__ string"); } ! if ((PyInstance_Check(op) || ! PyType_HasFeature(op->ob_type, Py_TPFLAGS_HEAPTYPE)) && ! PyObject_HasAttr(op, delstr)) { ! return 1; ! } ! else { ! return 0; ! } } --- 237,243 ---- Py_FatalError("PyGC: can't initialize __del__ string"); } ! return (PyInstance_Check(op) || ! PyType_HasFeature(op->ob_type, Py_TPFLAGS_HEAPTYPE)) ! && PyObject_HasAttr(op, delstr); } From fdrake@users.sourceforge.net Thu Nov 1 19:48:03 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 01 Nov 2001 11:48:03 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/mac using.tex,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/mac In directory usw-pr-cvs1:/tmp/cvs-serv23613/mac Modified Files: using.tex Log Message: Correct misspelling of "separate" in two places. This closes SF bug #476898. Index: using.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/using.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** using.tex 2001/04/13 17:32:49 1.3 --- using.tex 2001/11/01 19:48:01 1.4 *************** *** 208,212 **** that you cannot use the ``Drag and drop'' method above. Instead, dropping a script onto the \program{Python IDE} icon will open the ! file in a seperate script window (which you can then execute manually -- see section \ref{IDEexecution}). --- 208,212 ---- that you cannot use the ``Drag and drop'' method above. Instead, dropping a script onto the \program{Python IDE} icon will open the ! file in a separate script window (which you can then execute manually -- see section \ref{IDEexecution}). *************** *** 263,267 **** command-line users would type them onto the command-line to pass them as arguments to the script. However, you should make sure to save the ! applet as a seperate file, do not overwrite the script you are writing, because you will not be able to edit it again. --- 263,267 ---- command-line users would type them onto the command-line to pass them as arguments to the script. However, you should make sure to save the ! applet as a separate file, do not overwrite the script you are writing, because you will not be able to edit it again. From fdrake@users.sourceforge.net Thu Nov 1 19:49:47 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 01 Nov 2001 11:49:47 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/mac using.tex,1.3,1.3.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/mac In directory usw-pr-cvs1:/tmp/cvs-serv24048 Modified Files: Tag: release21-maint using.tex Log Message: Correct misspelling of "separate" in two places. This closes SF bug #476898. Index: using.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/mac/using.tex,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** using.tex 2001/04/13 17:32:49 1.3 --- using.tex 2001/11/01 19:49:45 1.3.2.1 *************** *** 208,212 **** that you cannot use the ``Drag and drop'' method above. Instead, dropping a script onto the \program{Python IDE} icon will open the ! file in a seperate script window (which you can then execute manually -- see section \ref{IDEexecution}). --- 208,212 ---- that you cannot use the ``Drag and drop'' method above. Instead, dropping a script onto the \program{Python IDE} icon will open the ! file in a separate script window (which you can then execute manually -- see section \ref{IDEexecution}). *************** *** 263,267 **** command-line users would type them onto the command-line to pass them as arguments to the script. However, you should make sure to save the ! applet as a seperate file, do not overwrite the script you are writing, because you will not be able to edit it again. --- 263,267 ---- command-line users would type them onto the command-line to pass them as arguments to the script. However, you should make sure to save the ! applet as a separate file, do not overwrite the script you are writing, because you will not be able to edit it again. From tim_one@users.sourceforge.net Thu Nov 1 20:09:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 01 Nov 2001 12:09:44 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects floatobject.c,2.102,2.103 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv28636/python/Objects Modified Files: floatobject.c Log Message: SF bug #477221: abs and divmod act oddly with -0.0. Partial fix. float_abs(): ensure abs(-0.0) returns +0.0. Bugfix candidate. Index: floatobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v retrieving revision 2.102 retrieving revision 2.103 diff -C2 -d -r2.102 -r2.103 *** floatobject.c 2001/10/24 20:39:12 2.102 --- floatobject.c 2001/11/01 20:09:42 2.103 *************** *** 115,119 **** if (PyUnicode_EncodeDecimal(PyUnicode_AS_UNICODE(v), PyUnicode_GET_SIZE(v), ! s_buffer, NULL)) return NULL; --- 115,119 ---- if (PyUnicode_EncodeDecimal(PyUnicode_AS_UNICODE(v), PyUnicode_GET_SIZE(v), ! s_buffer, NULL)) return NULL; *************** *** 197,204 **** PyFloatObject *fo; double val; ! if (op && PyFloat_Check(op)) return PyFloat_AS_DOUBLE((PyFloatObject*) op); ! if (op == NULL || (nb = op->ob_type->tp_as_number) == NULL || nb->nb_float == NULL) { --- 197,204 ---- PyFloatObject *fo; double val; ! if (op && PyFloat_Check(op)) return PyFloat_AS_DOUBLE((PyFloatObject*) op); ! if (op == NULL || (nb = op->ob_type->tp_as_number) == NULL || nb->nb_float == NULL) { *************** *** 206,210 **** return -1; } ! fo = (PyFloatObject*) (*nb->nb_float) (op); if (fo == NULL) --- 206,210 ---- return -1; } ! fo = (PyFloatObject*) (*nb->nb_float) (op); if (fo == NULL) *************** *** 215,222 **** return -1; } ! val = PyFloat_AS_DOUBLE(fo); Py_DECREF(fo); ! return val; } --- 215,222 ---- return -1; } ! val = PyFloat_AS_DOUBLE(fo); Py_DECREF(fo); ! return val; } *************** *** 506,510 **** ix = 1.0; PyFPE_END_PROTECT(ix) ! return PyFloat_FromDouble(ix); } if (iv == 0.0) { /* 0**w is error if w<0, else 1 */ --- 506,510 ---- ix = 1.0; PyFPE_END_PROTECT(ix) ! return PyFloat_FromDouble(ix); } if (iv == 0.0) { /* 0**w is error if w<0, else 1 */ *************** *** 538,542 **** { PyObject *t, *r; ! t = float_divmod(v, w); if (t != NULL) { --- 538,542 ---- { PyObject *t, *r; ! t = float_divmod(v, w); if (t != NULL) { *************** *** 571,576 **** if (v->ob_fval < 0) return float_neg(v); ! else return float_pos(v); } --- 571,578 ---- if (v->ob_fval < 0) return float_neg(v); ! else if (v->ob_fval > 0) return float_pos(v); + else /* ensure abs(-0) is +0 */ + return PyFloat_FromDouble(+0.0); } From fdrake@users.sourceforge.net Thu Nov 1 20:26:14 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 01 Nov 2001 12:26:14 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects abstract.c,2.90,2.91 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv656 Modified Files: abstract.c Log Message: PyFunction_Call() did not check the result of PyObject_Repr() for NULL, and should just avoid calling it in the first place to avoid waiting for a repr of a large object like a dict or list. The result of PyObject_Repr() was being leaked as well. Bugfix candidate! Index: abstract.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v retrieving revision 2.90 retrieving revision 2.91 diff -C2 -d -r2.90 -r2.91 *** abstract.c 2001/10/28 02:35:01 2.90 --- abstract.c 2001/11/01 20:26:12 2.91 *************** *** 1661,1666 **** return result; } ! PyErr_Format(PyExc_TypeError, "object is not callable: %s", ! PyString_AS_STRING(PyObject_Repr(func))); return NULL; } --- 1661,1666 ---- return result; } ! PyErr_Format(PyExc_TypeError, "'%s' object is not callable", ! func->ob_type->tp_name); return NULL; } From gvanrossum@users.sourceforge.net Thu Nov 1 21:36:50 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 01 Nov 2001 13:36:50 -0800 Subject: [Python-checkins] CVS: python/dist/src PLAN.txt,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv18380 Modified Files: PLAN.txt Log Message: The GC issues with __del__ are now dealt with. Index: PLAN.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PLAN.txt,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PLAN.txt 2001/11/01 04:11:06 1.17 --- PLAN.txt 2001/11/01 21:36:48 1.18 *************** *** 34,41 **** ------------- ! Add __del__ handlers? I asked for a motivation on python-dev and ! nobody piped up. Yet I expect it will be asked for later. *** Are ! there GC issues? Doesn't the GC make an exception for classic classes ! with a __del__ handler? This part is *not* yet dealt with. *** Assignment to __dict__. --- 34,41 ---- ------------- ! Add __del__ handlers. I asked for a motivation on python-dev and ! nobody piped up. Yet I expect it will be asked for later. There ! were some GC issues, but these have now also been dealt with, thanks ! to Neil Schemenauer. Assignment to __dict__. From tim_one@users.sourceforge.net Thu Nov 1 21:51:17 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 01 Nov 2001 13:51:17 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects floatobject.c,2.103,2.104 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv21887/python/Objects Modified Files: floatobject.c Log Message: float_abs() again: Guido pointed out that this could screw up in the presence of NaNs. So pass the issue on to the platform libm fabs(); after all, fabs() is a std C function because you can't implement it correctly in portable C89. Index: floatobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v retrieving revision 2.103 retrieving revision 2.104 diff -C2 -d -r2.103 -r2.104 *** floatobject.c 2001/11/01 20:09:42 2.103 --- floatobject.c 2001/11/01 21:51:15 2.104 *************** *** 569,578 **** float_abs(PyFloatObject *v) { ! if (v->ob_fval < 0) ! return float_neg(v); ! else if (v->ob_fval > 0) ! return float_pos(v); ! else /* ensure abs(-0) is +0 */ ! return PyFloat_FromDouble(+0.0); } --- 569,573 ---- float_abs(PyFloatObject *v) { ! return PyFloat_FromDouble(fabs(v->ob_fval)); } From tim_one@users.sourceforge.net Thu Nov 1 23:12:29 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 01 Nov 2001 15:12:29 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects floatobject.c,2.104,2.105 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv12223/python/Objects Modified Files: floatobject.c Log Message: SF bug #477221: abs and divmod act oddly with -0.0 Try to ensure that divmod(-0.0, 1.0) -> (-0.0, +0.0) across platforms. It always did on Windows, and still does. It didn't on Linux. Alas, there's no platform-independent way to write a test case for this. Bugfix candidate. Index: floatobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v retrieving revision 2.104 retrieving revision 2.105 diff -C2 -d -r2.104 -r2.105 *** floatobject.c 2001/11/01 21:51:15 2.104 --- floatobject.c 2001/11/01 23:12:27 2.105 *************** *** 465,479 **** */ div = (vx - mod) / wx; ! /* note: checking mod*wx < 0 is incorrect -- underflows to ! 0 if wx < sqrt(smallest nonzero double) */ ! if (mod && ((wx < 0) != (mod < 0))) { ! mod += wx; ! div -= 1.0; } /* snap quotient to nearest integral value */ ! floordiv = floor(div); ! if (div - floordiv > 0.5) ! floordiv += 1.0; ! PyFPE_END_PROTECT(div) return Py_BuildValue("(dd)", floordiv, mod); } --- 465,496 ---- */ div = (vx - mod) / wx; ! if (mod) { ! /* ensure the remainder has the same sign as the denominator */ ! if ((wx < 0) != (mod < 0)) { ! mod += wx; ! div -= 1.0; ! } } + else { + /* the remainder is zero, and in the presence of signed zeroes + fmod returns different results across platforms; ensure + it has the same sign as the denominator; we'd like to do + "mod = wx * 0.0", but that may get optimized away */ + mod = 0.0; + if (wx < 0.0) + mod = -mod; + } /* snap quotient to nearest integral value */ ! if (div) { ! floordiv = floor(div); ! if (div - floordiv > 0.5) ! floordiv += 1.0; ! } ! else { ! /* div is zero - get the same sign as the true quotient */ ! div *= div; /* hide "div = +0" from optimizers */ ! floordiv = div * vx / wx; /* zero w/ sign of vx/wx */ ! } ! PyFPE_END_PROTECT(floordiv) return Py_BuildValue("(dd)", floordiv, mod); } From jackjansen@users.sourceforge.net Thu Nov 1 23:17:37 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 01 Nov 2001 15:17:37 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Python macglue.c,1.105,1.106 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv14154/Python/Mac/Python Modified Files: macglue.c Log Message: We always install the Sioux menubar, in stead of only when no menubar was installed previously. This fixes bug #476904, but I'm not 100% sure it doesn't break anything else. But if it does I'll notice tomorrow when I try to build GRiNS:-) Index: macglue.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macglue.c,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** macglue.c 2001/09/11 09:22:19 1.105 --- macglue.c 2001/11/01 23:17:35 1.106 *************** *** 721,725 **** --- 721,733 ---- if ( sioux_mbar ) return; + #if 0 + /* This code does not seem to work anymore: apparently + ** we now always have a menubar (since MacOS9?). + ** So we simply always setup the Sioux menus here. + */ if ( (sioux_mbar=GetMenuBar()) == NULL ) { + #else + { + #endif /* Sioux menu not installed yet. Do so */ SIOUXSetupMenus(); From tim_one@users.sourceforge.net Thu Nov 1 23:59:59 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 01 Nov 2001 15:59:59 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects floatobject.c,2.105,2.106 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv23901/python/Objects Modified Files: floatobject.c Log Message: float_divmod(): the code wasn't sick enough to stop the MS optimizer from optimizing away mod's sign adjustment when mod == 0; so it got the intended result only in the debug build. Index: floatobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v retrieving revision 2.105 retrieving revision 2.106 diff -C2 -d -r2.105 -r2.106 *** floatobject.c 2001/11/01 23:12:27 2.105 --- floatobject.c 2001/11/01 23:59:56 2.106 *************** *** 477,481 **** it has the same sign as the denominator; we'd like to do "mod = wx * 0.0", but that may get optimized away */ ! mod = 0.0; if (wx < 0.0) mod = -mod; --- 477,481 ---- it has the same sign as the denominator; we'd like to do "mod = wx * 0.0", but that may get optimized away */ ! mod *= mod; /* hide "mod = +0" from optimizer */ if (wx < 0.0) mod = -mod; From effbot@users.sourceforge.net Fri Nov 2 13:59:53 2001 From: effbot@users.sourceforge.net (Fredrik Lundh) Date: Fri, 02 Nov 2001 05:59:53 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib sre_parse.py,1.48,1.49 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv14918/Lib Modified Files: sre_parse.py Log Message: SF bug #476912: flag repeated use of the same groupname as the error it really is (and always has been) Index: sre_parse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sre_parse.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** sre_parse.py 2001/09/18 20:55:24 1.48 --- sre_parse.py 2001/11/02 13:59:51 1.49 *************** *** 82,85 **** --- 82,87 ---- self.groups = gid + 1 if name: + if self.groupdict.has_key(name): + raise error, "can only use each group name once" self.groupdict[name] = gid self.open.append(gid) *************** *** 190,194 **** c = self.string[self.index + 1] except IndexError: ! raise error, "bogus escape" char = char + c self.index = self.index + len(char) --- 192,196 ---- c = self.string[self.index + 1] except IndexError: ! raise error, "bogus escape (end of line)" char = char + c self.index = self.index + len(char) From jvr@users.sourceforge.net Fri Nov 2 19:09:36 2001 From: jvr@users.sourceforge.net (Just van Rossum) Date: Fri, 02 Nov 2001 11:09:36 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wlists.py,1.5,1.6 Wmenus.py,1.5,1.6 Wwindows.py,1.12,1.13 Wbase.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv32017 Modified Files: Wlists.py Wmenus.py Wwindows.py Wbase.py Log Message: rearranged some imports Index: Wlists.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wlists.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Wlists.py 2001/08/25 12:14:13 1.5 --- Wlists.py 2001/11/02 19:09:34 1.6 *************** *** 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 --- 1,6 ---- import Wbase import Wkeys import string ! from Carbon import Evt, Events, Lists, Qd, Scrap, Win Index: Wmenus.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wmenus.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Wmenus.py 2001/08/25 12:14:22 1.5 --- Wmenus.py 2001/11/02 19:09:34 1.6 *************** *** 1,6 **** import FrameWork - from Carbon import Qd import Wbase, Wcontrols ! from Carbon import Ctl, Controls from types import * import Wapplication --- 1,5 ---- import FrameWork import Wbase, Wcontrols ! from Carbon import Ctl, Controls, Qd from types import * import Wapplication Index: Wwindows.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wwindows.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Wwindows.py 2001/08/27 10:54:55 1.12 --- Wwindows.py 2001/11/02 19:09:34 1.13 *************** *** 1,17 **** ! 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 - from Carbon import Menu import struct import traceback ! ! from types import * --- 1,10 ---- ! from Carbon import Dlg, Evt, Events, Fm ! from Carbon import Menu, Qd, Win, Windows import FrameWork import Wbase import MacOS import struct import traceback ! from types import InstanceType, StringType Index: Wbase.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wbase.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Wbase.py 2001/10/31 12:55:07 1.6 --- Wbase.py 2001/11/02 19:09:34 1.7 *************** *** 1,13 **** ! from Carbon import Qd ! from Carbon import Win ! from Carbon import QuickDraw ! from Carbon import Evt import string from types import * import sys ! WidgetsError = "WidgetsError" DEBUG = 0 class Widget: --- 1,11 ---- ! from Carbon import Evt, Qd, QuickDraw, Win import string from types import * import sys ! class WidgetsError(Exception): pass DEBUG = 0 + class Widget: From jvr@users.sourceforge.net Fri Nov 2 19:17:18 2001 From: jvr@users.sourceforge.net (Just van Rossum) Date: Fri, 02 Nov 2001 11:17:18 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wcontrols.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv1343 Modified Files: Wcontrols.py Log Message: - rearranged some imports - removed default button drawing code: this doesn't work well under OSX. Needs to be replaced by SetWindowDefaultButton() calls, once we have those. Index: Wcontrols.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wcontrols.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Wcontrols.py 2001/08/25 12:13:59 1.7 --- Wcontrols.py 2001/11/02 19:17:16 1.8 *************** *** 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): --- 1,6 ---- ! from Carbon import Ctl, Controls ! from Carbon import Evt, Qd, Win import Wbase ! class ControlWidget(Wbase.ClickableWidget): *************** *** 118,124 **** self._control.HiliteControl((not onoff) and 255) self._enabled = onoff - if self._isdefault and self._visible: - self.SetPort() - self.drawfatframe(onoff) def activate(self, onoff): --- 116,119 ---- *************** *** 126,160 **** if self._enabled: self._control.HiliteControl((not onoff) and 255) - if self._isdefault and self._visible: - self.SetPort() - self.drawfatframe(onoff) def show(self, onoff): ControlWidget.show(self, onoff) - if self._isdefault: - self.drawfatframe(onoff and self._enabled) def draw(self, visRgn = None): if self._visible: self._control.Draw1Control() - if self._isdefault and self._activated: - self.drawfatframe(self._enabled) - - def drawfatframe(self, onoff): - state = Qd.GetPenState() - if onoff: - Qd.PenPat(Qd.qd.black) - else: - Qd.PenPat(Qd.qd.white) - fatrect = Qd.InsetRect(self._bounds, -4, -4) - Qd.PenSize(3, 3) - Qd.FrameRoundRect(fatrect, 16, 16) - Qd.SetPenState(state) def _setdefault(self, onoff): self._isdefault = onoff - if self._control and self._enabled: - self.SetPort() - self.drawfatframe(onoff) def adjust(self, oldbounds): --- 121,134 ---- From jvr@users.sourceforge.net Fri Nov 2 19:21:36 2001 From: jvr@users.sourceforge.net (Just van Rossum) Date: Fri, 02 Nov 2001 11:21:36 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PyBrowser.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv3280 Modified Files: PyBrowser.py Log Message: fixed a non-Carbon Carbon import Index: PyBrowser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyBrowser.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** PyBrowser.py 2001/08/25 12:09:29 1.10 --- PyBrowser.py 2001/11/02 19:21:34 1.11 *************** *** 290,294 **** text = string.join(selitems, '\r') if text: ! import Scrap Scrap.ZeroScrap() Scrap.PutScrap('TEXT', text) --- 290,294 ---- text = string.join(selitems, '\r') if text: ! from Carbon import Scrap Scrap.ZeroScrap() Scrap.PutScrap('TEXT', text) From jvr@users.sourceforge.net Fri Nov 2 19:22:57 2001 From: jvr@users.sourceforge.net (Just van Rossum) Date: Fri, 02 Nov 2001 11:22:57 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE W.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv3559 Modified Files: W.py Log Message: changed the default font Index: W.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/W.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** W.py 1999/09/26 12:17:04 1.2 --- W.py 2001/11/02 19:22:55 1.3 *************** *** 28,32 **** prefs = getapplication().getprefs() if not prefs.defaultfont: ! prefs.defaultfont = ("Python-Sans", 0, 9, (0, 0, 0)) return prefs.defaultfont --- 28,32 ---- prefs = getapplication().getprefs() if not prefs.defaultfont: ! prefs.defaultfont = ("Geneva", 0, 10, (0, 0, 0)) return prefs.defaultfont From jvr@users.sourceforge.net Fri Nov 2 19:24:43 2001 From: jvr@users.sourceforge.net (Just van Rossum) Date: Fri, 02 Nov 2001 11:24:43 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wtext.py,1.13,1.14 PyEdit.py,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv4017 Modified Files: Wtext.py PyEdit.py Log Message: some support for syntax coloring, disabled for now Index: Wtext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wtext.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Wtext.py 2001/08/27 10:54:50 1.13 --- Wtext.py 2001/11/02 19:24:41 1.14 *************** *** 1,22 **** ! 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 - - from Carbon import Win import Wbase import Wkeys import Wcontrols import PyFontify ! from types import * ! from Carbon import Fonts ! from Carbon import TextEdit ! --- 1,13 ---- ! from Carbon import Evt, Events, Fm, Fonts ! from Carbon import Qd, Res, Scrap ! from Carbon import TE, TextEdit, Win import waste import WASTEconst import Wbase import Wkeys import Wcontrols import PyFontify ! import string ! from types import TupleType, StringType *************** *** 106,109 **** --- 97,101 ---- self.ted = None self.selection = None + self.oldselection = None self._callback = callback self.changed = 0 *************** *** 156,159 **** --- 148,158 ---- Wbase.SelectableWidget.close(self) + def textchanged(self, all=0): + self.changed = 1 + + def selectionchanged(self): + self.selchanged = 1 + self.oldselection = self.getselection() + def gettabsettings(self): return self.tabsettings *************** *** 209,213 **** Qd.EraseRect(viewrect) self.ted.WEUpdate(self._parentwindow.wid.GetWindowPort().visRgn) ! self.selchanged = 1 self.updatescrollbars() --- 208,212 ---- Qd.EraseRect(viewrect) self.ted.WEUpdate(self._parentwindow.wid.GetWindowPort().visRgn) ! self.selectionchanged() self.updatescrollbars() *************** *** 236,240 **** def selectall(self): self.ted.WESetSelection(0, self.ted.WEGetTextLength()) ! self.selchanged = 1 self.updatescrollbars() --- 235,239 ---- def selectall(self): self.ted.WESetSelection(0, self.ted.WEGetTextLength()) ! self.selectionchanged() self.updatescrollbars() *************** *** 247,251 **** self.ted.WESetSelection(newselstart + charoffset, newselend-1) self.ted.WESetSelection(newselstart + charoffset, newselend) ! self.selchanged = 1 self.updatescrollbars() --- 246,250 ---- self.ted.WESetSelection(newselstart + charoffset, newselend-1) self.ted.WESetSelection(newselstart + charoffset, newselend) ! self.selectionchanged() self.updatescrollbars() *************** *** 257,261 **** def setselection(self, selstart, selend): ! self.selchanged = 1 if self.ted: self.ted.WESetSelection(selstart, selend) --- 256,260 ---- def setselection(self, selstart, selend): ! self.selectionchanged() if self.ted: self.ted.WESetSelection(selstart, selend) *************** *** 285,294 **** self.ted.WESetSelection(newselstart, newselend) self.updatescrollbars() ! self.selchanged = 1 def insert(self, text): self.ted.WEInsert(text, None, None) ! self.changed = 1 ! self.selchanged = 1 # text --- 284,293 ---- self.ted.WESetSelection(newselstart, newselend) self.updatescrollbars() ! self.selectionchanged() def insert(self, text): self.ted.WEInsert(text, None, None) ! self.textchanged() ! self.selectionchanged() # text *************** *** 307,312 **** Qd.EraseRect(viewrect) self.draw(rgn) - #self.GetWindow().InvalWindowRect(self.ted.WEGetViewRect()) self.updatescrollbars() def get(self): --- 306,311 ---- Qd.EraseRect(viewrect) self.draw(rgn) self.updatescrollbars() + self.textchanged(1) def get(self): *************** *** 322,328 **** self.ted.WEKey(ord(char), modifiers) if char not in Wkeys.navigationkeys: ! self.changed = 1 if char not in Wkeys.scrollkeys: ! self.selchanged = 1 self.updatescrollbars() if self._callback: --- 321,327 ---- self.ted.WEKey(ord(char), modifiers) if char not in Wkeys.navigationkeys: ! self.textchanged() if char not in Wkeys.scrollkeys: ! self.selectionchanged() self.updatescrollbars() if self._callback: *************** *** 333,337 **** return self.ted.WEClick(point, modifiers, Evt.TickCount()) ! self.selchanged = 1 self.updatescrollbars() return 1 --- 332,336 ---- return self.ted.WEClick(point, modifiers, Evt.TickCount()) ! self.selectionchanged() self.updatescrollbars() return 1 *************** *** 412,417 **** self.updatescrollbars() self.selview() ! self.changed = 1 ! self.selchanged = 1 if self._callback: Wbase.CallbackCall(self._callback, 0, "", None) --- 411,416 ---- self.updatescrollbars() self.selview() ! self.textchanged() ! self.selectionchanged() if self._callback: Wbase.CallbackCall(self._callback, 0, "", None) *************** *** 423,428 **** self.ted.WEPaste() self.updatescrollbars() ! self.changed = 1 ! self.selchanged = 1 if self._callback: Wbase.CallbackCall(self._callback, 0, "", None) --- 422,427 ---- self.ted.WEPaste() self.updatescrollbars() ! self.textchanged() ! self.selectionchanged() if self._callback: Wbase.CallbackCall(self._callback, 0, "", None) *************** *** 432,437 **** self.selview() self.updatescrollbars() ! self.changed = 1 ! self.selchanged = 1 if self._callback: Wbase.CallbackCall(self._callback, 0, "", None) --- 431,436 ---- self.selview() self.updatescrollbars() ! self.textchanged() ! self.selectionchanged() if self._callback: Wbase.CallbackCall(self._callback, 0, "", None) *************** *** 443,448 **** self.ted.WEUndo() self.updatescrollbars() ! self.changed = 1 ! self.selchanged = 1 if self._callback: Wbase.CallbackCall(self._callback, 0, "", None) --- 442,447 ---- self.ted.WEUndo() self.updatescrollbars() ! self.textchanged() ! self.selectionchanged() if self._callback: Wbase.CallbackCall(self._callback, 0, "", None) *************** *** 611,614 **** --- 610,615 ---- commentPat = re.compile("[ \t]*(#)") indentPat = re.compile("[ \t]*") + kStringColor = (0, 0x7fff, 0) + kCommentColor = (0, 0, 0xb000) *************** *** 628,635 **** --- 629,737 ---- self.bind("cmdshift[", self.domenu_uncomment) self.bind("cmdshift]", self.domenu_comment) + self.bind("cmdshiftd", self.alldirty) self.file = file # only for debugger reference self._debugger = debugger if debugger: debugger.register_editor(self, self.file) + self._dirty = (0, None) + self.do_fontify = 0 + + #def open(self): + # TextEditor.open(self) + # if self.do_fontify: + # self.fontify() + # self._dirty = (None, None) + + def _getflags(self): + flags = (WASTEconst.weDoDrawOffscreen | WASTEconst.weDoUseTempMem | + WASTEconst.weDoAutoScroll | WASTEconst.weDoOutlineHilite) + if self.readonly: + flags = flags | WASTEconst.weDoReadOnly + else: + flags = flags | WASTEconst.weDoUndo + return flags + + def textchanged(self, all=0): + self.changed = 1 + if all: + self._dirty = (0, None) + return + oldsel = self.oldselection + sel = self.getselection() + if not sel: + # XXX what to do? + return + selstart, selend = sel + selstart, selend = min(selstart, selend), max(selstart, selend) + if oldsel: + oldselstart, oldselend = min(oldsel), max(oldsel) + selstart, selend = min(selstart, oldselstart), max(selend, oldselend) + startline = self.offsettoline(selstart) + endline = self.offsettoline(selend) + selstart, _ = self.ted.WEGetLineRange(startline) + _, selend = self.ted.WEGetLineRange(endline) + if selstart > 0: + selstart = selstart - 1 + self._dirty = (selstart, selend) + + def idle(self): + self.SetPort() + self.ted.WEIdle() + if not self.do_fontify: + return + start, end = self._dirty + if start is None: + return + textLength = self.ted.WEGetTextLength() + if end is None: + end = textLength + if start >= end: + self._dirty = (None, None) + else: + self.fontify(start, end) + self._dirty = (None, None) + + def alldirty(self, *args): + self._dirty = (0, None) + + def fontify(self, start=0, end=None): + #W.SetCursor('watch') + if self.readonly: + self.ted.WEFeatureFlag(WASTEconst.weFReadOnly, 0) + self.ted.WEFeatureFlag(WASTEconst.weFOutlineHilite, 0) + self.ted.WEDeactivate() + self.ted.WEFeatureFlag(WASTEconst.weFAutoScroll, 0) + self.ted.WEFeatureFlag(WASTEconst.weFUndo, 0) + pytext = self.get().replace("\r", "\n") + if end is None: + end = len(pytext) + else: + end = min(end, len(pytext)) + selstart, selend = self.ted.WEGetSelection() + self.ted.WESetSelection(start, end) + self.ted.WESetStyle(WASTEconst.weDoFace | WASTEconst.weDoColor, + (0, 0, 12, (0, 0, 0))) + + tags = PyFontify.fontify(pytext, start, end) + styles = { + 'string': (WASTEconst.weDoColor, (0, 0, 0, kStringColor)), + 'keyword': (WASTEconst.weDoFace, (0, 1, 0, (0, 0, 0))), + 'comment': (WASTEconst.weDoFace | WASTEconst.weDoColor, (0, 0, 0, kCommentColor)), + 'identifier': (WASTEconst.weDoColor, (0, 0, 0, (0xbfff, 0, 0))) + } + setselection = self.ted.WESetSelection + setstyle = self.ted.WESetStyle + for tag, start, end, sublist in tags: + setselection(start, end) + mode, style = styles[tag] + setstyle(mode, style) + self.ted.WESetSelection(selstart, selend) + self.SetPort() + self.ted.WEFeatureFlag(WASTEconst.weFAutoScroll, 1) + self.ted.WEFeatureFlag(WASTEconst.weFUndo, 1) + self.ted.WEActivate() + self.ted.WEFeatureFlag(WASTEconst.weFOutlineHilite, 1) + if self.readonly: + self.ted.WEFeatureFlag(WASTEconst.weFReadOnly, 1) def domenu_shiftleft(self): *************** *** 787,792 **** self.ted.WEKey(ord(char), modifiers) if char not in Wkeys.navigationkeys: ! self.changed = 1 ! self.selchanged = 1 self.updatescrollbars() --- 889,894 ---- self.ted.WEKey(ord(char), modifiers) if char not in Wkeys.navigationkeys: ! self.textchanged() ! self.selectionchanged() self.updatescrollbars() Index: PyEdit.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyEdit.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** PyEdit.py 2001/08/25 12:10:15 1.23 --- PyEdit.py 2001/11/02 19:24:41 1.24 *************** *** 97,101 **** self.setupwidgets(text) if change > 0: ! self.editgroup.editor.changed = 1 if self.settings.has_key("selection"): --- 97,101 ---- self.setupwidgets(text) if change > 0: ! self.editgroup.editor.textchanged() if self.settings.has_key("selection"): *************** *** 248,257 **** self.run_as_main = not self.run_as_main self.run_with_interpreter = 0 ! self.editgroup.editor.selchanged = 1 def domenu_toggle_run_with_interpreter(self): self.run_with_interpreter = not self.run_with_interpreter self.run_as_main = 0 ! self.editgroup.editor.selchanged = 1 def showbreakpoints(self, onoff): --- 248,257 ---- self.run_as_main = not self.run_as_main self.run_with_interpreter = 0 ! self.editgroup.editor.selectionchanged() def domenu_toggle_run_with_interpreter(self): self.run_with_interpreter = not self.run_with_interpreter self.run_as_main = 0 ! self.editgroup.editor.selectionchanged() def showbreakpoints(self, onoff): *************** *** 315,319 **** rv = SaveOptions(self._creator) if rv: ! self.editgroup.editor.selchanged = 1 # ouch... self._creator = rv --- 315,319 ---- rv = SaveOptions(self._creator) if rv: ! self.editgroup.editor.selectionchanged() # ouch... self._creator = rv *************** *** 634,637 **** --- 634,639 ---- modname = dirname + '.' + modname subname = _filename_as_modname(self.title) + if subname is None: + return self.globals, file, None if modname: if subname == "__init__": *************** *** 950,955 **** import EasyDialogs from Carbon import Res ! editor.changed = 1 ! editor.selchanged = 1 editor.ted.WEUseText(Res.Resource(Text)) editor.ted.WECalText() --- 952,957 ---- import EasyDialogs from Carbon import Res ! editor.textchanged() ! editor.selectionchanged() editor.ted.WEUseText(Res.Resource(Text)) editor.ted.WECalText() *************** *** 1148,1151 **** --- 1150,1156 ---- except (KeyboardInterrupt, BdbQuit): pass + except SystemExit, arg: + if arg.code: + sys.stderr.write("Script exited with status code: %s\n" % repr(arg.code)) except: if haveThreading: *************** *** 1269,1273 **** windowsize = prefs.pyedit.windowsize except: ! fontsettings = prefs.pyedit.fontsettings = ("Python-Sans", 0, 9, (0, 0, 0)) tabsettings = prefs.pyedit.tabsettings = (8, 1) windowsize = prefs.pyedit.windowsize = (500, 250) --- 1274,1278 ---- windowsize = prefs.pyedit.windowsize except: ! fontsettings = prefs.pyedit.fontsettings = ("Geneva", 0, 10, (0, 0, 0)) tabsettings = prefs.pyedit.tabsettings = (8, 1) windowsize = prefs.pyedit.windowsize = (500, 250) From jvr@users.sourceforge.net Fri Nov 2 19:30:23 2001 From: jvr@users.sourceforge.net (Just van Rossum) Date: Fri, 02 Nov 2001 11:30:23 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Splash.py,1.14,1.15 PythonIDEMain.py,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv5744 Modified Files: Splash.py PythonIDEMain.py Log Message: removed import display hackery Index: Splash.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Splash.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Splash.py 2001/08/25 12:12:52 1.14 --- Splash.py 2001/11/02 19:30:21 1.15 *************** *** 6,79 **** from Carbon import Qd, TE, Fm - import sys - - _real__import__ = None - - def install_importhook(): - global _real__import__ - import __builtin__ - if _real__import__ is None: - _real__import__ = __builtin__.__import__ - __builtin__.__import__ = my__import__ - - def uninstall_importhook(): - global _real__import__ - if _real__import__ is not None: - import __builtin__ - __builtin__.__import__ = _real__import__ - _real__import__ = None - - _progress = 0 - - _about_width = 440 - _about_height = 340 - - def importing(module): - global _progress - Qd.SetPort(splash) - fontID = Fm.GetFNum("Python-Sans") - if not fontID: - from Carbon.Fonts import geneva - fontID = geneva - Qd.TextFont(fontID) - Qd.TextSize(9) - labelrect = (35, _about_height - 35, _about_width - 35, _about_height - 19) - framerect = (35, _about_height - 19, _about_width - 35, _about_height - 11) - l, t, r, b = progrect = Qd.InsetRect(framerect, 1, 1) - if module: - TE.TETextBox('Importing: ' + module, labelrect, 0) - if not _progress: - Qd.FrameRect(framerect) - pos = min(r, l + ((r - l) * _progress) / 44) - Qd.PaintRect((l, t, pos, b)) - _progress = _progress + 1 - else: - Qd.EraseRect(labelrect) - Qd.PaintRect((l, t, pos, b)) - Qd.QDFlushPortBuffer(splash.GetDialogWindow().GetWindowPort(), None) - - def my__import__(name, globals=None, locals=None, fromlist=None): - try: - return sys.modules[name] - except KeyError: - try: - importing(name) - except: - try: - rv = _real__import__(name) - finally: - uninstall_importhook() - return rv - return _real__import__(name) - #install_importhook() - - kHighLevelEvent = 23 from Carbon import Win from Carbon.Fonts import * from Carbon.QuickDraw import * ! from Carbon.TextEdit import * import string import sys _keepsplashscreenopen = 0 --- 6,19 ---- from Carbon import Qd, TE, Fm from Carbon import Win from Carbon.Fonts import * from Carbon.QuickDraw import * ! from Carbon.TextEdit import teJustCenter import string import sys + + _about_width = 440 + _about_height = 340 _keepsplashscreenopen = 0 Index: PythonIDEMain.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PythonIDEMain.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** PythonIDEMain.py 2001/08/25 12:10:43 1.13 --- PythonIDEMain.py 2001/11/02 19:30:21 1.14 *************** *** 1,3 **** ! # copyright 1997-2000 Just van Rossum, Letterror. just@letterror.com import Splash --- 1,3 ---- ! # copyright 1997-2001 Just van Rossum, Letterror. just@letterror.com import Splash *************** *** 30,34 **** import PyConsole, PyEdit Splash.wait() - Splash.uninstall_importhook() PyConsole.installoutput() PyConsole.installconsole() --- 30,33 ---- From jvr@users.sourceforge.net Fri Nov 2 19:30:51 2001 From: jvr@users.sourceforge.net (Just van Rossum) Date: Fri, 02 Nov 2001 11:30:51 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PythonIDE.rsrc,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv5858 Modified Files: PythonIDE.rsrc Log Message: wintertime blues Index: PythonIDE.rsrc =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PythonIDE.rsrc,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 Binary files /tmp/cvsINcJVF and /tmp/cvs8m5eMd differ From fdrake@users.sourceforge.net Fri Nov 2 19:34:51 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 02 Nov 2001 11:34:51 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/ref ref6.tex,1.37.2.1,1.37.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv7211/ref Modified Files: Tag: release21-maint ref6.tex Log Message: \ulink is not available on the maintenance branch, so we can't use it. Index: ref6.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref6.tex,v retrieving revision 1.37.2.1 retrieving revision 1.37.2.2 diff -C2 -d -r1.37.2.1 -r1.37.2.2 *** ref6.tex 2001/10/24 19:52:14 1.37.2.1 --- ref6.tex 2001/11/02 19:34:49 1.37.2.2 *************** *** 603,608 **** The built-in function \function{__import__()} is provided to support applications that determine which modules need to be loaded ! dynamically; refer to \ulink{Built-in ! Functions}{../lib/built-in-funcs.html} in the \citetitle[../lib/lib.html]{Python Library Reference} for additional information. --- 603,607 ---- The built-in function \function{__import__()} is provided to support applications that determine which modules need to be loaded ! dynamically; refer to ``Built-in Functions'' in the \citetitle[../lib/lib.html]{Python Library Reference} for additional information. From fdrake@users.sourceforge.net Fri Nov 2 19:41:25 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 02 Nov 2001 11:41:25 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib compiler.tex,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv8966/lib Modified Files: compiler.tex Log Message: Make sure there are no weird nesting behaviors; the PDF version will not format if there are (building the "bookmarks" for the reader breaks). Index: compiler.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/compiler.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** compiler.tex 2001/09/27 20:06:07 1.1 --- compiler.tex 2001/11/02 19:41:23 1.2 *************** *** 31,35 **** ! \subsection{The basic interface} \declaremodule{}{compiler} --- 31,35 ---- ! \section{The basic interface} \declaremodule{}{compiler} *************** *** 68,72 **** \module{transformer}, and \refmodule[compiler.visitor]{visitor}. ! \subsection{Limitations} There are some problems with the error checking of the compiler --- 68,72 ---- \module{transformer}, and \refmodule[compiler.visitor]{visitor}. ! \section{Limitations} There are some problems with the error checking of the compiler From fdrake@users.sourceforge.net Fri Nov 2 20:20:21 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 02 Nov 2001 12:20:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libstatcache.tex,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv19845/lib Modified Files: libstatcache.tex Log Message: Add deprecation notice to statcache. Index: libstatcache.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstatcache.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** libstatcache.tex 2000/12/01 15:25:23 1.3 --- libstatcache.tex 2001/11/02 20:20:19 1.4 *************** *** 6,9 **** --- 6,15 ---- \modulesynopsis{Stat files, and remember results.} + + \deprecated{2.2}{Use \function{\refmodule{os}.stat()} directly instead + of using the cache; the cache introduces a very high level of + fragility in applications using it and complicates application code + with the addition of cache management support.} + The \module{statcache} module provides a simple optimization to \function{os.stat()}: remembering the values of previous invocations. From bwarsaw@users.sourceforge.net Fri Nov 2 20:44:59 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 02 Nov 2001 12:44:59 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0273.txt,1.4,1.5 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv26983 Modified Files: pep-0273.txt Log Message: Jim's latest update Index: pep-0273.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0273.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** pep-0273.txt 2001/10/31 14:46:21 1.4 --- pep-0273.txt 2001/11/02 20:44:57 1.5 *************** *** 12,17 **** Abstract ! This PEP adds the ability to import compiled Python modules ! *.py[co] and packages from zip archives. --- 12,17 ---- Abstract ! This PEP adds the ability to import Python modules ! *.py, *.py[co] and packages from zip archives. *************** *** 27,36 **** all supported Python platforms. ! Any files may be present in the zip archive, but only files *.pyc, ! *.pyo and __init__.py[co] are available for import. Zip import of ! *.py and dynamic modules (*.pyd, *.so) is disallowed. ! Just as sys.path currently has default directory names, default ! zip archive names are added too. Otherwise there is no way to import all Python library files from an archive. --- 27,36 ---- all supported Python platforms. ! Any files may be present in the zip archive, but only files ! *.py and *.py[co] are available for import. Zip import of ! dynamic modules (*.pyd, *.so) is disallowed. ! Just as sys.path currently has default directory names, a default ! zip archive name is added too. Otherwise there is no way to import all Python library files from an archive. *************** *** 69,86 **** the dynload_*.c, and that's probably not a good idea. ! You also can't import source files *.py from a zip archive. The ! problem here is what to do with the compiled files. Python would ! normally write these to the same directory as *.py, but surely we don't want to write to the zip file. We could write to the directory of the zip archive, but that would clutter it up, not ! good if it is /usr/bin for example. We could just fail to write ! the compiled files, but that makes zip imports very slow, and the ! user would probably not figure out what is wrong. It is probably ! best for users to put *.pyc into zip archives in the first place, ! and this PEP enforces that rule. ! So the only imports zip archives support are *.pyc and *.pyo, plus ! the import of __init__.py[co] for packages, and the search of the ! subdirectory structure for the same. --- 69,85 ---- the dynload_*.c, and that's probably not a good idea. ! When trying to import *.pyc, if it is not available then ! *.pyo will be used instead. And vice versa when looking for *.pyo. ! If neither *.pyc nor *.pyo is available, or if the magic numbers ! are invalid, then *.py will be compiled and used to satisfy the ! import, but the compiled file will not be saved. Python would ! normally write it to the same directory as *.py, but surely we don't want to write to the zip file. We could write to the directory of the zip archive, but that would clutter it up, not ! good if it is /usr/bin for example. ! Failing to write the compiled files will make zip imports very slow, ! and the user will probably not figure out what is wrong. So it ! is best to put *.pyc and *.pyo in the archive with the *.py. *************** *** 143,147 **** On Windows, the directory is the directory of sys.executable. The zip archive name is always inserted as the second item ! in sys.path. The first always seems to be ''. Implementation --- 142,146 ---- On Windows, the directory is the directory of sys.executable. The zip archive name is always inserted as the second item ! in sys.path. The first is the directory of the main.py (thanks Tim). Implementation From fdrake@users.sourceforge.net Fri Nov 2 20:53:21 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 02 Nov 2001 12:53:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/texinputs python.sty,1.84,1.85 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory usw-pr-cvs1:/tmp/cvs-serv1097/texinputs Modified Files: python.sty Log Message: Fix stupid bug recently introduced for DVI version of the docs (used to generate PostScript). Index: python.sty =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/python.sty,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** python.sty 2001/10/29 21:02:28 1.84 --- python.sty 2001/11/02 20:53:19 1.85 *************** *** 884,888 **** } \else ! \newcommand{\citetitle}[2][URL]{#1} \fi --- 884,888 ---- } \else ! \newcommand{\citetitle}[2][URL]{\emph{#2}} \fi From jvr@users.sourceforge.net Fri Nov 2 21:12:54 2001 From: jvr@users.sourceforge.net (Just van Rossum) Date: Fri, 02 Nov 2001 13:12:54 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wcontrols.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv7475 Modified Files: Wcontrols.py Log Message: use proper APIs for activate/deactivate Index: Wcontrols.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wcontrols.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Wcontrols.py 2001/11/02 19:17:16 1.8 --- Wcontrols.py 2001/11/02 21:12:52 1.9 *************** *** 66,70 **** self._activated = onoff if self._enabled: ! self._control.HiliteControl((not onoff) and 255) def draw(self, visRgn = None): --- 66,73 ---- self._activated = onoff if self._enabled: ! if onoff: ! self._control.ActivateControl() ! else: ! self._control.DeactivateControl() def draw(self, visRgn = None): *************** *** 106,110 **** return import time ! self._control.HiliteControl(1) time.sleep(0.1) self._control.HiliteControl(0) --- 109,113 ---- return import time ! self._control.HiliteControl(Controls.kControlButtonPart) time.sleep(0.1) self._control.HiliteControl(0) *************** *** 117,125 **** self._enabled = onoff - def activate(self, onoff): - self._activated = onoff - if self._enabled: - self._control.HiliteControl((not onoff) and 255) - def show(self, onoff): ControlWidget.show(self, onoff) --- 120,123 ---- *************** *** 333,346 **** self.GetWindow().ValidWindowRect(self._bounds) - def activate(self, onoff): - self._activated = onoff - if self._visible: - if onoff: - self._control.ShowControl() - else: - self._control.HideControl() - self.draw(None) - self.GetWindow().ValidWindowRect(self._bounds) - def set(self, value): if self._control: --- 331,334 ---- From akuchling@users.sourceforge.net Fri Nov 2 21:41:02 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Fri, 02 Nov 2001 13:41:02 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules md5module.c,2.24,2.25 shamodule.c,2.14,2.15 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv15179 Modified Files: md5module.c shamodule.c Log Message: [Patch #476612] Add attributes from PEP247 to the md5 and sha modules Index: md5module.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/md5module.c,v retrieving revision 2.24 retrieving revision 2.25 diff -C2 -d -r2.24 -r2.25 *** md5module.c 2000/09/01 23:29:26 2.24 --- md5module.c 2001/11/02 21:41:00 2.25 *************** *** 162,165 **** --- 162,169 ---- md5_getattr(md5object *self, char *name) { + if (strcmp(name, "digest_size") == 0) { + return PyInt_FromLong(16); + } + return Py_FindMethod(md5_methods, (PyObject *)self, name); } *************** *** 265,269 **** initmd5(void) { ! PyObject *m, *d; MD5type.ob_type = &PyType_Type; --- 269,273 ---- initmd5(void) { ! PyObject *m, *d, *i; MD5type.ob_type = &PyType_Type; *************** *** 271,274 **** --- 275,280 ---- d = PyModule_GetDict(m); PyDict_SetItemString(d, "MD5Type", (PyObject *)&MD5type); + if ( (i = PyInt_FromLong(16)) != NULL) + PyDict_SetItemString(d, "digest_size", i); /* No need to check the error here, the caller will do that */ } Index: shamodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/shamodule.c,v retrieving revision 2.14 retrieving revision 2.15 diff -C2 -d -r2.14 -r2.15 *** shamodule.c 2001/01/29 22:46:35 2.14 --- shamodule.c 2001/11/02 21:41:00 2.15 *************** *** 6,10 **** based upon. Additional work performed by: ! Andrew Kuchling (amk1@bigfoot.com) Greg Stein (gstein@lyra.org) */ --- 6,10 ---- based upon. Additional work performed by: ! Andrew Kuchling (akuchlin@mems-exchange.org) Greg Stein (gstein@lyra.org) */ *************** *** 459,464 **** if (strcmp(name, "blocksize")==0) return PyInt_FromLong(1); ! if (strcmp(name, "digestsize")==0) ! return PyInt_FromLong(20); return Py_FindMethod(SHA_methods, self, name); --- 459,464 ---- if (strcmp(name, "blocksize")==0) return PyInt_FromLong(1); ! if (strcmp(name, "digest_size")==0 || strcmp(name, "digestsize")==0) ! return PyInt_FromLong(20); return Py_FindMethod(SHA_methods, self, name); *************** *** 543,545 **** --- 543,546 ---- blocks */ insint("digestsize", 20); + insint("digest_size", 20); } From akuchling@users.sourceforge.net Fri Nov 2 21:44:11 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Fri, 02 Nov 2001 13:44:11 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libmd5.tex,1.20,1.21 libsha.tex,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv16151 Modified Files: libmd5.tex libsha.tex Log Message: [Patch #476612] Change docs to describe PEP247 interface Index: libmd5.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmd5.tex,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** libmd5.tex 2001/07/06 19:28:48 1.20 --- libmd5.tex 2001/11/02 21:44:09 1.21 *************** *** 36,39 **** --- 36,49 ---- \end{verbatim} + The following values are provided as constants in the module and as + attributes of the md5 objects returned by \function{new()}: + + \begin{datadesc}{digest_size} + The size of the resulting digest in bytes. This is always + \code{16}. + \end{datadesc} + + md5 objects support the following methods: + \begin{funcdesc}{new}{\optional{arg}} Return a new md5 object. If \var{arg} is present, the method call Index: libsha.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsha.tex,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** libsha.tex 2001/09/06 18:59:43 1.9 --- libsha.tex 2001/11/02 21:44:09 1.10 *************** *** 32,36 **** \end{datadesc} ! \begin{datadesc}{digestsize} The size of the resulting digest in bytes. This is always \code{20}. --- 32,36 ---- \end{datadesc} ! \begin{datadesc}{digest_size} The size of the resulting digest in bytes. This is always \code{20}. From akuchling@users.sourceforge.net Fri Nov 2 21:45:41 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Fri, 02 Nov 2001 13:45:41 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test___all__.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv16874 Modified Files: test___all__.py Log Message: Fix comment typo Index: test___all__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test___all__.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** test___all__.py 2001/09/04 15:22:02 1.20 --- test___all__.py 2001/11/02 21:45:39 1.21 *************** *** 16,20 **** # So when test_pty is called later, the import of pty succeeds, # but shouldn't. As a result, test_pty crashes with an ! # AtttributeError instead of an ImportError, and regrtest interprets # the latter as a test failure (ImportError is treated as "test # skipped" -- which is what test_pty should say on Windows). --- 16,20 ---- # So when test_pty is called later, the import of pty succeeds, # but shouldn't. As a result, test_pty crashes with an ! # AttributeError instead of an ImportError, and regrtest interprets # the latter as a test failure (ImportError is treated as "test # skipped" -- which is what test_pty should say on Windows). From akuchling@users.sourceforge.net Fri Nov 2 21:46:20 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Fri, 02 Nov 2001 13:46:20 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_pep247.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv17004 Added Files: test_pep247.py Log Message: [Patch #476612] Add test suite for PEP247 compliance --- NEW FILE: test_pep247.py --- # # Test suite to check compliance with PEP 247, the standard API for # hashing algorithms. # import md5, sha, hmac def check_hash_module(module, key=None): assert hasattr(module, 'digest_size'), "Must have digest_size" assert (module.digest_size is None or module.digest_size > 0), "digest_size must be None or positive" if key is not None: obj1 = module.new(key) obj2 = module.new(key, "string") h1 = module.new(key, "string").digest() obj3 = module.new(key) ; obj3.update("string") ; h2 = obj3.digest() assert h1 == h2, "Hashes must match" else: obj1 = module.new() obj2 = module.new("string") h1 = module.new("string").digest() obj3 = module.new() ; obj3.update("string") ; h2 = obj3.digest() assert h1 == h2, "Hashes must match" assert hasattr(obj1, 'digest_size'), "Objects must have digest_size attr" if module.digest_size is not None: assert obj1.digest_size == module.digest_size, "digest_size must match" assert obj1.digest_size == len(h1), "digest_size must match actual size" obj1.update("string") obj_copy = obj1.copy() assert obj1.digest() == obj_copy.digest(), "Copied objects must match" assert obj1.hexdigest() == obj_copy.hexdigest(), \ "Copied objects must match" digest, hexdigest = obj1.digest(), obj1.hexdigest() hd2 = "" for byte in digest: hd2 += "%02x" % ord(byte) assert hd2 == hexdigest, "hexdigest doesn't appear correct" print 'Module', module.__name__, 'seems to comply with PEP 247' if __name__ == '__main__': check_hash_module(md5) check_hash_module(sha) check_hash_module(hmac, key='abc') From akuchling@users.sourceforge.net Fri Nov 2 21:49:22 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Fri, 02 Nov 2001 13:49:22 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib hmac.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv17429 Modified Files: hmac.py Log Message: [Patch #477336] Make hmac.py match PEP247, and fix the copy method() so that it works Index: hmac.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/hmac.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** hmac.py 2001/09/18 02:26:39 1.2 --- hmac.py 2001/11/02 21:49:20 1.3 *************** *** 11,18 **** return "".join(map(lambda x, y: chr(ord(x) ^ ord(y)), s1, s2)) class HMAC: """RFC2104 HMAC class. ! This (mostly) supports the API for Cryptographic Hash Functions (PEP 247). """ --- 11,22 ---- return "".join(map(lambda x, y: chr(ord(x) ^ ord(y)), s1, s2)) + # The size of the digests returned by HMAC depends on the underlying + # hashing module used. + digest_size = None + class HMAC: """RFC2104 HMAC class. ! This supports the API for Cryptographic Hash Functions (PEP 247). """ *************** *** 28,34 **** digestmod = md5 self.outer = digestmod.new() self.inner = digestmod.new() ! blocksize = 64 ipad = "\x36" * blocksize --- 32,40 ---- digestmod = md5 + self.digestmod = digestmod self.outer = digestmod.new() self.inner = digestmod.new() ! self.digest_size = digestmod.digest_size ! blocksize = 64 ipad = "\x36" * blocksize *************** *** 57,61 **** An update to this copy won't affect the original object. """ ! return HMAC(self) def digest(self): --- 63,71 ---- An update to this copy won't affect the original object. """ ! other = HMAC("") ! other.digestmod = self.digestmod ! other.inner = self.inner.copy() ! other.outer = self.outer.copy() ! return other def digest(self): *************** *** 89,110 **** return HMAC(key, msg, digestmod) - def test(): - def md5test(key, data, digest): - h = HMAC(key, data) - assert(h.hexdigest().upper() == digest.upper()) - - # Test vectors from the RFC - md5test(chr(0x0b) * 16, - "Hi There", - "9294727A3638BB1C13F48EF8158BFC9D") - - md5test("Jefe", - "what do ya want for nothing?", - "750c783e6ab0b503eaa86e310a5db738") - - md5test(chr(0xAA)*16, - chr(0xDD)*50, - "56be34521d144c88dbb8c733f0e8b3f6") - - if __name__ == "__main__": - test() --- 99,100 ---- From akuchling@users.sourceforge.net Fri Nov 2 21:50:02 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Fri, 02 Nov 2001 13:50:02 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_hmac.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv17666 Modified Files: test_hmac.py Log Message: [Patch #477336] Add an extensive PyUnit based testsuite for the hmac module Index: test_hmac.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_hmac.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_hmac.py 2001/09/11 15:54:16 1.1 --- test_hmac.py 2001/11/02 21:49:59 1.2 *************** *** 1,2 **** import hmac ! hmac.test() --- 1,109 ---- import hmac ! import unittest ! import test_support ! ! class TestVectorsTestCase(unittest.TestCase): ! def test_vectors(self): ! """Test the HMAC module against test vectors from the RFC.""" ! ! def md5test(key, data, digest): ! h = hmac.HMAC(key, data) ! self.failUnless(h.hexdigest().upper() == digest.upper()) ! ! md5test(chr(0x0b) * 16, ! "Hi There", ! "9294727A3638BB1C13F48EF8158BFC9D") ! ! md5test("Jefe", ! "what do ya want for nothing?", ! "750c783e6ab0b503eaa86e310a5db738") ! ! md5test(chr(0xAA)*16, ! chr(0xDD)*50, ! "56be34521d144c88dbb8c733f0e8b3f6") ! ! class ConstructorTestCase(unittest.TestCase): ! def test_normal(self): ! """Standard constructor call.""" ! failed = 0 ! try: ! h = hmac.HMAC("key") ! except: ! self.fail("Standard constructor call raised exception.") ! ! def test_withtext(self): ! """Constructor call with text.""" ! try: ! h = hmac.HMAC("key", "hash this!") ! except: ! self.fail("Constructor call with text argument raised exception.") ! ! def test_withmodule(self): ! """Constructor call with text and digest module.""" ! import sha ! try: ! h = hmac.HMAC("key", "", sha) ! except: ! self.fail("Constructor call with sha module raised exception.") ! ! class SanityTestCase(unittest.TestCase): ! def test_default_is_md5(self): ! """Testing if HMAC defaults to MD5 algorithm.""" ! import md5 ! h = hmac.HMAC("key") ! self.failUnless(h.digestmod == md5) ! ! def test_exercise_all_methods(self): ! """Exercising all methods once.""" ! # This must not raise any exceptions ! try: ! h = hmac.HMAC("my secret key") ! h.update("compute the hash of this text!") ! dig = h.digest() ! dig = h.hexdigest() ! h2 = h.copy() ! except: ! fail("Exception raised during normal usage of HMAC class.") ! ! class CopyTestCase(unittest.TestCase): ! def test_attributes(self): ! """Testing if attributes are of same type.""" ! h1 = hmac.HMAC("key") ! h2 = h1.copy() ! self.failUnless(h1.digestmod == h2.digestmod, ! "Modules don't match.") ! self.failUnless(type(h1.inner) == type(h2.inner), ! "Types of inner don't match.") ! self.failUnless(type(h1.outer) == type(h2.outer), ! "Types of outer don't match.") ! ! def test_realcopy(self): ! """Testing if the copy method created a real copy.""" ! h1 = hmac.HMAC("key") ! h2 = h1.copy() ! # Using id() in case somebody has overridden __cmp__. ! self.failUnless(id(h1) != id(h2), "No real copy of the HMAC instance.") ! self.failUnless(id(h1.inner) != id(h2.inner), ! "No real copy of the attribute 'inner'.") ! self.failUnless(id(h1.outer) != id(h2.outer), ! "No real copy of the attribute 'outer'.") ! ! def test_equality(self): ! """Testing if the copy has the same digests.""" ! h1 = hmac.HMAC("key") ! h1.update("some random text") ! h2 = h1.copy() ! self.failUnless(h1.digest() == h2.digest(), ! "Digest of copy doesn't match original digest.") ! self.failUnless(h1.hexdigest() == h2.hexdigest(), ! "Hexdigest of copy doesn't match original hexdigest.") ! ! def test_main(): ! test_support.run_unittest(TestVectorsTestCase) ! test_support.run_unittest(ConstructorTestCase) ! test_support.run_unittest(SanityTestCase) ! test_support.run_unittest(CopyTestCase) ! ! if __name__ == "__main__": ! test_main() ! From fdrake@users.sourceforge.net Fri Nov 2 22:04:19 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 02 Nov 2001 14:04:19 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules shamodule.c,2.15,2.16 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv21398 Modified Files: shamodule.c Log Message: Clean up a Tab inconsistency. Simplfy the insint() macro to use PyModule_AddIntConstant(). Index: shamodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/shamodule.c,v retrieving revision 2.15 retrieving revision 2.16 diff -C2 -d -r2.15 -r2.16 *** shamodule.c 2001/11/02 21:41:00 2.15 --- shamodule.c 2001/11/02 22:04:17 2.16 *************** *** 460,464 **** return PyInt_FromLong(1); if (strcmp(name, "digest_size")==0 || strcmp(name, "digestsize")==0) ! return PyInt_FromLong(20); return Py_FindMethod(SHA_methods, self, name); --- 460,464 ---- return PyInt_FromLong(1); if (strcmp(name, "digest_size")==0 || strcmp(name, "digestsize")==0) ! return PyInt_FromLong(20); return Py_FindMethod(SHA_methods, self, name); *************** *** 525,531 **** /* Initialize this module. */ ! #define insint(n,v) { PyObject *o=PyInt_FromLong(v); \ ! if (o!=NULL) PyDict_SetItemString(d,n,o); \ ! Py_XDECREF(o); } DL_EXPORT(void) --- 525,529 ---- /* Initialize this module. */ ! #define insint(n,v) { PyModule_AddIntConstant(m,n,v); } DL_EXPORT(void) From fdrake@users.sourceforge.net Fri Nov 2 22:05:08 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 02 Nov 2001 14:05:08 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules md5module.c,2.25,2.26 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv21674 Modified Files: md5module.c Log Message: Simplify initmd5() to use PyModule_AddIntConstant(). Index: md5module.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/md5module.c,v retrieving revision 2.25 retrieving revision 2.26 diff -C2 -d -r2.25 -r2.26 *** md5module.c 2001/11/02 21:41:00 2.25 --- md5module.c 2001/11/02 22:05:06 2.26 *************** *** 269,273 **** initmd5(void) { ! PyObject *m, *d, *i; MD5type.ob_type = &PyType_Type; --- 269,273 ---- initmd5(void) { ! PyObject *m, *d; MD5type.ob_type = &PyType_Type; *************** *** 275,280 **** d = PyModule_GetDict(m); PyDict_SetItemString(d, "MD5Type", (PyObject *)&MD5type); ! if ( (i = PyInt_FromLong(16)) != NULL) ! PyDict_SetItemString(d, "digest_size", i); /* No need to check the error here, the caller will do that */ } --- 275,279 ---- d = PyModule_GetDict(m); PyDict_SetItemString(d, "MD5Type", (PyObject *)&MD5type); ! PyModule_AddIntConstant(m, "digest_size", 16); /* No need to check the error here, the caller will do that */ } From bwarsaw@users.sourceforge.net Fri Nov 2 22:48:23 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 02 Nov 2001 14:48:23 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.144,1.145 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv32531 Modified Files: pep-0000.txt Log Message: Fixed a bunch of inconsistencies, reported by Neal Norwitz. Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.144 retrieving revision 1.145 diff -C2 -d -r1.144 -r1.145 *** pep-0000.txt 2001/10/31 15:52:30 1.144 --- pep-0000.txt 2001/11/02 22:48:21 1.145 *************** *** 54,63 **** 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 --- 54,63 ---- I 206 2.0 Batteries Included Zadka S 209 Adding Multidimensional Arrays Barrett, Oliphant ! SD 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 ! SD 218 Adding a Built-In Set Object Type Wilson SD 219 Stackless Python McMillan S 222 Web Library Enhancements Kuchling *************** *** 140,144 **** 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 --- 140,144 ---- I 0 Index of Python Enhancement Proposals Warsaw I 1 PEP Guidelines Warsaw, Hylton ! ID 2 Procedure for Adding New Modules Raymond I 3 Guidelines for Handling Bug Reports Hylton I 4 Deprecation of Standard Modules von Loewis *************** *** 174,182 **** 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 --- 174,182 ---- SD 218 Adding a Built-In Set Object Type Wilson SD 219 Stackless Python McMillan ! ID 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 ! SR 224 Attribute Docstrings Lemburg SD 225 Elementwise/Objectwise Operators Zhu, Lielens I 226 Python 2.1 Release Schedule Hylton *************** *** 184,188 **** S 228 Reworking Python's Numeric Model Zadka, van Rossum SF 229 Using Distutils to Build Python Kuchling ! S 230 Warning Framework van Rossum SR 231 __findattr__() Warsaw SF 232 Function Attributes Warsaw --- 184,188 ---- S 228 Reworking Python's Numeric Model Zadka, van Rossum SF 229 Using Distutils to Build Python Kuchling ! SF 230 Warning Framework van Rossum SR 231 __findattr__() Warsaw SF 232 Function Attributes Warsaw *************** *** 204,208 **** 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 --- 204,208 ---- I 248 Python Database API Specification v1.0 Lemburg I 249 Python Database API Specification v2.0 Lemburg ! 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 From jvr@users.sourceforge.net Fri Nov 2 22:51:46 2001 From: jvr@users.sourceforge.net (Just van Rossum) Date: Fri, 02 Nov 2001 14:51:46 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wcontrols.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv1074 Modified Files: Wcontrols.py Log Message: use 32bit APIs for control values, refactor slightly Index: Wcontrols.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wcontrols.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Wcontrols.py 2001/11/02 21:12:52 1.9 --- Wcontrols.py 2001/11/02 22:51:42 1.10 *************** *** 95,99 **** --- 95,112 ---- def gettitle(self): return self._title + + def set(self, value): + if self._control: + self._control.SetControl32BitValue(value) + else: + self._value = value + + def get(self): + if self._control: + return self._control.GetControl32BitValue() + else: + return self._value + class Button(ControlWidget): *************** *** 166,182 **** def toggle(self): self.set(not self.get()) ! ! def set(self, value): ! if self._control: ! self._control.SetControlValue(value) ! else: ! self._value = value ! ! def get(self): ! if self._control: ! return self._control.GetControlValue() ! else: ! return self._value ! class RadioButton(ControlWidget): --- 179,183 ---- def toggle(self): self.set(not self.get()) ! class RadioButton(ControlWidget): *************** *** 218,228 **** else: button._value = (button == self) ! ! def get(self): ! if self._control: ! return self._control.GetControlValue() ! else: ! return self._value ! class Scrollbar(ControlWidget): --- 219,223 ---- else: button._value = (button == self) ! class Scrollbar(ControlWidget): *************** *** 235,241 **** # interface ! def set(self, value): ! if self._callback: ! Wbase.CallbackCall(self._callback, 1, value) def up(self): --- 230,236 ---- # interface ! # def set(self, value): ! # if self._callback: ! # Wbase.CallbackCall(self._callback, 1, value) def up(self): *************** *** 256,269 **** def setmin(self, min): ! self._control.SetControlMinimum(min) ! def setmax(self, min): ! self._control.SetControlMinimum(max) def getmin(self): ! return self._control.GetControlMinimum() def getmax(self): ! return self._control.GetControlMinimum() # internals --- 251,267 ---- def setmin(self, min): ! self._control.SetControl32BitMinimum(min) ! def setmax(self, max): ! self._control.SetControl32BitMaximum(max) + def setviewsize(self, view): + self._control.SetControlViewSize(view) + def getmin(self): ! return self._control.GetControl32BitMinimum() def getmax(self): ! return self._control.GetControl32BitMaximum() # internals *************** *** 300,304 **** def _hit(self, part): if part == Controls.inThumb: ! value = self._control.GetControlValue() elif part == Controls.inUpButton: value = "+" --- 298,302 ---- def _hit(self, part): if part == Controls.inThumb: ! value = self._control.GetControl32BitValue() elif part == Controls.inUpButton: value = "+" *************** *** 330,346 **** Qd.FrameRect(self._bounds) self.GetWindow().ValidWindowRect(self._bounds) ! ! def set(self, value): ! if self._control: ! self._control.SetControlValue(value) ! else: ! self._value = value ! ! def get(self): ! if self._control: ! return self._control.GetControlValue() ! else: ! return self._value ! def _scalebarvalue(absmin, absmax, curmin, curmax): --- 328,332 ---- Qd.FrameRect(self._bounds) self.GetWindow().ValidWindowRect(self._bounds) ! def _scalebarvalue(absmin, absmax, curmin, curmax): From jvr@users.sourceforge.net Fri Nov 2 22:55:17 2001 From: jvr@users.sourceforge.net (Just van Rossum) Date: Fri, 02 Nov 2001 14:55:17 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PyEdit.py,1.24,1.25 ModuleBrowser.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv2275 Modified Files: PyEdit.py ModuleBrowser.py Log Message: macdinking Index: PyEdit.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyEdit.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** PyEdit.py 2001/11/02 19:24:41 1.24 --- PyEdit.py 2001/11/02 22:55:15 1.25 *************** *** 175,179 **** def setupwidgets(self, text): ! topbarheight = 24 popfieldwidth = 80 self.lastlineno = None --- 175,179 ---- def setupwidgets(self, text): ! topbarheight = 28 popfieldwidth = 80 self.lastlineno = None *************** *** 198,204 **** self.bevelbox = W.BevelBox((0, 0, 0, topbarheight)) self.hline = W.HorizontalLine((0, topbarheight, 0, 0)) ! self.infotext = W.TextBox((175, 6, -4, 14), backgroundcolor = (0xe000, 0xe000, 0xe000)) ! self.runbutton = W.Button((5, 4, 80, 16), runButtonLabels[0], self.run) ! self.runselbutton = W.Button((90, 4, 80, 16), runSelButtonLabels[0], self.runselection) # bind some keys --- 198,204 ---- self.bevelbox = W.BevelBox((0, 0, 0, topbarheight)) self.hline = W.HorizontalLine((0, topbarheight, 0, 0)) ! self.infotext = W.TextBox((175, 7, -4, 14), backgroundcolor = (0xe000, 0xe000, 0xe000)) ! self.runbutton = W.Button((6, 5, 60, 16), runButtonLabels[0], self.run) ! self.runselbutton = W.Button((78, 5, 90, 16), runSelButtonLabels[0], self.runselection) # bind some keys Index: ModuleBrowser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/ModuleBrowser.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ModuleBrowser.py 2001/08/25 12:07:29 1.5 --- ModuleBrowser.py 2001/11/02 22:55:15 1.6 *************** *** 11,21 **** self.editmodules = [] self.modules = [] ! self.window = W.Window((194, 1000), "Module Browser", minsize = (194, 160), maxsize = (340, 20000)) ! #self.window.bevelbox = W.BevelBox((0, 0, 0, 56)) ! self.window.openbutton = W.Button((10, 8, 80, 16), "Open", self.openbuttonhit) ! self.window.browsebutton = W.Button((100, 8, 80, 16), "Browse\xc9", self.browsebuttonhit) ! self.window.reloadbutton = W.Button((10, 32, 80, 16), "Reload", self.reloadbuttonhit) ! self.window.openotherbutton = W.Button((100, 32, 80, 16), "Open other\xc9", self.openother) self.window.openbutton.enable(0) --- 11,20 ---- self.editmodules = [] self.modules = [] ! self.window = W.Window((210, 1000), "Module Browser", minsize = (210, 160), maxsize = (340, 20000)) ! self.window.openbutton = W.Button((10, 8, 90, 16), "Open", self.openbuttonhit) ! self.window.browsebutton = W.Button((110, 8, 90, 16), "Browse\xc9", self.browsebuttonhit) ! self.window.reloadbutton = W.Button((10, 32, 90, 16), "Reload", self.reloadbuttonhit) ! self.window.openotherbutton = W.Button((110, 32, 90, 16), "Open other\xc9", self.openother) self.window.openbutton.enable(0) From loewis@users.sourceforge.net Fri Nov 2 23:34:54 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 02 Nov 2001 15:34:54 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_socket.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv12313/Lib/test Modified Files: test_socket.py Log Message: Correct getnameinfo refcounting and tuple parsing. Fixes #476648. Index: test_socket.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_socket.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** test_socket.py 2001/10/29 07:14:10 1.20 --- test_socket.py 2001/11/02 23:34:52 1.21 *************** *** 91,94 **** --- 91,108 ---- pass + try: + # On some versions, this loses a reference + import sys + orig = sys.getrefcount(__name__) + socket.getnameinfo(__name__,0) + except SystemError: + if sys.getrefcount(__name__) <> orig: + raise TestFailed,"socket.getnameinfo loses a reference" + + try: + # On some versions, this crashes the interpreter. + socket.getnameinfo(('x', 0, 0, 0), 0) + except socket.gaierror: + pass canfork = hasattr(os, 'fork') From loewis@users.sourceforge.net Fri Nov 2 23:34:54 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 02 Nov 2001 15:34:54 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.191,1.192 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv12313/Modules Modified Files: socketmodule.c Log Message: Correct getnameinfo refcounting and tuple parsing. Fixes #476648. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.191 retrieving revision 1.192 diff -C2 -d -r1.191 -r1.192 *** socketmodule.c 2001/10/30 01:26:49 1.191 --- socketmodule.c 2001/11/02 23:34:52 1.192 *************** *** 2538,2542 **** int flags; char *hostp; ! int n, port, flowinfo, scope_id; char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV]; struct addrinfo hints, *res = NULL; --- 2538,2542 ---- int flags; char *hostp; ! int port, flowinfo, scope_id; char hbuf[NI_MAXHOST], pbuf[NI_MAXSERV]; struct addrinfo hints, *res = NULL; *************** *** 2545,2553 **** flags = flowinfo = scope_id = 0; ! if (PyArg_ParseTuple(args, "Oi:getnameinfo", &sa, &flags) == 0) return NULL; ! n = PyArg_ParseTuple(sa, "si|ii", &hostp, &port, &flowinfo, scope_id); ! if (n == 0) ! goto fail; PyOS_snprintf(pbuf, sizeof(pbuf), "%d", port); memset(&hints, 0, sizeof(hints)); --- 2545,2552 ---- flags = flowinfo = scope_id = 0; ! if (!PyArg_ParseTuple(args, "Oi:getnameinfo", &sa, &flags)) return NULL; ! if (!PyArg_ParseTuple(sa, "si|ii", &hostp, &port, &flowinfo, &scope_id)) ! return NULL; PyOS_snprintf(pbuf, sizeof(pbuf), "%d", port); memset(&hints, 0, sizeof(hints)); *************** *** 2598,2602 **** if (res) freeaddrinfo(res); - Py_XDECREF(sa); return ret; } --- 2597,2600 ---- From loewis@users.sourceforge.net Fri Nov 2 23:48:22 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 02 Nov 2001 15:48:22 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/lib-tk Tix.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/lib-tk In directory usw-pr-cvs1:/tmp/cvs-serv15298/Lib/lib-tk Modified Files: Tix.py Log Message: Patch #471120: Improved doc strings and new wrappers. Index: Tix.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/Tix.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Tix.py 2001/10/09 11:50:55 1.4 --- Tix.py 2001/11/02 23:48:20 1.5 *************** *** 1,10 **** # # $Id$ # ! # Tix.py -- Tix widget wrappers, part of PyTix. # # - Sudhir Shenoy (sshenoy@gol.com), Dec. 1995. ! # based on an idea (and a little code !!) of Jean-Marc Lugrin ! # (lugrin@ms.com) # # NOTE: In order to minimize changes to Tkinter.py, some of the code here --- 1,12 ---- + # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*- # # $Id$ # ! # Tix.py -- Tix widget wrappers. # + # For Tix, see http://tix.sourceforge.net + # # - Sudhir Shenoy (sshenoy@gol.com), Dec. 1995. ! # based on an idea of Jean-Marc Lugrin (lugrin@ms.com) # # NOTE: In order to minimize changes to Tkinter.py, some of the code here *************** *** 52,69 **** # liable to break. import Tkinter, os ! class Tk(Tkinter.Tk): """Toplevel widget of Tix which represents mostly the main window of an application. It has an associated Tcl interpreter.""" ! def __init__(self, screenName=None, baseName=None, className='Tk'): Tkinter.Tk.__init__(self, screenName, baseName, className) tixlib = os.environ.get('TIX_LIBRARY') if tixlib is not None: self.tk.eval('global auto_path; lappend auto_path {%s}' % tixlib) self.tk.eval('global tcl_pkgPath; lappend tcl_pkgPath {%s}' % tixlib) # Load Tix - this should work dynamically or statically ! # If it's static, lib/tix8.1/pkgIndex.tcl should have 'load {} Tix' ! # If it's dynamic, it should have 'load libtix8.1.8.2.so Tix' self.tk.eval('package require Tix') # The Tix 'tixForm' geometry manager class Form: --- 54,212 ---- # liable to break. import Tkinter, os ! ! # Could probably add this to Tkinter.Misc ! class tixCommand: ! """The tix command provides access to miscellaneous elements ! of Tix's internal state and the Tix application context. ! Most of the information manipulated by this command per ! tains to the application as a whole, or to a screen or ! display, rather than to a particular window. The command ! can take any of a number of different forms depending on ! the option argument. ! ! This is a mixin class, assumed to be mixed to Tkinter.Tk ! that supports the self.tk.call method. ! """ ! def tix_addbitmapdir(self, directory): ! """Tix maintains a list of directory under which which ! the tix_getimage and tix_getbitmap commands will ! search for image files. The standard bitmap direc ! tory is $TIX_LIBRARY/bitmaps. The addbitmapdir com ! mand adds directory into this list. By using this ! command, the image files of an applications can ! also be located using the tix_getimage or tix_getbitmap ! command. ! """ ! return self.tk.call('tix', 'addbitmapdir', directory) ! ! def tix_cget(self, option): ! """Returns the current value of the configuration ! option given by option. Option may be any of the ! options described in the CONFIGURATION OPTIONS section. ! """ ! return self.tk.call('tix', 'cget', option) ! ! def tix_configure(self, cnf=None, **kw): ! """Query or modify the configuration options of the ! Tix application context. If no option is specified, ! returns a list describing all of the available ! options (see Tk_ConfigureInfo for information on ! the format of this list). If option is specified ! with no value, then the command returns a list ! describing the one named option (this list will be ! identical to the corresponding sublist of the value ! returned if no option is specified). If one or ! more option-value pairs are specified, then the ! command modifies the given option(s) to have the ! given value(s); in this case the command returns an ! empty string. Option may be any of the options ! described in the CONFIGURATION OPTIONS section. ! """ ! return apply(self.tk.call, ('tix', configure) + ! self._options(cnf,kw) ) ! ! def tix_filedialog(self, dlgclass=None): ! """Returns the file selection dialog that may be ! shared among different modules of this application. ! This command will create a file selection dialog ! widget when it is called the first time. This dialog ! will be returned by all subsequent calls to tix ! filedialog. An optional dlgclass parameter can be ! passed to specified what type of file selection ! dialog widget is desired. Possible options are 'tix' ! 'FileSelectDialog' or 'tixExFileSelectDialog'. ! """ ! if dlgclass is not None: ! return self.tk.call('tix', 'filedialog', dlgclass) ! else: ! return self.tk.call('tix', 'filedialog') ! ! def tix_getbitmap(self, name): ! """Locates a bitmap file of the name name.xpm or name ! in one of the bitmap directories (self, see the ! tix_addbitmapdir command above). By using tix_getbitmap, ! you can advoid hard coding the pathnames of ! the bitmap files in your application. When successful, ! it returns the complete pathname of the bitmap ! file, prefixed with the character '@'. The returned ! value can be used to configure the -bitmap option ! of the TK and Tix widgets. ! """ ! return self.tk.call('tix', 'getbitmap', name) ! ! def tix_getimage(self, name): ! """Locates an image file of the name name.xpm, ! name.xbm or name.ppm in one of the bitmap directo ! ries (see the addbitmapdir command above). If more ! than one file with the same name (but different ! extensions) exist, then the image type is chosen ! according to the depth of the X display: xbm images ! are chosen on monochrome displays and color images ! are chosen on color displays. By using tix getim ! age, you can advoid hard coding the pathnames of ! the image files in your application. When success ! ful, this command returns the name of the newly ! created image, which can be used to configure the ! -image option of the TK and Tix widgets. ! """ ! return self.tk.call('tix', 'getimage', name) ! ! def tix_option_get(self, name): ! """Gets the options manitained by the Tix ! scheme mechanism. Available options are: ! ! active_bg active_fg bg ! bold_font dark1_bg dark1_fg ! dark2_bg dark2_fg disabled_fg ! fg fixed_font font ! inactive_bg inactive_fg input1_bg ! input2_bg italic_font light1_bg ! light1_fg light2_bg light2_fg ! menu_font output1_bg output2_bg ! select_bg select_fg selector ! """ ! # could use self.tk.globalgetvar('tixOption', name) ! return self.tk.call('tix', 'option', 'get', name) ! ! def tix_resetoptions(self, newScheme, newFontSet, newScmPrio=None): ! """Resets the scheme and fontset of the Tix application ! to newScheme and newFontSet, respectively. ! This affects only those widgets created after this ! call. Therefore, it is best to call the resetop ! tions command before the creation of any widgets in ! a Tix application. ! ! The optional parameter newScmPrio can be given to ! reset the priority level of the TK options set by ! the Tix schemes. ! ! Because of the way TK handles the X option database, after ! tixwish has started up, it is not possible to reset the ! color schemes and font sets using the tix config command. ! Instead, the tix resetoptions command must be used. ! """ ! if newScmPrio is not None: ! return self.tk.call('tix', 'resetoptions', newScheme, newFontSet, newScmPrio) ! else: ! return self.tk.call('tix', 'resetoptions', newScheme, newFontSet) ! ! class Tk(Tkinter.Tk, tixCommand): """Toplevel widget of Tix which represents mostly the main window of an application. It has an associated Tcl interpreter.""" ! def __init__(self, screenName=None, baseName=None, className='Tix'): Tkinter.Tk.__init__(self, screenName, baseName, className) tixlib = os.environ.get('TIX_LIBRARY') + self.tk.eval('global auto_path; lappend auto_path [file dir [info nameof]]') if tixlib is not None: self.tk.eval('global auto_path; lappend auto_path {%s}' % tixlib) self.tk.eval('global tcl_pkgPath; lappend tcl_pkgPath {%s}' % tixlib) # Load Tix - this should work dynamically or statically ! # If it's static, lib/tix8.1/pkgIndex.tcl should have ! # 'load {} Tix' ! # If it's dynamic, lib/tix8.1/pkgIndex.tcl should have ! # 'load libtix8.1.8.3.so Tix' self.tk.eval('package require Tix') + # The Tix 'tixForm' geometry manager class Form: *************** *** 109,121 **** self.tk.call( 'tixForm', 'slaves', self._w))) Tkinter.Widget.__bases__ = Tkinter.Widget.__bases__ + (Form,) ! class TixWidget(Widget): """A TixWidget class is used to package all (or most) Tix widgets. Widget initialization is extended in two ways: ! 1) It is possible to give a list of options which must be part of the creation command (so called Tix 'static' options). These cannot be given as a 'config' command later. --- 252,266 ---- self.tk.call( 'tixForm', 'slaves', self._w))) + + Tkinter.Widget.__bases__ = Tkinter.Widget.__bases__ + (Form,) ! class TixWidget(Tkinter.Widget): """A TixWidget class is used to package all (or most) Tix widgets. Widget initialization is extended in two ways: ! 1) It is possible to give a list of options which must be part of the creation command (so called Tix 'static' options). These cannot be given as a 'config' command later. *************** *** 170,180 **** raise AttributeError, name - # Set a variable without calling its action routine def set_silent(self, value): self.tk.call('tixSetSilent', self._w, value) - # Return the named subwidget (which must have been created by - # the sub-class). def subwidget(self, name): n = self._subwidget_name(name) if not n: --- 315,325 ---- raise AttributeError, name def set_silent(self, value): + """Set a variable without calling its action routine""" self.tk.call('tixSetSilent', self._w, value) def subwidget(self, name): + """Return the named subwidget (which must have been created by + the sub-class).""" n = self._subwidget_name(name) if not n: *************** *** 184,189 **** return self._nametowidget(n) - # Return all subwidgets def subwidgets_all(self): names = self._subwidget_names() if not names: --- 329,334 ---- return self._nametowidget(n) def subwidgets_all(self): + """Return all subwidgets.""" names = self._subwidget_names() if not names: *************** *** 199,204 **** return retlist - # Get a subwidget name (returns a String, not a Widget !) def _subwidget_name(self,name): try: return self.tk.call(self._w, 'subwidget', name) --- 344,349 ---- return retlist def _subwidget_name(self,name): + """Get a subwidget name (returns a String, not a Widget !)""" try: return self.tk.call(self._w, 'subwidget', name) *************** *** 206,211 **** return None - # Return the name of all subwidgets def _subwidget_names(self): try: x = self.tk.call(self._w, 'subwidgets', '-all') --- 351,356 ---- return None def _subwidget_names(self): + """Return the name of all subwidgets.""" try: x = self.tk.call(self._w, 'subwidgets', '-all') *************** *** 214,219 **** return None - # Set configuration options for all subwidgets (and self) def config_all(self, option, value): if option == '': return --- 359,364 ---- return None def config_all(self, option, value): + """Set configuration options for all subwidgets (and self).""" if option == '': return *************** *** 361,365 **** class ButtonBox(TixWidget): ! """ButtonBox - A container for pushbuttons""" def __init__(self, master=None, cnf={}, **kw): TixWidget.__init__(self, master, 'tixButtonBox', --- 506,512 ---- class ButtonBox(TixWidget): ! """ButtonBox - A container for pushbuttons. ! Subwidgets are the buttons added with the add method. ! """ def __init__(self, master=None, cnf={}, **kw): TixWidget.__init__(self, master, 'tixButtonBox', *************** *** 379,383 **** class ComboBox(TixWidget): ! """ComboBox - an Entry field with a dropdown menu Subwidget Class --- 526,532 ---- class ComboBox(TixWidget): ! """ComboBox - an Entry field with a dropdown menu. The user can select a ! choice by either typing in the entry subwdget or selecting from the ! listbox subwidget. Subwidget Class *************** *** 385,391 **** entry Entry arrow Button ! slistbox ScrolledListBox ! tick Button } ! cross Button } present if created with the fancy option""" def __init__ (self, master=None, cnf={}, **kw): --- 534,540 ---- entry Entry arrow Button ! slistbox ScrolledListBox ! tick Button ! cross Button : present if created with the fancy option""" def __init__ (self, master=None, cnf={}, **kw): *************** *** 418,422 **** class Control(TixWidget): ! """Control - An entry field with value change arrows. Subwidget Class --- 567,574 ---- class Control(TixWidget): ! """Control - An entry field with value change arrows. The user can ! adjust the value by pressing the two arrow buttons or by entering ! the value directly into the entry. The new value will be checked ! against the user-defined upper and lower limits. Subwidget Class *************** *** 447,451 **** class DirList(TixWidget): ! """DirList - Directory Listing. Subwidget Class --- 599,605 ---- class DirList(TixWidget): ! """DirList - displays a list view of a directory, its previous ! directories and its sub-directories. The user can choose one of ! the directories displayed in the list or change to another directory. Subwidget Class *************** *** 465,469 **** class DirTree(TixWidget): ! """DirList - Directory Listing in a hierarchical view. Subwidget Class --- 619,626 ---- class DirTree(TixWidget): ! """DirTree - Directory Listing in a hierarchical view. ! Displays a tree view of a directory, its previous directories and its ! sub-directories. The user can choose one of the directories displayed ! in the list or change to another directory. Subwidget Class *************** *** 482,487 **** --- 639,664 ---- self.tk.call(self._w, 'chdir', dir) + class DirSelectBox(TixWidget): + """DirSelectBox - Motif style file select box. + It is generally used for + the user to choose a file. FileSelectBox stores the files mostly + recently selected into a ComboBox widget so that they can be quickly + selected again. + + Subwidget Class + --------- ----- + selection ComboBox + filter ComboBox + dirlist ScrolledListBox + filelist ScrolledListBox""" + + def __init__(self, master, cnf={}, **kw): + TixWidget.__init__(self, master, 'tixDirSelectBox', ['options'], cnf, kw) + self.subwidget_list['dirlist'] = _dummyDirList(self, 'dirlist') + self.subwidget_list['dircbx'] = _dummyFileComboBox(self, 'dircbx') + class ExFileSelectBox(TixWidget): """ExFileSelectBox - MS Windows style file select box. + It provides an convenient method for the user to select files. Subwidget Class *************** *** 513,518 **** --- 690,721 ---- self.tk.call(self._w, 'invoke') + + # Should inherit from a Dialog class + class DirSelectDialog(TixWidget): + """The DirSelectDialog widget presents the directories in the file + system in a dialog window. The user can use this dialog window to + navigate through the file system to select the desired directory. + + Subwidgets Class + ---------- ----- + dirbox DirSelectDialog""" + + def __init__(self, master, cnf={}, **kw): + TixWidget.__init__(self, master, 'tixDirSelectDialog', + ['options'], cnf, kw) + self.subwidget_list['dirbox'] = _dummyDirSelectBox(self, 'dirbox') + # cancel and ok buttons are missing + + def popup(self): + self.tk.call(self._w, 'popup') + + def popdown(self): + self.tk.call(self._w, 'popdown') + + + # Should inherit from a Dialog class class ExFileSelectDialog(TixWidget): """ExFileSelectDialog - MS Windows style file select dialog. + It provides an convenient method for the user to select files. Subwidgets Class *************** *** 533,537 **** class FileSelectBox(TixWidget): """ExFileSelectBox - Motif style file select box. ! Subwidget Class --------- ----- --- 736,744 ---- class FileSelectBox(TixWidget): """ExFileSelectBox - Motif style file select box. ! It is generally used for ! the user to choose a file. FileSelectBox stores the files mostly ! recently selected into a ComboBox widget so that they can be quickly ! selected again. ! Subwidget Class --------- ----- *************** *** 554,557 **** --- 761,765 ---- self.tk.call(self._w, 'invoke') + # Should inherit from a Dialog class class FileSelectDialog(TixWidget): """FileSelectDialog - Motif style file select dialog. *************** *** 575,579 **** class FileEntry(TixWidget): ! """FileEntry - Entry field with button that invokes a FileSelectDialog Subwidgets Class --- 783,790 ---- class FileEntry(TixWidget): ! """FileEntry - Entry field with button that invokes a FileSelectDialog. ! The user can type in the filename manually. Alternatively, the user can ! press the button widget that sits next to the entry, which will bring ! up a file selection dialog. Subwidgets Class *************** *** 596,600 **** class HList(TixWidget): ! """HList - Hierarchy display. Subwidgets - None""" --- 807,814 ---- class HList(TixWidget): ! """HList - Hierarchy display widget can be used to display any data ! that have a hierarchical structure, for example, file system directory ! trees. The list entries are indented and connected by branch lines ! according to their places in the hierachy. Subwidgets - None""" *************** *** 786,790 **** class LabelEntry(TixWidget): ! """LabelEntry - Entry field with label. Subwidgets Class --- 1000,1006 ---- class LabelEntry(TixWidget): ! """LabelEntry - Entry field with label. Packages an entry widget ! and a label into one mega widget. It can beused be used to simplify ! the creation of ``entry-form'' type of interface. Subwidgets Class *************** *** 800,804 **** class LabelFrame(TixWidget): ! """LabelFrame - Labelled Frame container. Subwidgets Class --- 1016,1023 ---- class LabelFrame(TixWidget): ! """LabelFrame - Labelled Frame container. Packages a frame widget ! and a label into one mega widget. To create widgets inside a ! LabelFrame widget, one creates the new widgets relative to the ! frame subwidget and manage them inside the frame subwidget. Subwidgets Class *************** *** 813,816 **** --- 1032,1068 ---- self.subwidget_list['frame'] = _dummyFrame(self, 'frame') + + class ListNoteBook(TixWidget): + """A ListNoteBook widget is very similar to the TixNoteBook widget: + it can be used to display many windows in a limited space using a + notebook metaphor. The notebook is divided into a stack of pages + (windows). At one time only one of these pages can be shown. + The user can navigate through these pages by + choosing the name of the desired page in the hlist subwidget.""" + + def __init__(self, master, cnf={}, **kw): + TixWidget.__init__(self, master, 'tixDirList', ['options'], cnf, kw) + self.subwidget_list['hlist'] = _dummyHList(self, 'hlist') + self.subwidget_list['shlist'] = _dummyScrolledHList(self, 'vsb') + + + def add(self, name, cnf={}, **kw): + apply(self.tk.call, + (self._w, 'add', name) + self._options(cnf, kw)) + self.subwidget_list[name] = TixSubWidget(self, name) + return self.subwidget_list[name] + + def raise_page(self, name): # raise is a python keyword + self.tk.call(self._w, 'raise', name) + + class Meter(TixWidget): + """The Meter widget can be used to show the progress of a background + job which may take a long time to execute. + """ + + def __init__(self, master=None, cnf={}, **kw): + TixWidget.__init__(self, master, 'tixMeter', + ['options'], cnf, kw) + class NoteBook(TixWidget): """NoteBook - Multi-page container widget (tabbed notebook metaphor). *************** *** 819,823 **** ---------- ----- nbframe NoteBookFrame ! g/p widgets added dynamically""" def __init__ (self,master=None,cnf={}, **kw): --- 1071,1075 ---- ---------- ----- nbframe NoteBookFrame ! page widgets added dynamically with the add method""" def __init__ (self,master=None,cnf={}, **kw): *************** *** 857,861 **** class OptionMenu(TixWidget): ! """OptionMenu - Option menu widget. Subwidget Class --- 1109,1113 ---- class OptionMenu(TixWidget): ! """OptionMenu - creates a menu button of options. Subwidget Class *************** *** 887,895 **** class PanedWindow(TixWidget): ! """PanedWindow - Multi-pane container widget. Panes are resizable. Subwidgets Class ---------- ----- ! g/p widgets added dynamically""" def __init__(self, master, cnf={}, **kw): --- 1139,1151 ---- class PanedWindow(TixWidget): ! """PanedWindow - Multi-pane container widget ! allows the user to interactively manipulate the sizes of several ! panes. The panes can be arranged either vertically or horizontally.The ! user changes the sizes of the panes by dragging the resize handle ! between two panes. Subwidgets Class ---------- ----- ! g/p widgets added dynamically with the add method.""" def __init__(self, master, cnf={}, **kw): *************** *** 911,915 **** class PopupMenu(TixWidget): ! """PopupMenu widget. Subwidgets Class --- 1167,1174 ---- class PopupMenu(TixWidget): ! """PopupMenu widget can be used as a replacement of the tk_popup command. ! The advantage of the Tix PopupMenu widget is it requires less application ! code to manipulate. ! Subwidgets Class *************** *** 933,937 **** class ResizeHandle(TixWidget): ! """Incomplete - no documentation in Tix for this !!!""" def __init__(self, master, cnf={}, **kw): --- 1192,1196 ---- class ResizeHandle(TixWidget): ! """Internal widget to draw resize handles on Scrolled widgets.""" def __init__(self, master, cnf={}, **kw): *************** *** 943,947 **** class ScrolledHList(TixWidget): ! """ScrolledHList - HList with scrollbars.""" def __init__(self, master, cnf={}, **kw): --- 1202,1206 ---- class ScrolledHList(TixWidget): ! """ScrolledHList - HList with automatic scrollbars.""" def __init__(self, master, cnf={}, **kw): *************** *** 953,957 **** class ScrolledListBox(TixWidget): ! """ScrolledListBox - Listbox with scrollbars.""" def __init__(self, master, cnf={}, **kw): --- 1212,1216 ---- class ScrolledListBox(TixWidget): ! """ScrolledListBox - Listbox with automatic scrollbars.""" def __init__(self, master, cnf={}, **kw): *************** *** 962,966 **** class ScrolledText(TixWidget): ! """ScrolledText - Text with scrollbars.""" def __init__(self, master, cnf={}, **kw): --- 1221,1225 ---- class ScrolledText(TixWidget): ! """ScrolledText - Text with automatic scrollbars.""" def __init__(self, master, cnf={}, **kw): *************** *** 971,975 **** class ScrolledTList(TixWidget): ! """ScrolledTList - TList with scrollbars.""" def __init__(self, master, cnf={}, **kw): --- 1230,1234 ---- class ScrolledTList(TixWidget): ! """ScrolledTList - TList with automatic scrollbars.""" def __init__(self, master, cnf={}, **kw): *************** *** 981,985 **** class ScrolledWindow(TixWidget): ! """ScrolledWindow - Window with scrollbars.""" def __init__(self, master, cnf={}, **kw): --- 1240,1244 ---- class ScrolledWindow(TixWidget): ! """ScrolledWindow - Window with automatic scrollbars.""" def __init__(self, master, cnf={}, **kw): *************** *** 990,996 **** class Select(TixWidget): ! """Select - Container for buttons. Can enforce radio buttons etc. ! Subwidgets are buttons added dynamically""" def __init__(self, master, cnf={}, **kw): --- 1249,1256 ---- class Select(TixWidget): ! """Select - Container of button subwidgets. It can be used to provide ! radio-box or check-box style of selection options for the user. ! Subwidgets are buttons added dynamically using the add method.""" def __init__(self, master, cnf={}, **kw): *************** *** 1026,1030 **** class TList(TixWidget): ! """TList - Hierarchy display. Subwidgets - None""" --- 1286,1295 ---- class TList(TixWidget): ! """TList - Hierarchy display widget which can be ! used to display data in a tabular format. The list entries of a TList ! widget are similar to the entries in the Tk listbox widget. The main ! differences are (1) the TList widget can display the list entries in a ! two dimensional format and (2) you can use graphical images as well as ! multiple colors and fonts for the list entries. Subwidgets - None""" *************** *** 1112,1116 **** class Tree(TixWidget): ! """Tree - The tixTree widget (general purpose DirList like widget)""" def __init__(self, master=None, cnf={}, **kw): --- 1377,1383 ---- class Tree(TixWidget): ! """Tree - The tixTree widget can be used to display hierachical ! data in a tree form. The user can adjust ! the view of the tree by opening or closing parts of the tree.""" def __init__(self, master=None, cnf={}, **kw): *************** *** 1136,1139 **** --- 1403,1445 ---- self.tk.call(self._w, 'setmode', entrypath, mode) + + # Could try subclassing Tree for CheckList - would need another arg to init + class CheckList(TixWidget): + """The CheckList widget + displays a list of items to be selected by the user. CheckList acts + similarly to the Tk checkbutton or radiobutton widgets, except it is + capable of handling many more items than checkbuttons or radiobuttons. + """ + + def __init__(self, master=None, cnf={}, **kw): + TixWidget.__init__(self, master, 'tixCheckList', + ['options'], cnf, kw) + self.subwidget_list['hlist'] = _dummyHList(self, 'hlist') + self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb') + self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb') + + def autosetmode(self): + self.tk.call(self._w, 'autosetmode') + + def close(self, entrypath): + self.tk.call(self._w, 'close', entrypath) + + def getmode(self, entrypath): + return self.tk.call(self._w, 'getmode', entrypath) + + def open(self, entrypath): + self.tk.call(self._w, 'open', entrypath) + + def getselection(self, mode='on'): + '''Mode can be on, off, default''' + self.tk.call(self._w, 'getselection', mode) + + def getstatus(self, entrypath): + self.tk.call(self._w, 'getstatus', entrypath) + + def setstatus(self, entrypath, mode='on'): + self.tk.call(self._w, 'setstatus', entrypath, mode) + + ########################################################################### ### The subclassing below is used to instantiate the subwidgets in each ### *************** *** 1192,1195 **** --- 1498,1508 ---- TixSubWidget.__init__(self, master, name, destroy_physically) + class _dummyScrolledHList(ScrolledHList, TixSubWidget): + def __init__(self, master, name, destroy_physically=1): + TixSubWidget.__init__(self, master, name, destroy_physically) + self.subwidget_list['hlist'] = _dummyHList(self, 'hlist') + self.subwidget_list['vsb'] = _dummyScrollbar(self, 'vsb') + self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb') + class _dummyTList(TList, TixSubWidget): def __init__(self, master, name, destroy_physically=1): *************** *** 1201,1206 **** self.subwidget_list['entry'] = _dummyEntry(self, 'entry') self.subwidget_list['arrow'] = _dummyButton(self, 'arrow') self.subwidget_list['slistbox'] = _dummyScrolledListBox(self, ! 'slistbox') self.subwidget_list['listbox'] = _dummyListbox(self, 'listbox', destroy_physically=0) --- 1514,1522 ---- self.subwidget_list['entry'] = _dummyEntry(self, 'entry') self.subwidget_list['arrow'] = _dummyButton(self, 'arrow') + # I'm not sure about this destroy_physically=0 in all cases; + # it may depend on if -dropdown is true; I've added as a trial self.subwidget_list['slistbox'] = _dummyScrolledListBox(self, ! 'slistbox', ! destroy_physically=0) self.subwidget_list['listbox'] = _dummyListbox(self, 'listbox', destroy_physically=0) *************** *** 1213,1216 **** --- 1529,1538 ---- self.subwidget_list['hsb'] = _dummyScrollbar(self, 'hsb') + class _dummyDirSelectBox(DirSelectBox, TixSubWidget): + def __init__(self, master, name, destroy_physically=1): + TixSubWidget.__init__(self, master, name, destroy_physically) + self.subwidget_list['dirlist'] = _dummyDirList(self, 'dirlist') + self.subwidget_list['dircbx'] = _dummyFileComboBox(self, 'dircbx') + class _dummyExFileSelectBox(ExFileSelectBox, TixSubWidget): def __init__(self, master, name, destroy_physically=1): *************** *** 1233,1236 **** --- 1555,1563 ---- self.subwidget_list['selection'] = _dummyComboBox(self, 'selection') + class _dummyFileComboBox(ComboBox, TixSubWidget): + def __init__(self, master, name, destroy_physically=1): + TixSubWidget.__init__(self, master, name, destroy_physically) + self.subwidget_list['dircbx'] = _dummyComboBox(self, 'dircbx') + class _dummyStdButtonBox(StdButtonBox, TixSubWidget): def __init__(self, master, name, destroy_physically=1): *************** *** 1264,1266 **** --- 1591,1603 ---- s = s + '{{' + type + '} {' + type + ' - ' + dict[type] + '}} ' return s + + # Still to be done: + class CObjView(TixWidget): + """This file implements the Canvas Object View widget. This is a base + class of IconView. It implements automatic placement/adjustment of the + scrollbars according to the canvas objects inside the canvas subwidget. + The scrollbars are adjusted so that the canvas is just large enough + to see all the objects. + """ + pass From loewis@users.sourceforge.net Fri Nov 2 23:48:22 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 02 Nov 2001 15:48:22 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.305,1.306 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv15298/Misc Modified Files: NEWS Log Message: Patch #471120: Improved doc strings and new wrappers. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.305 retrieving revision 1.306 diff -C2 -d -r1.305 -r1.306 *** NEWS 2001/10/30 03:03:03 1.305 --- NEWS 2001/11/02 23:48:20 1.306 *************** *** 47,50 **** --- 47,55 ---- Library + - Tix exposes more commands through the classes DirSelectBox, + DirSelectDialog, ListNoteBook, Meter, CheckList, and the + methods tix_addbitmapdir, tix_cget, tix_configure, tix_filedialog, + tix_getbitmap, tix_getimage, tix_option_get, and tix_resetoptions. + - Traceback objects are now scanned by cyclic garbage collection, so cycles created by casual use of sys.exc_info() no longer cause From loewis@users.sourceforge.net Fri Nov 2 23:59:13 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 02 Nov 2001 15:59:13 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.206,2.207 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv17097 Modified Files: posixmodule.c Log Message: Patch #474169: Move fdopen calls out of critical section. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.206 retrieving revision 2.207 diff -C2 -d -r2.206 -r2.207 *** posixmodule.c 2001/10/19 01:31:59 2.206 --- posixmodule.c 2001/11/02 23:59:11 2.207 *************** *** 2275,2280 **** DosClose(whan); /* Close Now-Unused Pipe Write Handle */ ! if (async_system(command) == NO_ERROR) ! retfd = fdopen(rhan, mode); /* And Return Pipe Read Handle */ } --- 2275,2279 ---- DosClose(whan); /* Close Now-Unused Pipe Write Handle */ ! rc = async_system(command); } *************** *** 2282,2285 **** --- 2281,2287 ---- DosExitCritSec(); /* Now Allow Other Threads to Run */ + if (rc == NO_ERROR) + retfd = fdopen(rhan, mode); /* And Return Pipe Read Handle */ + close(oldfd); /* And Close Saved STDOUT Handle */ return retfd; /* Return fd of Pipe or NULL if Error */ *************** *** 2294,2303 **** DosClose(rhan); /* Close Now-Unused Pipe Read Handle */ ! if (async_system(command) == NO_ERROR) ! retfd = fdopen(whan, mode); /* And Return Pipe Write Handle */ } dup2(oldfd, 0); /* Reconnect STDIN to Original Handle */ DosExitCritSec(); /* Now Allow Other Threads to Run */ close(oldfd); /* And Close Saved STDIN Handle */ --- 2296,2307 ---- DosClose(rhan); /* Close Now-Unused Pipe Read Handle */ ! rc = async_system(command); } dup2(oldfd, 0); /* Reconnect STDIN to Original Handle */ DosExitCritSec(); /* Now Allow Other Threads to Run */ + + if (rc == NO_ERROR) + retfd = fdopen(whan, mode); /* And Return Pipe Write Handle */ close(oldfd); /* And Close Saved STDIN Handle */ From loewis@users.sourceforge.net Sat Nov 3 10:48:45 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 03 Nov 2001 02:48:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules almodule.c,1.32,1.33 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv21653 Modified Files: almodule.c Log Message: Correct argument parsing for alp_getstatus, which is METH_VARARGS. Index: almodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/almodule.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** almodule.c 2000/09/01 23:29:26 1.32 --- almodule.c 2001/11/03 10:48:43 1.33 *************** *** 1204,1208 **** int i; ! if (!PyArg_Parse(args, "O!", &PyList_Type, &list)) return NULL; length = PyList_Size(list); --- 1204,1208 ---- int i; ! if (!PyArg_ParseTuple(args, "O!", &PyList_Type, &list)) return NULL; length = PyList_Size(list); From tim_one@users.sourceforge.net Sat Nov 3 19:35:45 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 03 Nov 2001 11:35:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib sre_parse.py,1.49,1.50 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv27485/python/Lib Modified Files: sre_parse.py Log Message: Improved error msg when a symbolic group name is redefined. Added docs and NEWS. Bugfix candidate? That's a dilemma for Anthony : /F did fix a longstanding bug here, but the fix can cause code to raise an exception that previously worked by accident. Index: sre_parse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/sre_parse.py,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** sre_parse.py 2001/11/02 13:59:51 1.49 --- sre_parse.py 2001/11/03 19:35:42 1.50 *************** *** 82,87 **** self.groups = gid + 1 if name: ! if self.groupdict.has_key(name): ! raise error, "can only use each group name once" self.groupdict[name] = gid self.open.append(gid) --- 82,89 ---- self.groups = gid + 1 if name: ! ogid = self.groupdict.get(name, None) ! if ogid is not None: ! raise error, ("redefinition of group name %s as group %d; " + ! "was group %d") % (`name`, gid, ogid) self.groupdict[name] = gid self.open.append(gid) From tim_one@users.sourceforge.net Sat Nov 3 19:35:45 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 03 Nov 2001 11:35:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.306,1.307 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv27485/python/Misc Modified Files: NEWS Log Message: Improved error msg when a symbolic group name is redefined. Added docs and NEWS. Bugfix candidate? That's a dilemma for Anthony : /F did fix a longstanding bug here, but the fix can cause code to raise an exception that previously worked by accident. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.306 retrieving revision 1.307 diff -C2 -d -r1.306 -r1.307 *** NEWS 2001/11/02 23:48:20 1.306 --- NEWS 2001/11/03 19:35:43 1.307 *************** *** 47,50 **** --- 47,56 ---- Library + - Symbolic group names in regular expressions must be unique. For + example, the regexp r'(?P)(?P)' is not allowed, because a + single name can't mean both "group 1" and "group 2" simultaneously. + Python 2.2 detects this error at regexp compilation time; previously, + the error went undetected, and results were unpredictable. + - Tix exposes more commands through the classes DirSelectBox, DirSelectDialog, ListNoteBook, Meter, CheckList, and the From tim_one@users.sourceforge.net Sat Nov 3 19:35:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 03 Nov 2001 11:35:44 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libre.tex,1.69,1.70 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv27485/python/Doc/lib Modified Files: libre.tex Log Message: Improved error msg when a symbolic group name is redefined. Added docs and NEWS. Bugfix candidate? That's a dilemma for Anthony : /F did fix a longstanding bug here, but the fix can cause code to raise an exception that previously worked by accident. Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** libre.tex 2001/10/20 04:24:09 1.69 --- libre.tex 2001/11/03 19:35:42 1.70 *************** *** 25,29 **** \code{'\e\e\e\e'} as the pattern string, because the regular expression must be \samp{\e\e}, and each backslash must be expressed as ! \samp{\e\e} inside a regular Python string literal. The solution is to use Python's raw string notation for regular --- 25,29 ---- \code{'\e\e\e\e'} as the pattern string, because the regular expression must be \samp{\e\e}, and each backslash must be expressed as ! \samp{\e\e} inside a regular Python string literal. The solution is to use Python's raw string notation for regular *************** *** 179,184 **** (defined below) are also acceptable inside a range. If you want to include a \character{]} or a \character{-} inside a set, precede it with a ! backslash, or place it as the first character. The ! pattern \regexp{[]]} will match \code{']'}, for example. You can match the characters not within a range by \dfn{complementing} --- 179,184 ---- (defined below) are also acceptable inside a range. If you want to include a \character{]} or a \character{-} inside a set, precede it with a ! backslash, or place it as the first character. The ! pattern \regexp{[]]} will match \code{']'}, for example. You can match the characters not within a range by \dfn{complementing} *************** *** 210,214 **** \item[\code{(?...)}] This is an extension notation (a \character{?} following a \character{(} is not meaningful otherwise). The first ! character after the \character{?} determines what the meaning and further syntax of the construct is. Extensions usually do not create a new group; --- 210,214 ---- \item[\code{(?...)}] This is an extension notation (a \character{?} following a \character{(} is not meaningful otherwise). The first ! character after the \character{?} determines what the meaning and further syntax of the construct is. Extensions usually do not create a new group; *************** *** 232,242 **** \item[\code{(?:...)}] A non-grouping version of regular parentheses. Matches whatever regular expression is inside the parentheses, but the ! substring matched by the group \emph{cannot} be retrieved after performing a match or ! referenced later in the pattern. \item[\code{(?P<\var{name}>...)}] Similar to regular parentheses, but the substring matched by the group is accessible via the symbolic group ! name \var{name}. Group names must be valid Python identifiers. A symbolic group is also a numbered group, just as if the group were not named. So the group named 'id' in the example above can also be --- 232,243 ---- \item[\code{(?:...)}] A non-grouping version of regular parentheses. Matches whatever regular expression is inside the parentheses, but the ! substring matched by the group \emph{cannot} be retrieved after performing a match or ! referenced later in the pattern. \item[\code{(?P<\var{name}>...)}] Similar to regular parentheses, but the substring matched by the group is accessible via the symbolic group ! name \var{name}. Group names must be valid Python identifiers, and ! each group name must be defined only once within a regular expression. A symbolic group is also a numbered group, just as if the group were not named. So the group named 'id' in the example above can also be *************** *** 293,297 **** same number. Groups are numbered starting from 1. For example, \regexp{(.+) \e 1} matches \code{'the the'} or \code{'55 55'}, but not ! \code{'the end'} (note the space after the group). This special sequence can only be used to match one of the first 99 groups. If the first digit of \var{number} --- 294,298 ---- same number. Groups are numbered starting from 1. For example, \regexp{(.+) \e 1} matches \code{'the the'} or \code{'55 55'}, but not ! \code{'the end'} (note the space after the group). This special sequence can only be used to match one of the first 99 groups. If the first digit of \var{number} *************** *** 301,305 **** 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. \item[\code{\e A}] Matches only at the start of the string. --- 302,306 ---- 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. \item[\code{\e A}] Matches only at the start of the string. *************** *** 388,392 **** Compile a regular expression pattern into a regular expression object, which can be used for matching using its \function{match()} and ! \function{search()} methods, described below. The expression's behaviour can be modified by specifying a --- 389,393 ---- Compile a regular expression pattern into a regular expression object, which can be used for matching using its \function{match()} and ! \function{search()} methods, described below. The expression's behaviour can be modified by specifying a *************** *** 425,429 **** \dataline{LOCALE} Make \regexp{\e w}, \regexp{\e W}, \regexp{\e b}, and ! \regexp{\e B} dependent on the current locale. \end{datadesc} --- 426,430 ---- \dataline{LOCALE} Make \regexp{\e w}, \regexp{\e W}, \regexp{\e b}, and ! \regexp{\e B} dependent on the current locale. \end{datadesc} *************** *** 457,461 **** \dataline{VERBOSE} This flag allows you to write regular expressions that look nicer. ! Whitespace within the pattern is ignored, except when in a character class or preceded by an unescaped backslash, and, when a line contains a \character{\#} neither in a --- 458,462 ---- \dataline{VERBOSE} This flag allows you to write regular expressions that look nicer. ! Whitespace within the pattern is ignored, except when in a character class or preceded by an unescaped backslash, and, when a line contains a \character{\#} neither in a *************** *** 606,610 **** position in the string matches the pattern; note that this is different from finding a zero-length match at some point in the string. ! The optional \var{pos} and \var{endpos} parameters have the same meaning as for the \method{match()} method. --- 607,611 ---- position in the string matches the pattern; note that this is different from finding a zero-length match at some point in the string. ! The optional \var{pos} and \var{endpos} parameters have the same meaning as for the \method{match()} method. *************** *** 660,664 **** \begin{memberdesc}[RegexObject]{groupindex} ! A dictionary mapping any symbolic group names defined by \regexp{(?P<\var{id}>)} to group numbers. The dictionary is empty if no symbolic groups were used in the pattern. --- 661,665 ---- \begin{memberdesc}[RegexObject]{groupindex} ! A dictionary mapping any symbolic group names defined by \regexp{(?P<\var{id}>)} to group numbers. The dictionary is empty if no symbolic groups were used in the pattern. *************** *** 696,700 **** in the pattern, an \exception{IndexError} exception is raised. If a group is contained in a part of the pattern that did not match, ! the corresponding result is \code{None}. If a group is contained in a part of the pattern that matched multiple times, the last match is returned. --- 697,701 ---- in the pattern, an \exception{IndexError} exception is raised. If a group is contained in a part of the pattern that did not match, ! the corresponding result is \code{None}. If a group is contained in a part of the pattern that matched multiple times, the last match is returned. *************** *** 702,706 **** If the regular expression uses the \regexp{(?P<\var{name}>...)} syntax, the \var{groupN} arguments may also be strings identifying groups by ! their group name. If a string argument is not used as a group name in the pattern, an \exception{IndexError} exception is raised. --- 703,707 ---- If the regular expression uses the \regexp{(?P<\var{name}>...)} syntax, the \var{groupN} arguments may also be strings identifying groups by ! their group name. If a string argument is not used as a group name in the pattern, an \exception{IndexError} exception is raised. *************** *** 766,770 **** The value of \var{pos} which was passed to the \function{search()} or \function{match()} function. This is the index ! into the string at which the RE engine started looking for a match. \end{memberdesc} --- 767,771 ---- The value of \var{pos} which was passed to the \function{search()} or \function{match()} function. This is the index ! into the string at which the RE engine started looking for a match. \end{memberdesc} From tim_one@users.sourceforge.net Sat Nov 3 19:57:23 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 03 Nov 2001 11:57:23 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libgc.tex,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv31683/python/Doc/lib Modified Files: libgc.tex Log Message: Finish SF patch 477059: __del__ on new classes vs. GC. Just doc and NEWS here, about the change in gc.garbage meaning. Index: libgc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libgc.tex,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** libgc.tex 2000/10/04 16:34:08 1.5 --- libgc.tex 2001/11/03 19:57:21 1.6 *************** *** 84,88 **** \begin{datadesc}{garbage} A list of objects which the collector found to be unreachable ! but could not be freed (uncollectable objects). Objects that have \method{__del__()} methods and create part of a reference cycle cause the entire reference cycle to be uncollectable. If --- 84,92 ---- \begin{datadesc}{garbage} A list of objects which the collector found to be unreachable ! but could not be freed (uncollectable objects). By default, this list ! contains only objects with \method{__del__()} methods.\footnote{Prior to ! Python 2.2, the list contained all instance objects in unreachable ! cycles, not only those with \method{__del__()} methods.} ! Objects that have \method{__del__()} methods and create part of a reference cycle cause the entire reference cycle to be uncollectable. If From tim_one@users.sourceforge.net Sat Nov 3 19:57:23 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 03 Nov 2001 11:57:23 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.307,1.308 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv31683/python/Misc Modified Files: NEWS Log Message: Finish SF patch 477059: __del__ on new classes vs. GC. Just doc and NEWS here, about the change in gc.garbage meaning. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.307 retrieving revision 1.308 diff -C2 -d -r1.307 -r1.308 *** NEWS 2001/11/03 19:35:43 1.307 --- NEWS 2001/11/03 19:57:21 1.308 *************** *** 33,36 **** --- 33,41 ---- Extension modules + - By default, the gc.garbage list now contains only those instances in + unreachable cycles that have __del__ methods; in 2.1 it contained all + instances in unreachable cycles. "Instances" here has been generalized + to include instances of both new-style and old-style classes. + - The socket module defines a new method for socket objects, sendall(). This is like send() but may make multiple calls to From bwarsaw@users.sourceforge.net Sun Nov 4 03:04:27 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Sat, 03 Nov 2001 19:04:27 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib smtpd.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv14440 Modified Files: smtpd.py Log Message: Two bug fixes for problems reported by Sverre: __getaddr(): Watch out for empty addresses that can happen when something like "MAIL FROM:" is received. This avoids the IndexError and rightly returns an SMTP syntax error. parseargs(): We didn't handle the 2-arg case where both the localspec and the remotespec were provided on the command line. Index: smtpd.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/smtpd.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** smtpd.py 2001/10/09 15:46:31 1.10 --- smtpd.py 2001/11/04 03:04:25 1.11 *************** *** 212,216 **** if arg[:keylen].upper() == keyword: address = arg[keylen:].strip() ! if address[0] == '<' and address[-1] == '>' and address != '<>': # Addresses can be in the form but watch out # for null address, e.g. <> --- 212,218 ---- if arg[:keylen].upper() == keyword: address = arg[keylen:].strip() ! if not address: ! pass ! elif address[0] == '<' and address[-1] == '>' and address != '<>': # Addresses can be in the form but watch out # for null address, e.g. <> *************** *** 490,493 **** --- 492,498 ---- localspec = args[0] remotespec = 'localhost:25' + elif len(args) < 3: + localspec = args[0] + remotespec = args[1] else: usage(1, 'Invalid arguments: %s' % COMMASPACE.join(args)) From tim_one@users.sourceforge.net Sun Nov 4 05:57:18 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 03 Nov 2001 21:57:18 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects object.c,2.159,2.160 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv5704/python/Objects Modified Files: object.c Log Message: No code change -- just trying to document the return conditions for all the internal comparison routines. Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.159 retrieving revision 2.160 diff -C2 -d -r2.159 -r2.160 *** object.c 2001/10/22 16:30:36 2.159 --- object.c 2001/11/04 05:57:16 2.160 *************** *** 397,403 **** -1 for exception (including the case where try_rich_compare() returns an object that's not a Boolean); ! 0 if the outcome is false; ! 1 if the outcome is true; ! 2 if this particular rich comparison is not implemented or undefined. */ static int --- 397,403 ---- -1 for exception (including the case where try_rich_compare() returns an object that's not a Boolean); ! 0 if the outcome is false; ! 1 if the outcome is true; ! 2 if this particular rich comparison is not implemented or undefined. */ static int *************** *** 423,430 **** /* Try rich comparisons to determine a 3-way comparison. Return: -2 for an exception; ! -1 if v < w; ! 0 if v == w; ! 1 if v > w; ! 2 if this particular rich comparison is not implemented or undefined. */ static int --- 423,430 ---- /* Try rich comparisons to determine a 3-way comparison. Return: -2 for an exception; ! -1 if v < w; ! 0 if v == w; ! 1 if v > w; ! 2 if this particular rich comparison is not implemented or undefined. */ static int *************** *** 456,463 **** /* Try a 3-way comparison, returning an int. Return: -2 for an exception; ! -1 if v < w; ! 0 if v == w; ! 1 if v > w; ! 2 if this particular 3-way comparison is not implemented or undefined. */ static int --- 456,463 ---- /* Try a 3-way comparison, returning an int. Return: -2 for an exception; ! -1 if v < w; ! 0 if v == w; ! 1 if v > w; ! 2 if this particular 3-way comparison is not implemented or undefined. */ static int *************** *** 524,530 **** /* Final fallback 3-way comparison, returning an int. Return: -2 if an error occurred; ! -1 if v < w; ! 0 if v == w; ! 1 if v > w. */ static int --- 524,530 ---- /* Final fallback 3-way comparison, returning an int. Return: -2 if an error occurred; ! -1 if v < w; ! 0 if v == w; ! 1 if v > w. */ static int *************** *** 591,597 **** /* Do a 3-way comparison, by hook or by crook. Return: -2 for an exception; ! -1 if v < w; 0 if v == w; ! 1 if v > w; If the object implements a tp_compare function, it returns whatever this function returns (whether with an exception or not). --- 591,597 ---- /* Do a 3-way comparison, by hook or by crook. Return: -2 for an exception; ! -1 if v < w; 0 if v == w; ! 1 if v > w; If the object implements a tp_compare function, it returns whatever this function returns (whether with an exception or not). *************** *** 724,727 **** --- 724,734 ---- } + /* Compare v to w. Return + -1 if v < w or exception (PyErr_Occurred() true in latter case). + 0 if v == w. + 1 if v > w. + XXX The docs (C API manual) say the return value is undefined in case + XXX of error. + */ int PyObject_Compare(PyObject *v, PyObject *w) *************** *** 772,775 **** --- 779,783 ---- } + /* Return (new reference to) Py_True or Py_False. */ static PyObject * convert_3way_to_object(int op, int c) *************** *** 789,793 **** } ! static PyObject * try_3way_to_rich_compare(PyObject *v, PyObject *w, int op) --- 797,806 ---- } ! /* We want a rich comparison but don't have one. Try a 3-way cmp instead. ! Return ! NULL if error ! Py_True if v op w ! Py_False if not (v op w) ! */ static PyObject * try_3way_to_rich_compare(PyObject *v, PyObject *w, int op) *************** *** 803,806 **** --- 816,825 ---- } + /* Do rich comparison on v and w. Return + NULL if error + Else a new reference to an object other than Py_NotImplemented, usually(?): + Py_True if v op w + Py_False if not (v op w) + */ static PyObject * do_richcmp(PyObject *v, PyObject *w, int op) *************** *** 842,845 **** --- 861,871 ---- } + /* Return: + NULL for exception; + NotImplemented if this particular rich comparison is not implemented or + undefined; + some object not equal to NotImplemented if it is implemented + (this latter object may not be a Boolean). + */ PyObject * PyObject_RichCompare(PyObject *v, PyObject *w, int op) From tim_one@users.sourceforge.net Sun Nov 4 07:29:33 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 03 Nov 2001 23:29:33 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects object.c,2.160,2.161 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv20367/python/Objects Modified Files: object.c Log Message: Rehabilitated the fast-path richcmp code, and sped it up. It wasn't helping for types that defined tp_richcmp but not tp_compare, although that's when it's most valuable, and strings moved into that category since the fast path was first introduced. Now it helps for same-type non-Instance objects that define rich or 3-way compares. For all the edits here, the rest just amounts to moving the fast path from do_richcmp into PyObject_RichCompare, saving a layer of function call (measurable on my box!). This loses when NESTING_LIMIT is exceeded, but I don't care about that (fast-paths are for normal cases, not pathologies). Also added a tasteful label to get out of PyObject_RichCompare, as the if/else nesting in this routine was getting incomprehensible. Index: object.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/object.c,v retrieving revision 2.160 retrieving revision 2.161 diff -C2 -d -r2.160 -r2.161 *** object.c 2001/11/04 05:57:16 2.160 --- object.c 2001/11/04 07:29:31 2.161 *************** *** 826,856 **** { PyObject *res; - cmpfunc f; - /* If the types are equal, don't bother with coercions etc. - Instances are special-cased in try_3way_compare, since - a result of 2 does *not* mean one value being greater - than the other. */ - if (v->ob_type == w->ob_type - && (f = v->ob_type->tp_compare) != NULL - && !PyInstance_Check(v)) { - int c; - richcmpfunc f1; - if ((f1 = RICHCOMPARE(v->ob_type)) != NULL) { - /* If the type has richcmp, try it first. - try_rich_compare would try it two-sided, - which is not needed since we've a single - type only. */ - res = (*f1)(v, w, op); - if (res != Py_NotImplemented) - return res; - Py_DECREF(res); - } - c = (*f)(v, w); - if (c < 0 && PyErr_Occurred()) - return NULL; - return convert_3way_to_object(op, c); - } - res = try_rich_compare(v, w, op); if (res != Py_NotImplemented) --- 826,830 ---- *************** *** 863,868 **** /* Return: NULL for exception; - NotImplemented if this particular rich comparison is not implemented or - undefined; some object not equal to NotImplemented if it is implemented (this latter object may not be a Boolean). --- 837,840 ---- *************** *** 881,889 **** && !PyString_Check(v) && !PyTuple_Check(v)))) { /* try to detect circular data structures */ PyObject *token = check_recursion(v, w, op); - if (token == NULL) { res = NULL; } else if (token == Py_None) { --- 853,862 ---- && !PyString_Check(v) && !PyTuple_Check(v)))) { + /* try to detect circular data structures */ PyObject *token = check_recursion(v, w, op); if (token == NULL) { res = NULL; + goto Done; } else if (token == Py_None) { *************** *** 905,912 **** delete_token(token); } } ! else { ! res = do_richcmp(v, w, op); } compare_nesting--; return res; --- 878,916 ---- delete_token(token); } + goto Done; } ! ! /* No nesting extremism. ! If the types are equal, and not old-style instances, try to ! get out cheap (don't bother with coercions etc.). */ ! if (v->ob_type == w->ob_type && !PyInstance_Check(v)) { ! cmpfunc fcmp; ! richcmpfunc frich = RICHCOMPARE(v->ob_type); ! /* If the type has richcmp, try it first. try_rich_compare ! tries it two-sided, which is not needed since we've a ! single type only. */ ! if (frich != NULL) { ! res = (*frich)(v, w, op); ! if (res != Py_NotImplemented) ! goto Done; ! Py_DECREF(res); ! } ! /* No richcmp, or this particular richmp not implemented. ! Try 3-way cmp. */ ! fcmp = v->ob_type->tp_compare; ! if (fcmp != NULL) { ! int c = (*fcmp)(v, w); ! if (c < 0 && PyErr_Occurred()) { ! res = NULL; ! goto Done; ! } ! res = convert_3way_to_object(op, c); ! goto Done; ! } } + + /* Fast path not taken, or couldn't deliver a useful result. */ + res = do_richcmp(v, w, op); + Done: compare_nesting--; return res; From tim_one@users.sourceforge.net Sun Nov 4 19:27:01 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sun, 04 Nov 2001 11:27:01 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python compile.c,2.227,2.228 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv27596/python/Python Modified Files: compile.c Log Message: Part of SF bug #478003 possible memory leaks in err handling. PyNode_CompileSymtable: if symtable_init() fails, free the memory allocated for the PyFutureFeatures struct. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.227 retrieving revision 2.228 diff -C2 -d -r2.227 -r2.228 *** compile.c 2001/10/18 16:15:10 2.227 --- compile.c 2001/11/04 19:26:58 2.228 *************** *** 4044,4050 **** if (ff == NULL) return NULL; st = symtable_init(); ! if (st == NULL) return NULL; st->st_future = ff; symtable_enter_scope(st, TOP, TYPE(n), n->n_lineno); --- 4044,4053 ---- if (ff == NULL) return NULL; + st = symtable_init(); ! if (st == NULL) { ! PyMem_Free((void *)ff); return NULL; + } st->st_future = ff; symtable_enter_scope(st, TOP, TYPE(n), n->n_lineno); From tim_one@users.sourceforge.net Sun Nov 4 23:09:42 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sun, 04 Nov 2001 15:09:42 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects longobject.c,1.111,1.112 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv13971/python/Objects Modified Files: longobject.c Log Message: long_true_divide(): decref its converted arguments. test_long_future.py run in an infinite loop no longer grows. Thanks to Neal Norwitz for determining that test leaked! Index: longobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/longobject.c,v retrieving revision 1.111 retrieving revision 1.112 diff -C2 -d -r1.111 -r1.112 *** longobject.c 2001/10/05 20:51:38 1.111 --- longobject.c 2001/11/04 23:09:40 1.112 *************** *** 1616,1625 **** PyLongObject *a, *b; double ad, bd; ! int aexp, bexp; CONVERT_BINOP(v, w, &a, &b); ad = _PyLong_AsScaledDouble((PyObject *)a, &aexp); bd = _PyLong_AsScaledDouble((PyObject *)b, &bexp); ! if ((ad == -1.0 || bd == -1.0) && PyErr_Occurred()) return NULL; --- 1616,1628 ---- PyLongObject *a, *b; double ad, bd; ! int aexp, bexp, failed; CONVERT_BINOP(v, w, &a, &b); ad = _PyLong_AsScaledDouble((PyObject *)a, &aexp); bd = _PyLong_AsScaledDouble((PyObject *)b, &bexp); ! failed = (ad == -1.0 || bd == -1.0) && PyErr_Occurred(); ! Py_DECREF(a); ! Py_DECREF(b); ! if (failed) return NULL; From akuchling@users.sourceforge.net Mon Nov 5 01:55:06 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Sun, 04 Nov 2001 17:55:06 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib email.tex,1.6,1.7 emailgenerator.tex,1.2,1.3 emailmessage.tex,1.3,1.4 emailutil.tex,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv19363 Modified Files: email.tex emailgenerator.tex emailmessage.tex emailutil.tex Log Message: Minor grammar and typo fixes Index: email.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/email.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** email.tex 2001/10/09 19:37:51 1.6 --- email.tex 2001/11/05 01:55:03 1.7 *************** *** 27,31 **** completely re-arrange the contents, etc. There is a separate parser and a separate generator which handles the transformation from flat ! text to the object module, and then back to flat text again. There are also handy subclasses for some common MIME object types, and a few miscellaneous utilities that help with such common tasks as extracting --- 27,31 ---- completely re-arrange the contents, etc. There is a separate parser and a separate generator which handles the transformation from flat ! text to the object model, and then back to flat text again. There are also handy subclasses for some common MIME object types, and a few miscellaneous utilities that help with such common tasks as extracting *************** *** 49,53 **** some auxiliary utilities, and a few examples. For users of the older \module{mimelib} package, from which the \module{email} package is ! descendent, a section on differences and porting is provided. \subsection{Representing an email message} --- 49,53 ---- some auxiliary utilities, and a few examples. For users of the older \module{mimelib} package, from which the \module{email} package is ! descended, a section on differences and porting is provided. \subsection{Representing an email message} Index: emailgenerator.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailgenerator.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** emailgenerator.tex 2001/09/26 22:21:52 1.2 --- emailgenerator.tex 2001/11/05 01:55:03 1.3 *************** *** 16,20 **** transformation from flat text, to an object tree via the \class{Parser} class, ! and back to flat text, be idempotent (the input is identical to the output). --- 16,20 ---- transformation from flat text, to an object tree via the \class{Parser} class, ! and back to flat text, is idempotent (the input is identical to the output). *************** *** 28,32 **** Python 2.0 extended print statement. ! Optional \var{mangle_from_} is a flag that, when true, puts a ``>'' character in front of any line in the body that starts exactly as \samp{From } (i.e. \code{From} followed by a space at the front of the --- 28,32 ---- Python 2.0 extended print statement. ! Optional \var{mangle_from_} is a flag that, when true, puts a \samp{>} character in front of any line in the body that starts exactly as \samp{From } (i.e. \code{From} followed by a space at the front of the Index: emailmessage.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailmessage.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** emailmessage.tex 2001/10/19 04:34:42 1.3 --- emailmessage.tex 2001/11/05 01:55:03 1.4 *************** *** 133,137 **** \begin{methoddesc}[Message]{__contains__}{name} Return true if the message object has a field named \var{name}. ! Match is done case-insensitively and \var{name} should not include the trailing colon. Used for the \code{in} operator, e.g.: --- 133,137 ---- \begin{methoddesc}[Message]{__contains__}{name} Return true if the message object has a field named \var{name}. ! Matching is done case-insensitively and \var{name} should not include the trailing colon. Used for the \code{in} operator, e.g.: Index: emailutil.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailutil.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** emailutil.tex 2001/10/22 20:53:45 1.3 --- emailutil.tex 2001/11/05 01:55:03 1.4 *************** *** 102,106 **** first 8 elements of \var{tuple} as a local time and then compensates for the timezone difference. This may yield a slight error around ! changes in daylight savings time, though not worth worring about for common use. \end{funcdesc} --- 102,106 ---- first 8 elements of \var{tuple} as a local time and then compensates for the timezone difference. This may yield a slight error around ! changes in daylight savings time, though not worth worrying about for common use. \end{funcdesc} From akuchling@users.sourceforge.net Mon Nov 5 01:55:46 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Sun, 04 Nov 2001 17:55:46 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib lib.tex,1.194,1.195 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv19523 Modified Files: lib.tex Log Message: Remove email*.tex subsections; they're all \input by email.tex Index: lib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/lib.tex,v retrieving revision 1.194 retrieving revision 1.195 diff -C2 -d -r1.194 -r1.195 *** lib.tex 2001/10/30 06:21:32 1.194 --- lib.tex 2001/11/05 01:55:43 1.195 *************** *** 219,229 **** \input{libformatter} \input{email} - \input{emailencoders} - \input{emailexc} - \input{emailgenerator} - \input{emailiter} - \input{emailmessage} - \input{emailparser} - \input{emailutil} \input{librfc822} \input{libmimetools} --- 219,222 ---- From tim_one@users.sourceforge.net Mon Nov 5 02:46:00 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sun, 04 Nov 2001 18:46:00 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.192,1.193 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv30873/python/Modules Modified Files: socketmodule.c Log Message: SF patch 473749 compile under OS/2 VA C++, from Michael Muller. Changes enabling Python to compile under OS/2 Visual Age C++. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.192 retrieving revision 1.193 diff -C2 -d -r1.192 -r1.193 *** socketmodule.c 2001/11/02 23:34:52 1.192 --- socketmodule.c 2001/11/05 02:45:58 1.193 *************** *** 143,147 **** #include #include ! #if !(defined(__BEOS__) || defined(__CYGWIN__)) #include #endif --- 143,147 ---- #include #include ! #if !(defined(__BEOS__) || defined(__CYGWIN__) || (defined(PYOS_OS2) && defined(PYCC_VACPP))) #include #endif *************** *** 150,153 **** --- 150,156 ---- #ifdef __BEOS__ #include + #elif defined(PYOS_OS2) && defined(PYCC_VACPP) + #include + typedef size_t socklen_t; #else #ifndef USE_GUSI1 From tim_one@users.sourceforge.net Mon Nov 5 02:46:01 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sun, 04 Nov 2001 18:46:01 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python bltinmodule.c,2.243,2.244 importdl.h,2.16,2.17 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv30873/python/Python Modified Files: bltinmodule.c importdl.h Log Message: SF patch 473749 compile under OS/2 VA C++, from Michael Muller. Changes enabling Python to compile under OS/2 Visual Age C++. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.243 retrieving revision 2.244 diff -C2 -d -r2.243 -r2.244 *** bltinmodule.c 2001/10/29 22:25:45 2.243 --- bltinmodule.c 2001/11/05 02:45:59 2.244 *************** *** 568,572 **** --- 568,576 ---- if (!stat(filename, &s)) { if (S_ISDIR(s.st_mode)) + #if defined(PYOS_OS2) && defined(PYCC_VACPP) + errno = EOS2ERR; + #else errno = EISDIR; + #endif else exists = 1; Index: importdl.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/importdl.h,v retrieving revision 2.16 retrieving revision 2.17 diff -C2 -d -r2.16 -r2.17 *** importdl.h 2000/09/01 23:29:28 2.16 --- importdl.h 2001/11/05 02:45:59 2.17 *************** *** 39,42 **** --- 39,43 ---- #else #ifdef PYOS_OS2 + #include typedef int (* APIENTRY dl_funcptr)(); #else From tim_one@users.sourceforge.net Mon Nov 5 02:46:01 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sun, 04 Nov 2001 18:46:01 -0800 Subject: [Python-checkins] CVS: python/dist/src/PC/os2vacpp config.c,1.6,1.7 makefile,1.4,1.5 pyconfig.h,1.2,1.3 python.def,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/PC/os2vacpp In directory usw-pr-cvs1:/tmp/cvs-serv30873/python/PC/os2vacpp Modified Files: config.c makefile pyconfig.h python.def Log Message: SF patch 473749 compile under OS/2 VA C++, from Michael Muller. Changes enabling Python to compile under OS/2 Visual Age C++. Index: config.c =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/os2vacpp/config.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** config.c 2000/07/22 19:25:51 1.6 --- config.c 2001/11/05 02:45:58 1.7 *************** *** 35,39 **** extern void initselect(void); extern void init_socket(void); - extern void initsoundex(void); extern void initstrop(void); extern void initstruct(void); --- 35,38 ---- *************** *** 83,87 **** {"select", initselect}, #endif - {"soundex", initsoundex}, {"strop", initstrop}, {"struct", initstruct}, --- 82,85 ---- Index: makefile =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/os2vacpp/makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** makefile 2001/07/26 13:41:05 1.4 --- makefile 2001/11/05 02:45:58 1.5 *************** *** 66,71 **** #.HDRPATH.c := $(PROJINCLUDE,;= ) $(.HDRPATH.c) #.PATH.c = .;$(PY_MODULES);$(PY_OBJECTS);$(PY_PARSER);$(PY_PYTHON) ! OTHERLIBS = $(OS2TCPIP)\lib\so32dll.lib $(OS2TCPIP)\lib\tcp32dll.lib \ ! $(TCLTK)\Lib\Tcl76.lib $(TCLTK)\Lib\Tk42.lib ################# --- 66,70 ---- #.HDRPATH.c := $(PROJINCLUDE,;= ) $(.HDRPATH.c) #.PATH.c = .;$(PY_MODULES);$(PY_OBJECTS);$(PY_PARSER);$(PY_PYTHON) ! OTHERLIBS = so32dll.lib tcp32dll.lib # Tcl76.lib Tk42.lib ################# *************** *** 122,126 **** $(PATHOBJ)\Thread.obj \ $(PATHOBJ)\TraceBack.obj \ ! $(PATHOBJ)\FrozenMain.obj # Python's Internal Parser --- 121,132 ---- $(PATHOBJ)\Thread.obj \ $(PATHOBJ)\TraceBack.obj \ ! $(PATHOBJ)\FrozenMain.obj \ ! $(PATHOBJ)\exceptions.obj \ ! $(PATHOBJ)\symtable.obj \ ! $(PATHOBJ)\codecs.obj \ ! $(PATHOBJ)\future.obj \ ! $(PATHOBJ)\dynload_os2.obj \ ! $(PATHOBJ)\mysnprintf.obj \ ! $(PATHOBJ)\iterobject.obj # Python's Internal Parser *************** *** 155,159 **** $(PATHOBJ)\StringObject.obj \ $(PATHOBJ)\TupleObject.obj \ ! $(PATHOBJ)\TypeObject.obj # Extension Modules (Built-In or as Separate DLLs) --- 161,171 ---- $(PATHOBJ)\StringObject.obj \ $(PATHOBJ)\TupleObject.obj \ ! $(PATHOBJ)\TypeObject.obj \ ! $(PATHOBJ)\unicodeobject.obj \ ! $(PATHOBJ)\unicodectype.obj \ ! $(PATHOBJ)\cellobject.obj \ ! $(PATHOBJ)\descrobject.obj \ ! $(PATHOBJ)\weakrefobject.obj \ ! $(PATHOBJ)\structseq.obj # Extension Modules (Built-In or as Separate DLLs) *************** *** 182,191 **** $(PATHOBJ)\SignalModule.obj \ $(PATHOBJ)\SocketModule.obj \ - $(PATHOBJ)\SoundEx.obj \ $(PATHOBJ)\StropModule.obj \ $(PATHOBJ)\StructModule.obj \ $(PATHOBJ)\TimeModule.obj \ $(PATHOBJ)\ThreadModule.obj \ ! $(PATHOBJ)\YUVConvert.obj # Standalone Parser Generator Program (Shares Some of Python's Modules) --- 194,204 ---- $(PATHOBJ)\SignalModule.obj \ $(PATHOBJ)\SocketModule.obj \ $(PATHOBJ)\StropModule.obj \ $(PATHOBJ)\StructModule.obj \ $(PATHOBJ)\TimeModule.obj \ $(PATHOBJ)\ThreadModule.obj \ ! $(PATHOBJ)\YUVConvert.obj \ ! $(PATHOBJ)\bufferobject.obj \ ! $(PATHOBJ)\gcmodule.obj # Standalone Parser Generator Program (Shares Some of Python's Modules) *************** *** 212,216 **** # /Gd = Dynamically Load Runtime # /Ms = Use _System Calling Convention (vs _Optlink) ! # (to allow non-VAC++ code to call into Python15.dll) _OPT = /O /Gl --- 225,229 ---- # /Gd = Dynamically Load Runtime # /Ms = Use _System Calling Convention (vs _Optlink) ! # (to allow non-VAC++ code to call into Python22.dll) _OPT = /O /Gl *************** *** 247,252 **** # Primary Target(s) ################### ! All: obj noise PyCore.lib Python15.lib PGen.exe \ ! Python.exe PythonPM.exe Python15.dll _tkinter.dll Modules: $(MODULES) --- 260,265 ---- # Primary Target(s) ################### ! All: obj noise PyCore.lib Python22.lib PGen.exe \ ! Python.exe PythonPM.exe Python22.dll # _tkinter.dll Modules: $(MODULES) *************** *** 268,278 **** # Python Extension DLL: Tcl/Tk Interface ! _tkinter.dll: $(PATHOBJ)\_tkinter.obj Python15.lib _tkinter.def ! @ Echo Linking $@ As DLL ! @ $(CC) $(CFLAGS) /B"/NOE" $(_DLL) /Fe$@ $(_MAP) $** $(OTHERLIBS) >>$(ERRS) ! $(PATHOBJ)\_tkinter.obj: $(PY_MODULES)\_tkinter.c ! @ Echo Compiling $** ! @ $(CC) -c $(CFLAGS) $(_DLL) -Fo$@ $** >>$(ERRS) # Object Library of All Essential Python Routines --- 281,291 ---- # Python Extension DLL: Tcl/Tk Interface ! #_tkinter.dll: $(PATHOBJ)\_tkinter.obj Python22.lib _tkinter.def ! # @ Echo Linking $@ As DLL ! # @ $(CC) $(CFLAGS) /B"/NOE" $(_DLL) /Fe$@ $(_MAP) $** $(OTHERLIBS) >>$(ERRS) ! #$(PATHOBJ)\_tkinter.obj: $(PY_MODULES)\_tkinter.c ! # @ Echo Compiling $** ! # @ $(CC) -c $(CFLAGS) $(_DLL) -Fo$@ $** >>$(ERRS) # Object Library of All Essential Python Routines *************** *** 281,289 **** @ ! ILIB $@ /NOLOGO /NOBACKUP -+$? ; >>$(ERRS) ! Python15.dll: $(PATHOBJ)\Compile.obj PyCore.lib Python.def @ Echo Linking $@ As DLL @ $(CC) $(CFLAGS) /B"/NOE" $(_DLL) /Fe$@ $(_MAP) $** $(OTHERLIBS) >>$(ERRS) ! @ Echo Compressing $@ with LxLite ! @ lxlite $@ # IBM Linker Requires One Explicit .OBJ To Build a .DLL from a .LIB --- 294,302 ---- @ ! ILIB $@ /NOLOGO /NOBACKUP -+$? ; >>$(ERRS) ! Python22.dll: $(PATHOBJ)\Compile.obj PyCore.lib Python.def @ Echo Linking $@ As DLL @ $(CC) $(CFLAGS) /B"/NOE" $(_DLL) /Fe$@ $(_MAP) $** $(OTHERLIBS) >>$(ERRS) ! # @ Echo Compressing $@ with LxLite ! # @ lxlite $@ # IBM Linker Requires One Explicit .OBJ To Build a .DLL from a .LIB *************** *** 292,308 **** @ $(CC) -c $(CFLAGS) $(_DLL) -Fo$@ $** >>$(ERRS) ! # Import Library for Using the Python15.dll ! Python15.lib: Python.def @ Echo Making $@ @ IMPLIB /NOLOGO /NOIGNORE $@ $** >>$(ERRS) @ ILIB /NOLOGO /CONVFORMAT /NOEXTDICTIONARY /NOBROWSE /NOBACKUP $@; >>$(ERRS) ! # Small Command-Line Program to Start Interpreter in Python15.dll ! Python.exe: $(PATHOBJ)\Python.obj Python15.lib @ Echo Linking $@ As EXE @ $(CC) $(CFLAGS) $(_EXE) /B"/PM:VIO /STACK:360000" /Fe$@ $(_MAP) $** $(OTHERLIBS) >>$(ERRS) ! # Small PM-GUI Program to Start Interpreter in Python15.dll ! PythonPM.exe: $(PATHOBJ)\Python.obj Python15.lib @ Echo Linking $@ As EXE @ $(CC) $(CFLAGS) $(_EXE) /B"/PM:PM /STACK:360000" /Fe$@ $(_MAP) $** $(OTHERLIBS) >>$(ERRS) --- 305,321 ---- @ $(CC) -c $(CFLAGS) $(_DLL) -Fo$@ $** >>$(ERRS) ! # Import Library for Using the Python22.dll ! Python22.lib: Python.def @ Echo Making $@ @ IMPLIB /NOLOGO /NOIGNORE $@ $** >>$(ERRS) @ ILIB /NOLOGO /CONVFORMAT /NOEXTDICTIONARY /NOBROWSE /NOBACKUP $@; >>$(ERRS) ! # Small Command-Line Program to Start Interpreter in Python22.dll ! Python.exe: $(PATHOBJ)\Python.obj Python22.lib @ Echo Linking $@ As EXE @ $(CC) $(CFLAGS) $(_EXE) /B"/PM:VIO /STACK:360000" /Fe$@ $(_MAP) $** $(OTHERLIBS) >>$(ERRS) ! # Small PM-GUI Program to Start Interpreter in Python22.dll ! PythonPM.exe: $(PATHOBJ)\Python.obj Python22.lib @ Echo Linking $@ As EXE @ $(CC) $(CFLAGS) $(_EXE) /B"/PM:PM /STACK:360000" /Fe$@ $(_MAP) $** $(OTHERLIBS) >>$(ERRS) *************** *** 324,334 **** # Remove All Targets, Including Final Binaries distclean: clean ! -- Del /Q PyCore.lib Python15.lib >NUL 2>&1 ! -- Del /Q Python15.dll Python.exe PGen.exe >NUL 2>&1 ! release: Python.exe Python15.dll Python15.lib -- @Echo Y | copy /U Python.exe D:\EXEs ! -- @Echo Y | copy /U Python15.dll D:\DLLs ! -- @Echo Y | copy /U Python15.lib E:\Tau\Lib -- @Echo Y | copy /U _tkinter.dll D:\Python --- 337,347 ---- # Remove All Targets, Including Final Binaries distclean: clean ! -- Del /Q PyCore.lib Python22.lib >NUL 2>&1 ! -- Del /Q Python22.dll Python.exe PGen.exe >NUL 2>&1 ! release: Python.exe Python22.dll Python22.lib -- @Echo Y | copy /U Python.exe D:\EXEs ! -- @Echo Y | copy /U Python22.dll D:\DLLs ! -- @Echo Y | copy /U Python22.lib E:\Tau\Lib -- @Echo Y | copy /U _tkinter.dll D:\Python Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/os2vacpp/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/11/05 02:45:58 1.3 *************** *** 55,59 **** * won't have to explicitly specify it anymore */ ! #pragma library("Python15.lib") /***************************************************/ --- 55,59 ---- * won't have to explicitly specify it anymore */ ! #pragma library("Python22.lib") /***************************************************/ *************** *** 80,83 **** --- 80,91 ---- /* #define SIZEOF_LONG_LONG 8 */ /* Count of Bytes in a (long long) */ + /* unicode definines */ + #define Py_USING_UNICODE + #define PY_UNICODE_TYPE wchar_t + #define Py_UNICODE_SIZE SIZEOF_SHORT + + /* dynamic loading */ + #define HAVE_DYNAMIC_LOADING 1 + /* Define if type char is unsigned and you are not using gcc. */ #ifndef __CHAR_UNSIGNED__ *************** *** 189,193 **** /* Unix-Specific */ ! #define HAVE_SYS_UN_H 1 /* #include */ /* #define HAVE_SYS_UTSNAME_H 1 */ /* #include */ /* #define HAVE_SYS_WAIT_H 1 */ /* #include */ --- 197,201 ---- /* Unix-Specific */ ! /* #define HAVE_SYS_UN_H 1 /* #include */ /* #define HAVE_SYS_UTSNAME_H 1 */ /* #include */ /* #define HAVE_SYS_WAIT_H 1 */ /* #include */ Index: python.def =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/os2vacpp/python.def,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** python.def 1998/09/28 22:02:39 1.3 --- python.def 2001/11/05 02:45:58 1.4 *************** *** 1,4 **** ! LIBRARY PYTHON15 INITINSTANCE TERMINSTANCE ! DESCRIPTION 'Python 1.5 Core DLL' PROTMODE DATA MULTIPLE NONSHARED --- 1,4 ---- ! LIBRARY PYTHON22 INITINSTANCE TERMINSTANCE ! DESCRIPTION 'Python 2.2 Core DLL' PROTMODE DATA MULTIPLE NONSHARED *************** *** 473,475 **** --- 473,480 ---- _Py_re_set_syntax ; _Py_samebitset + PyBuffer_Type + PyBuffer_FromObject + PyBuffer_FromMemory + PyBuffer_FromReadWriteMemory + PyBuffer_New From tim_one@users.sourceforge.net Mon Nov 5 02:51:09 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sun, 04 Nov 2001 18:51:09 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.308,1.309 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv32543/python/Misc Modified Files: NEWS Log Message: News about OS/2 Visual Age C++ patches. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.308 retrieving revision 1.309 diff -C2 -d -r1.308 -r1.309 *** NEWS 2001/11/03 19:57:21 1.308 --- NEWS 2001/11/05 02:51:07 1.309 *************** *** 87,90 **** --- 87,93 ---- *with* threads, and passes the test suite. + - Thanks to a series of patches from Michael Muller, Python may build + again under OS/2 Visual Age C++. + - Updated RISCOS port by Dietmar Schwertberger. From jvr@users.sourceforge.net Mon Nov 5 08:27:59 2001 From: jvr@users.sourceforge.net (Just van Rossum) Date: Mon, 05 Nov 2001 00:27:59 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/list listscan.py,1.7,1.8 listsupport.py,1.11,1.12 _Listmodule.c,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/list In directory usw-pr-cvs1:/tmp/cvs-serv30675 Modified Files: listscan.py listsupport.py _Listmodule.c Log Message: More List Manager interfacing: - CreateCustomList(): write LDEF's in Python! (carbon + classic) - list.LGetCellDataLocation() (Jack: what's with this _WIN32/pywintoolbox.h stuff?) Index: listscan.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/list/listscan.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** listscan.py 2001/02/27 13:00:36 1.7 --- listscan.py 2001/11/05 08:27:57 1.8 *************** *** 40,44 **** "LDispose", # Done by removing the object "LSearch", # We don't want to handle procs just yet ! "LGetCellDataLocation", # What does this do?? # These have funny argument/return values --- 40,45 ---- "LDispose", # Done by removing the object "LSearch", # We don't want to handle procs just yet ! "CreateCustomList", # done manually ! "SetListDefinitionProc", # These have funny argument/return values *************** *** 55,62 **** def makeblacklisttypes(self): return [ ! 'ListDefSpec', # Too difficult for now ! 'ListDefSpec_ptr', # ditto ! "ListDefUPP", ! "ListClickLoopUPP", ] --- 56,60 ---- def makeblacklisttypes(self): return [ ! "ListClickLoopUPP", # Too difficult for now ] Index: listsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/list/listsupport.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** listsupport.py 2001/09/05 10:31:28 1.11 --- listsupport.py 2001/11/05 08:27:57 1.12 *************** *** 27,30 **** --- 27,33 ---- ListBounds = Rect ListBounds_ptr = Rect_ptr + + ListDefSpec = ListDefSpec_ptr = OpaqueType("ListDefSpec", "PyMac_BuildListDefSpec", "PyMac_GetListDefSpec") + VarOutBufferShortsize = VarHeapOutputBufferType('char', 'short', 's') # (buf, &len) InBufferShortsize = VarInputBufferType('char', 'short', 's') # (buf, len) *************** *** 77,85 **** #define as_List(x) ((ListHandle)x) #define as_Resource(lh) ((Handle)lh) """ initstuff = initstuff + """ ! PyMac_INIT_TOOLBOX_OBJECT_NEW(ListHandle, ListObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ListHandle, ListObj_Convert); """ --- 80,126 ---- #define as_List(x) ((ListHandle)x) #define as_Resource(lh) ((Handle)lh) + + static ListDefUPP myListDefFunctionUPP; + + #if !TARGET_API_MAC_CARBON + + #define kJumpAbs 0x4EF9 + + #pragma options align=mac68k + typedef struct { + short jmpabs; /* 4EF9 */ + ListDefUPP theUPP; /* 00000000 */ + } LDEFStub, **LDEFStubHandle; + #pragma options align=reset + + static OSErr installLDEFStub(ListHandle list) { + LDEFStubHandle stubH; + + stubH = (LDEFStubHandle)NewHandleClear(sizeof(LDEFStub)); + if (stubH == NULL) + return MemError(); + + (*stubH)->jmpabs = kJumpAbs; + (*stubH)->theUPP = myListDefFunctionUPP; + HLock((Handle) stubH); + + (*list)->listDefProc = (Handle)stubH; + return noErr; + } + + static void removeLDEFStub(ListHandle list) { + if ((*list)->listDefProc) + DisposeHandle((Handle)(*list)->listDefProc); + (*list)->listDefProc = NULL; + } + + #endif """ initstuff = initstuff + """ ! myListDefFunctionUPP = NewListDefUPP((ListDefProcPtr)myListDefFunction); ! ! PyMac_INIT_TOOLBOX_OBJECT_NEW(ListHandle, ListObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ListHandle, ListObj_Convert); """ *************** *** 99,105 **** /* XXXX Should we HLock() here?? */ if ( strcmp(name, "listFlags") == 0 ) ! return Py_BuildValue("l", (long)(*self->ob_itself)->listFlags & 0xff); if ( strcmp(name, "selFlags") == 0 ) ! return Py_BuildValue("l", (long)(*self->ob_itself)->selFlags & 0xff); }""" --- 140,146 ---- /* XXXX Should we HLock() here?? */ if ( strcmp(name, "listFlags") == 0 ) ! return Py_BuildValue("l", (long)GetListFlags(self->ob_itself) & 0xff); if ( strcmp(name, "selFlags") == 0 ) ! return Py_BuildValue("l", (long)GetListSelectionFlags(self->ob_itself) & 0xff); }""" *************** *** 114,123 **** intval = PyInt_AsLong(value); if (strcmp(name, "listFlags") == 0 ) { ! /* XXXX Should we HLock the handle here?? */ ! (*self->ob_itself)->listFlags = intval; return 0; } if (strcmp(name, "selFlags") == 0 ) { ! (*self->ob_itself)->selFlags = intval; return 0; } --- 155,163 ---- intval = PyInt_AsLong(value); if (strcmp(name, "listFlags") == 0 ) { ! SetListFlags(self->ob_itself, intval); return 0; } if (strcmp(name, "selFlags") == 0 ) { ! SetListSelectionFlags(self->ob_itself, intval); return 0; } *************** *** 131,134 **** --- 171,176 ---- def outputStructMembers(self): ObjectDefinition.outputStructMembers(self) + Output("PyObject *ob_ldef_func;") + Output("int ob_have_ldef_stub;") Output("int ob_must_be_disposed;") *************** *** 141,147 **** --- 183,198 ---- def outputInitStructMembers(self): ObjectDefinition.outputInitStructMembers(self) + Output("it->ob_ldef_func = NULL;") + Output("it->ob_have_ldef_stub = 0;") Output("it->ob_must_be_disposed = 1;") + Output("SetListRefCon(itself, (long)it);") def outputFreeIt(self, itselfname): + Output("Py_XDECREF(self->ob_ldef_func);") + Output("self->ob_ldef_func = NULL;") + Output("#if !TARGET_API_MAC_CARBON") + Output("if (self->ob_have_ldef_stub) removeLDEFStub(self->ob_itself);"); + Output("#endif"); + Output("SetListRefCon(self->ob_itself, (long)0);") Output("if (self->ob_must_be_disposed && %s) LDispose(%s);", itselfname, itselfname) *************** *** 154,157 **** --- 205,246 ---- # From here on it's basically all boiler plate... + finalstuff = finalstuff + """ + static void myListDefFunction(SInt16 message, + Boolean selected, + Rect *cellRect, + Cell theCell, + SInt16 dataOffset, + SInt16 dataLen, + ListHandle theList) + { + PyObject *listDefFunc, *args, *rv=NULL; + ListObject *self; + + self = (ListObject*)GetListRefCon(theList); + if (self == NULL || self->ob_itself != theList) + return; /* nothing we can do */ + listDefFunc = self->ob_ldef_func; + if (listDefFunc == NULL) + return; /* nothing we can do */ + args = Py_BuildValue("hbO&O&hhO", message, + selected, + PyMac_BuildRect, cellRect, + PyMac_BuildPoint, theCell, + dataOffset, + dataLen, + self); + if (args != NULL) { + rv = PyEval_CallObject(listDefFunc, args); + Py_DECREF(args); + } + if (rv == NULL) { + PySys_WriteStderr("error in list definition callback:\\n"); + PyErr_Print(); + } else { + Py_DECREF(rv); + } + } + """ + # Create the generator groups and link them module = MacModule(MODNAME, MODPREFIX, includestuff, finalstuff, initstuff) *************** *** 187,194 **** --- 276,360 ---- methods.append(f) + # Manual generator for CreateCustomList, due to callback ideosyncracies + CreateCustomList_body = """\ + Rect rView; + Rect dataBounds; + Point cellSize; + + PyObject *listDefFunc; + ListDefSpec theSpec; + WindowPtr theWindow; + Boolean drawIt; + Boolean hasGrow; + Boolean scrollHoriz; + Boolean scrollVert; + ListHandle outList; + + if (!PyArg_ParseTuple(_args, "O&O&O&(iO)O&bbbb", + PyMac_GetRect, &rView, + PyMac_GetRect, &dataBounds, + PyMac_GetPoint, &cellSize, + &theSpec.defType, &listDefFunc, + WinObj_Convert, &theWindow, + &drawIt, + &hasGrow, + &scrollHoriz, + &scrollVert)) + return NULL; + + + #if TARGET_API_MAC_CARBON + /* Carbon applications use the CreateCustomList API */ + theSpec.u.userProc = myListDefFunctionUPP; + CreateCustomList(&rView, + &dataBounds, + cellSize, + &theSpec, + theWindow, + drawIt, + hasGrow, + scrollHoriz, + scrollVert, + &outList); + + #else + /* pre-Carbon applications set the address in the LDEF + to a routine descriptor referring to their list + definition routine. */ + outList = LNew(&rView, + &dataBounds, + cellSize, + 0, + theWindow, + drawIt, /* XXX must be false */ + hasGrow, + scrollHoriz, + scrollVert); + if (installLDEFStub(outList) != noErr) { + PyErr_SetString(PyExc_MemoryError, "can't create LDEF stub"); + return NULL; + } + #endif + + _res = ListObj_New(outList); + if (_res == NULL) + return NULL; + Py_INCREF(listDefFunc); + ((ListObject*)_res)->ob_ldef_func = listDefFunc; + #if !TARGET_API_MAC_CARBON + ((ListObject*)_res)->ob_have_ldef_stub = 1; + #endif + return _res;\ + """ + + f = ManualGenerator("CreateCustomList", CreateCustomList_body); + f.docstring = lambda: "(Rect rView, Rect dataBounds, Point cellSize, ListDefSpec theSpec, WindowPtr theWindow, Boolean drawIt, Boolean hasGrow, Boolean scrollHoriz, Boolean scrollVert) -> (ListHandle outList)" + module.add(f) + # add the populated lists to the generator groups # (in a different wordl the scan program would generate this) for f in functions: module.add(f) for f in methods: object.add(f) + # generate output (open the output file as late as possible) Index: _Listmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/list/_Listmodule.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** _Listmodule.c 2001/09/05 10:30:02 1.3 --- _Listmodule.c 2001/11/05 08:27:57 1.4 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 63,66 **** --- 59,98 ---- #define as_Resource(lh) ((Handle)lh) + static ListDefUPP myListDefFunctionUPP; + + #if !TARGET_API_MAC_CARBON + + #define kJumpAbs 0x4EF9 + + #pragma options align=mac68k + typedef struct { + short jmpabs; /* 4EF9 */ + ListDefUPP theUPP; /* 00000000 */ + } LDEFStub, **LDEFStubHandle; + #pragma options align=reset + + static OSErr installLDEFStub(ListHandle list) { + LDEFStubHandle stubH; + + stubH = (LDEFStubHandle)NewHandleClear(sizeof(LDEFStub)); + if (stubH == NULL) + return MemError(); + + (*stubH)->jmpabs = kJumpAbs; + (*stubH)->theUPP = myListDefFunctionUPP; + HLock((Handle) stubH); + + (*list)->listDefProc = (Handle)stubH; + return noErr; + } + + static void removeLDEFStub(ListHandle list) { + if ((*list)->listDefProc) + DisposeHandle((Handle)(*list)->listDefProc); + (*list)->listDefProc = NULL; + } + + #endif + static PyObject *List_Error; *************** *** 74,77 **** --- 106,111 ---- PyObject_HEAD ListHandle ob_itself; + PyObject *ob_ldef_func; + int ob_have_ldef_stub; int ob_must_be_disposed; } ListObject; *************** *** 87,91 **** --- 121,128 ---- if (it == NULL) return NULL; it->ob_itself = itself; + it->ob_ldef_func = NULL; + it->ob_have_ldef_stub = 0; it->ob_must_be_disposed = 1; + SetListRefCon(itself, (long)it); return (PyObject *)it; } *************** *** 103,106 **** --- 140,149 ---- static void ListObj_dealloc(ListObject *self) { + Py_XDECREF(self->ob_ldef_func); + self->ob_ldef_func = NULL; + #if !TARGET_API_MAC_CARBON + if (self->ob_have_ldef_stub) removeLDEFStub(self->ob_itself); + #endif + SetListRefCon(self->ob_itself, (long)0); if (self->ob_must_be_disposed && self->ob_itself) LDispose(self->ob_itself); PyMem_DEL(self); *************** *** 477,480 **** --- 520,542 ---- } + static PyObject *ListObj_LGetCellDataLocation(ListObject *_self, PyObject *_args) + { + PyObject *_res = NULL; + short offset; + short len; + Point theCell; + if (!PyArg_ParseTuple(_args, "O&", + PyMac_GetPoint, &theCell)) + return NULL; + LGetCellDataLocation(&offset, + &len, + theCell, + _self->ob_itself); + _res = Py_BuildValue("hh", + offset, + len); + return _res; + } + static PyObject *ListObj_as_Resource(ListObject *_self, PyObject *_args) { *************** *** 534,537 **** --- 596,601 ---- {"LDraw", (PyCFunction)ListObj_LDraw, 1, "(Point theCell) -> None"}, + {"LGetCellDataLocation", (PyCFunction)ListObj_LGetCellDataLocation, 1, + "(Point theCell) -> (short offset, short len)"}, {"as_Resource", (PyCFunction)ListObj_as_Resource, 1, "() -> (Handle _rv)"}, *************** *** 546,552 **** /* XXXX Should we HLock() here?? */ if ( strcmp(name, "listFlags") == 0 ) ! return Py_BuildValue("l", (long)(*self->ob_itself)->listFlags & 0xff); if ( strcmp(name, "selFlags") == 0 ) ! return Py_BuildValue("l", (long)(*self->ob_itself)->selFlags & 0xff); } return Py_FindMethodInChain(&ListObj_chain, (PyObject *)self, name); --- 610,616 ---- /* XXXX Should we HLock() here?? */ if ( strcmp(name, "listFlags") == 0 ) ! return Py_BuildValue("l", (long)GetListFlags(self->ob_itself) & 0xff); if ( strcmp(name, "selFlags") == 0 ) ! return Py_BuildValue("l", (long)GetListSelectionFlags(self->ob_itself) & 0xff); } return Py_FindMethodInChain(&ListObj_chain, (PyObject *)self, name); *************** *** 562,571 **** intval = PyInt_AsLong(value); if (strcmp(name, "listFlags") == 0 ) { ! /* XXXX Should we HLock the handle here?? */ ! (*self->ob_itself)->listFlags = intval; return 0; } if (strcmp(name, "selFlags") == 0 ) { ! (*self->ob_itself)->selFlags = intval; return 0; } --- 626,634 ---- intval = PyInt_AsLong(value); if (strcmp(name, "listFlags") == 0 ) { ! SetListFlags(self->ob_itself, intval); return 0; } if (strcmp(name, "selFlags") == 0 ) { ! SetListSelectionFlags(self->ob_itself, intval); return 0; } *************** *** 602,605 **** --- 665,741 ---- + static PyObject *List_CreateCustomList(PyObject *_self, PyObject *_args) + { + PyObject *_res = NULL; + Rect rView; + Rect dataBounds; + Point cellSize; + + PyObject *listDefFunc; + ListDefSpec theSpec; + WindowPtr theWindow; + Boolean drawIt; + Boolean hasGrow; + Boolean scrollHoriz; + Boolean scrollVert; + ListHandle outList; + + if (!PyArg_ParseTuple(_args, "O&O&O&(iO)O&bbbb", + PyMac_GetRect, &rView, + PyMac_GetRect, &dataBounds, + PyMac_GetPoint, &cellSize, + &theSpec.defType, &listDefFunc, + WinObj_Convert, &theWindow, + &drawIt, + &hasGrow, + &scrollHoriz, + &scrollVert)) + return NULL; + + + #if TARGET_API_MAC_CARBON + /* Carbon applications use the CreateCustomList API */ + theSpec.u.userProc = myListDefFunctionUPP; + CreateCustomList(&rView, + &dataBounds, + cellSize, + &theSpec, + theWindow, + drawIt, + hasGrow, + scrollHoriz, + scrollVert, + &outList); + + #else + /* pre-Carbon applications set the address in the LDEF + to a routine descriptor referring to their list + definition routine. */ + outList = LNew(&rView, + &dataBounds, + cellSize, + 0, + theWindow, + drawIt, /* XXX must be false */ + hasGrow, + scrollHoriz, + scrollVert); + if (installLDEFStub(outList) != noErr) { + PyErr_SetString(PyExc_MemoryError, "can't create LDEF stub"); + return NULL; + } + #endif + + _res = ListObj_New(outList); + if (_res == NULL) + return NULL; + Py_INCREF(listDefFunc); + ((ListObject*)_res)->ob_ldef_func = listDefFunc; + #if !TARGET_API_MAC_CARBON + ((ListObject*)_res)->ob_have_ldef_stub = 1; + #endif + return _res; + } + static PyObject *List_LNew(PyObject *_self, PyObject *_args) { *************** *** 938,941 **** --- 1074,1079 ---- static PyMethodDef List_methods[] = { + {"CreateCustomList", (PyCFunction)List_CreateCustomList, 1, + "(Rect rView, Rect dataBounds, Point cellSize, ListDefSpec theSpec, WindowPtr theWindow, Boolean drawIt, Boolean hasGrow, Boolean scrollHoriz, Boolean scrollVert) -> (ListHandle outList)"}, {"LNew", (PyCFunction)List_LNew, 1, "(Rect rView, Rect dataBounds, Point cSize, short theProc, WindowPtr theWindow, Boolean drawIt, Boolean hasGrow, Boolean scrollHoriz, Boolean scrollVert) -> (ListHandle _rv)"}, *************** *** 985,988 **** --- 1123,1162 ---- + static void myListDefFunction(SInt16 message, + Boolean selected, + Rect *cellRect, + Cell theCell, + SInt16 dataOffset, + SInt16 dataLen, + ListHandle theList) + { + PyObject *listDefFunc, *args, *rv=NULL; + ListObject *self; + + self = (ListObject*)GetListRefCon(theList); + if (self == NULL || self->ob_itself != theList) + return; /* nothing we can do */ + listDefFunc = self->ob_ldef_func; + if (listDefFunc == NULL) + return; /* nothing we can do */ + args = Py_BuildValue("hbO&O&hhO", message, + selected, + PyMac_BuildRect, cellRect, + PyMac_BuildPoint, theCell, + dataOffset, + dataLen, + self); + if (args != NULL) { + rv = PyEval_CallObject(listDefFunc, args); + Py_DECREF(args); + } + if (rv == NULL) { + PySys_WriteStderr("error in list definition callback:\n"); + PyErr_Print(); + } else { + Py_DECREF(rv); + } + } + void init_List(void) *************** *** 993,998 **** ! PyMac_INIT_TOOLBOX_OBJECT_NEW(ListHandle, ListObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ListHandle, ListObj_Convert); --- 1167,1174 ---- ! myListDefFunctionUPP = NewListDefUPP((ListDefProcPtr)myListDefFunction); ! ! PyMac_INIT_TOOLBOX_OBJECT_NEW(ListHandle, ListObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(ListHandle, ListObj_Convert); From jvr@users.sourceforge.net Mon Nov 5 08:51:26 2001 From: jvr@users.sourceforge.net (Just van Rossum) Date: Mon, 05 Nov 2001 00:51:26 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wlists.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv3683 Modified Files: Wlists.py Log Message: Rewritten the List Definition for the traceback window in Python, which makes it work under Carbon. Next stop: the object browser. Index: Wlists.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wlists.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Wlists.py 2001/11/02 19:09:34 1.6 --- Wlists.py 2001/11/05 08:51:24 1.7 *************** *** 2,6 **** import Wkeys import string ! from Carbon import Evt, Events, Lists, Qd, Scrap, Win --- 2,9 ---- import Wkeys import string ! from Carbon import Evt, Events, Fm, Lists, Qd, Scrap, Win ! from Carbon.List import LNew, CreateCustomList, GetListPort ! from Carbon.Lists import kListDefUserProcType, lInitMsg, lDrawMsg, lHiliteMsg, lCloseMsg ! from Carbon.QuickDraw import hilitetransfermode *************** *** 35,44 **** def createlist(self): - from Carbon import List self._calcbounds() self.SetPort() rect = self._bounds rect = rect[0]+1, rect[1]+1, rect[2]-16, rect[3]-1 ! self._list = List.LNew(rect, (0, 0, self._cols, 0), (0, 0), self.LDEF_ID, self._parentwindow.wid, 0, 1, 0, 1) if self.drawingmode: --- 38,46 ---- def createlist(self): self._calcbounds() self.SetPort() rect = self._bounds rect = rect[0]+1, rect[1]+1, rect[2]-16, rect[3]-1 ! self._list = LNew(rect, (0, 0, self._cols, 0), (0, 0), self.LDEF_ID, self._parentwindow.wid, 0, 1, 0, 1) if self.drawingmode: *************** *** 362,378 **** ! class TwoLineList(List): ! LDEF_ID = 468 def createlist(self): - from Carbon import List self._calcbounds() self.SetPort() rect = self._bounds rect = rect[0]+1, rect[1]+1, rect[2]-16, rect[3]-1 ! self._list = List.LNew(rect, (0, 0, 1, 0), (0, 28), self.LDEF_ID, self._parentwindow.wid, ! 0, 1, 0, 1) ! self.set(self.items) --- 364,481 ---- ! class CustomList(List): ! """Base class for writing custom list definitions.""" + _cellHeight = 0 + def createlist(self): self._calcbounds() self.SetPort() rect = self._bounds rect = rect[0]+1, rect[1]+1, rect[2]-16, rect[3]-1 ! self._list = CreateCustomList( ! rect, ! (0, 0, 1, 0), ! (0, self._cellHeight), ! (kListDefUserProcType, self.listDefinitionFunc), ! self._parentwindow.wid, ! 0, 1, 0, 1) ! if self.drawingmode: ! self._list.LSetDrawingMode(0) ! self._list.selFlags = self._flags ! self.setitems(self.items) ! if hasattr(self, "_sel"): ! self.setselection(self._sel) ! del self._sel ! ! def listDefinitionFunc(self, message, selected, cellRect, theCell, ! dataOffset, dataLen, theList): ! """The LDEF message dispatcher routine, no need to override.""" ! if message == lInitMsg: ! self.listDefInit(theList) ! elif message == lDrawMsg: ! self.listDefDraw(selected, cellRect, theCell, ! dataOffset, dataLen, theList) ! elif message == lHiliteMsg: ! self.listDefHighlight(selected, cellRect, theCell, ! dataOffset, dataLen, theList) ! elif message == lCloseMsg: ! self.listDefClose(theList) ! ! def listDefInit(self, theList): ! pass ! def listDefClose(self, theList): ! pass ! def listDefDraw(self, selected, cellRect, theCell, ! dataOffset, dataLen, theList): ! pass ! def listDefHighlight(self, selected, cellRect, theCell, ! dataOffset, dataLen, theList): ! pass ! ! ! class TwoLineList(CustomList): ! ! _cellHeight = 28 ! ! def listDefDraw(self, selected, cellRect, theCell, ! dataOffset, dataLen, theList): ! savedPort = Qd.GetPort() ! Qd.SetPort(GetListPort(theList)) ! savedClip = Qd.NewRgn() ! Qd.GetClip(savedClip) ! Qd.ClipRect(cellRect) ! savedPenState = Qd.GetPenState() ! Qd.PenNormal() ! Qd.EraseRect(cellRect) ! ! #draw the cell if it contains data ! ascent, descent, leading, size, hm = Fm.FontMetrics() ! linefeed = ascent + descent + leading ! ! if dataLen: ! left, top, right, bottom = cellRect ! data = theList.LGetCell(dataLen, theCell) ! lines = data.split("\r") ! line1 = lines[0] ! if len(lines) > 1: ! line2 = lines[1] ! else: ! line2 = "" ! Qd.MoveTo(left + 4, top + ascent) ! Qd.DrawText(line1, 0, len(line1)) ! if line2: ! Qd.MoveTo(left + 4, top + ascent + linefeed) ! Qd.DrawText(line2, 0, len(line2)) ! Qd.PenPat("\x11\x11\x11\x11\x11\x11\x11\x11") ! Qd.MoveTo(left, bottom - 1) ! Qd.LineTo(right, bottom - 1) ! if selected: ! self.listDefHighlight(selected, cellRect, theCell, ! dataOffset, dataLen, theList) ! #restore graphics environment ! Qd.SetPort(savedPort) ! Qd.SetClip(savedClip) ! Qd.DisposeRgn(savedClip) ! Qd.SetPenState(savedPenState) ! ! def listDefHighlight(self, selected, cellRect, theCell, ! dataOffset, dataLen, theList): ! savedPort = Qd.GetPort() ! Qd.SetPort(GetListPort(theList)) ! savedClip = Qd.NewRgn() ! Qd.GetClip(savedClip) ! Qd.ClipRect(cellRect) ! savedPenState = Qd.GetPenState() ! Qd.PenNormal() ! Qd.PenMode(hilitetransfermode) ! Qd.PaintRect(cellRect) ! ! #restore graphics environment ! Qd.SetPort(savedPort) ! Qd.SetClip(savedClip) ! Qd.DisposeRgn(savedClip) ! Qd.SetPenState(savedPenState) From jvr@users.sourceforge.net Mon Nov 5 11:12:14 2001 From: jvr@users.sourceforge.net (Just van Rossum) Date: Mon, 05 Nov 2001 03:12:14 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/list listsupport.py,1.12,1.13 _Listmodule.c,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/list In directory usw-pr-cvs1:/tmp/cvs-serv5850 Modified Files: listsupport.py _Listmodule.c Log Message: added acces to the cellSize field, rewrote setattr code Index: listsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/list/listsupport.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** listsupport.py 2001/11/05 08:27:57 1.12 --- listsupport.py 2001/11/05 11:12:12 1.13 *************** *** 138,146 **** getattrHookCode = """{ - /* XXXX Should we HLock() here?? */ if ( strcmp(name, "listFlags") == 0 ) return Py_BuildValue("l", (long)GetListFlags(self->ob_itself) & 0xff); if ( strcmp(name, "selFlags") == 0 ) return Py_BuildValue("l", (long)GetListSelectionFlags(self->ob_itself) & 0xff); }""" --- 138,147 ---- getattrHookCode = """{ if ( strcmp(name, "listFlags") == 0 ) return Py_BuildValue("l", (long)GetListFlags(self->ob_itself) & 0xff); if ( strcmp(name, "selFlags") == 0 ) return Py_BuildValue("l", (long)GetListSelectionFlags(self->ob_itself) & 0xff); + if ( strcmp(name, "cellSize") == 0 ) + return Py_BuildValue("O&", PyMac_BuildPoint, (*self->ob_itself)->cellSize); }""" *************** *** 150,166 **** { long intval; ! ! if ( value == NULL || !PyInt_Check(value) ) return -1; - intval = PyInt_AsLong(value); - if (strcmp(name, "listFlags") == 0 ) { - SetListFlags(self->ob_itself, intval); - return 0; - } - if (strcmp(name, "selFlags") == 0 ) { - SetListSelectionFlags(self->ob_itself, intval); - return 0; } ! return -1; } """ --- 151,170 ---- { long intval; ! int err = 0; ! ! if ( value == NULL ) { ! PyErr_SetString(PyExc_AttributeError, "Cannot delete attribute"); return -1; } ! if (strcmp(name, "listFlags") == 0 ) ! err = PyArg_Parse(value, "B", &(*self->ob_itself)->listFlags); ! else if (strcmp(name, "selFlags") == 0 ) ! err = PyArg_Parse(value, "B", &(*self->ob_itself)->selFlags); ! else if (strcmp(name, "cellSize") == 0 ) ! err = PyArg_Parse(value, "O&", PyMac_GetPoint, &(*self->ob_itself)->cellSize); ! else ! PyErr_SetString(PyExc_AttributeError, "No such attribute"); ! if (err) return 0; ! else return -1; } """ Index: _Listmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/list/_Listmodule.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** _Listmodule.c 2001/11/05 08:27:57 1.4 --- _Listmodule.c 2001/11/05 11:12:12 1.5 *************** *** 608,616 **** { { - /* XXXX Should we HLock() here?? */ if ( strcmp(name, "listFlags") == 0 ) return Py_BuildValue("l", (long)GetListFlags(self->ob_itself) & 0xff); if ( strcmp(name, "selFlags") == 0 ) return Py_BuildValue("l", (long)GetListSelectionFlags(self->ob_itself) & 0xff); } return Py_FindMethodInChain(&ListObj_chain, (PyObject *)self, name); --- 608,617 ---- { { if ( strcmp(name, "listFlags") == 0 ) return Py_BuildValue("l", (long)GetListFlags(self->ob_itself) & 0xff); if ( strcmp(name, "selFlags") == 0 ) return Py_BuildValue("l", (long)GetListSelectionFlags(self->ob_itself) & 0xff); + if ( strcmp(name, "cellSize") == 0 ) + return Py_BuildValue("O&", PyMac_BuildPoint, (*self->ob_itself)->cellSize); } return Py_FindMethodInChain(&ListObj_chain, (PyObject *)self, name); *************** *** 621,637 **** { long intval; ! ! if ( value == NULL || !PyInt_Check(value) ) return -1; - intval = PyInt_AsLong(value); - if (strcmp(name, "listFlags") == 0 ) { - SetListFlags(self->ob_itself, intval); - return 0; - } - if (strcmp(name, "selFlags") == 0 ) { - SetListSelectionFlags(self->ob_itself, intval); - return 0; } ! return -1; } --- 622,641 ---- { long intval; ! int err = 0; ! ! if ( value == NULL ) { ! PyErr_SetString(PyExc_AttributeError, "Cannot delete attribute"); return -1; } ! if (strcmp(name, "listFlags") == 0 ) ! err = PyArg_Parse(value, "B", &(*self->ob_itself)->listFlags); ! else if (strcmp(name, "selFlags") == 0 ) ! err = PyArg_Parse(value, "B", &(*self->ob_itself)->selFlags); ! else if (strcmp(name, "cellSize") == 0 ) ! err = PyArg_Parse(value, "O&", PyMac_GetPoint, &(*self->ob_itself)->cellSize); ! else ! PyErr_SetString(PyExc_AttributeError, "No such attribute"); ! if (err) return 0; ! else return -1; } From jack@oratrix.nl Mon Nov 5 11:57:40 2001 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 05 Nov 2001 12:57:40 +0100 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/list listscan.py,1.7,1.8 listsupport.py,1.11,1.12 _Listmodule.c,1.3,1.4 In-Reply-To: Message by Just van Rossum , Mon, 05 Nov 2001 00:27:59 -0800 , Message-ID: <20011105115740.CCE5A303181@snelboot.oratrix.nl> > Modified Files: > listscan.py listsupport.py _Listmodule.c > Log Message: > ... > (Jack: what's with this _WIN32/pywintoolbox.h stuff?) Oops, that's something that I changed in bgen that wasn't supposed to have escaped just yet (as I can't guarantee that I'll find the time to pack this up into a reasonable distribution any time soon). But just in case anyone is interested in helping: I have the QuickTime module and some of the supporting stuff running under Windows (PythonWin, to be specific). If someone is willing to help with cleanup/packaging: let me know. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From jackjansen@users.sourceforge.net Mon Nov 5 14:36:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 06:36:38 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Python macimport.c,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv22711/python/Mac/Python Modified Files: macimport.c Log Message: MacPython -vv equivalent printed incorrect filenames, fixed. Also removed some outdated code. Index: macimport.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macimport.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** macimport.c 2001/08/07 15:30:18 1.12 --- macimport.c 2001/11/05 14:36:32 1.13 *************** *** 438,448 **** return 0; - #if 0 - /* Pre 1.5a4 */ - strcpy(buf+*lenp, module); - strcpy(buf+*lenp+modnamelen, _PyImport_Filetab[0].suffix); - #else strcpy(buf+*lenp, _PyImport_Filetab[0].suffix); - #endif #ifdef USE_GUSI1 if ( Path2FSSpec(buf, &fss) == noErr && --- 438,442 ---- *************** *** 466,469 **** --- 460,464 ---- if ( modnamelen > 54 ) return 0; /* Leave room for extension */ strcpy((char *)fnbuf+1, module); + buf[*lenp] = '\0'; for( fdp = _PyImport_Filetab+1; fdp->suffix; fdp++ ) { *************** *** 474,483 **** if ( FSMakeFSSpec(refnum, dirid, fnbuf, &fss) == noErr ) { /* Found it. */ - #if 0 - strcpy(buf+*lenp+modnamelen, fdp->suffix); - #else strcpy(buf+*lenp, fdp->suffix); - #endif - *lenp = strlen(buf); return fdp; } --- 469,473 ---- From jackjansen@users.sourceforge.net Mon Nov 5 14:39:07 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 06:39:07 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/cf _CFmodule.c,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/cf In directory usw-pr-cvs1:/tmp/cvs-serv23300/python/Mac/Modules/cf Modified Files: _CFmodule.c Log Message: Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me. Index: _CFmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/cf/_CFmodule.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** _CFmodule.c 2001/09/05 10:31:01 1.4 --- _CFmodule.c 2001/11/05 14:39:05 1.5 *************** *** 32,52 **** #endif ! /* For now we declare them forward here. They'll go to mactoolbox later */ ! staticforward PyObject *CFTypeRefObj_New(CFTypeRef); ! staticforward int CFTypeRefObj_Convert(PyObject *, CFTypeRef *); ! staticforward PyObject *CFStringRefObj_New(CFStringRef); ! staticforward int CFStringRefObj_Convert(PyObject *, CFStringRef *); ! staticforward PyObject *CFURLRefObj_New(CFURLRef); ! staticforward int CFURLRefObj_Convert(PyObject *, CFURLRef *); ! staticforward int CFURLRefObj_Convert(PyObject *, CFURLRef *); ! // ADD declarations ! #ifdef NOTYET_USE_TOOLBOX_OBJECT_GLUE ! //extern PyObject *_CFTypeRefObj_New(CFTypeRef); ! //extern int _CFTypeRefObj_Convert(PyObject *, CFTypeRef *); ! //#define CFTypeRefObj_New _CFTypeRefObj_New ! //#define CFTypeRefObj_Convert _CFTypeRefObj_Convert #endif --- 32,87 ---- #endif ! #ifdef USE_TOOLBOX_OBJECT_GLUE ! extern PyObject *_CFTypeRefObj_New(CFTypeRef); ! extern int _CFTypeRefObj_Convert(PyObject *, CFTypeRef *); ! #define CFTypeRefObj_New _CFTypeRefObj_New ! #define CFTypeRefObj_Convert _CFTypeRefObj_Convert ! extern PyObject *_CFStringRefObj_New(CFStringRef); ! extern int _CFStringRefObj_Convert(PyObject *, CFStringRef *); ! #define CFStringRefObj_New _CFStringRefObj_New ! #define CFStringRefObj_Convert _CFStringRefObj_Convert ! extern PyObject *_CFMutableStringRefObj_New(CFMutableStringRef); ! extern int _CFMutableStringRefObj_Convert(PyObject *, CFMutableStringRef *); ! #define CFMutableStringRefObj_New _CFMutableStringRefObj_New ! #define CFMutableStringRefObj_Convert _CFMutableStringRefObj_Convert ! extern PyObject *_CFArrayRefObj_New(CFArrayRef); ! extern int _CFArrayRefObj_Convert(PyObject *, CFArrayRef *); ! #define CFArrayRefObj_New _CFArrayRefObj_New ! #define CFArrayRefObj_Convert _CFArrayRefObj_Convert ! ! extern PyObject *_CFMutableArrayRefObj_New(CFMutableArrayRef); ! extern int _CFMutableArrayRefObj_Convert(PyObject *, CFMutableArrayRef *); ! #define CFMutableArrayRefObj_New _CFMutableArrayRefObj_New ! #define CFMutableArrayRefObj_Convert _CFMutableArrayRefObj_Convert ! ! extern PyObject *_CFDataRefObj_New(CFDataRef); ! extern int _CFDataRefObj_Convert(PyObject *, CFDataRef *); ! #define CFDataRefObj_New _CFDataRefObj_New ! #define CFDataRefObj_Convert _CFDataRefObj_Convert ! ! extern PyObject *_CFMutableDataRefObj_New(CFMutableDataRef); ! extern int _CFMutableDataRefObj_Convert(PyObject *, CFMutableDataRef *); ! #define CFMutableDataRefObj_New _CFMutableDataRefObj_New ! #define CFMutableDataRefObj_Convert _CFMutableDataRefObj_Convert ! ! extern PyObject *_CFDictionaryRefObj_New(CFDictionaryRef); ! extern int _CFDictionaryRefObj_Convert(PyObject *, CFDictionaryRef *); ! #define CFDictionaryRefObj_New _CFDictionaryRefObj_New ! #define CFDictionaryRefObj_Convert _CFDictionaryRefObj_Convert ! ! extern PyObject *_CFMutableDictionaryRefObj_New(CFMutableDictionaryRef); ! extern int _CFMutableDictionaryRefObj_Convert(PyObject *, CFMutableDictionaryRef *); ! #define CFMutableDictionaryRefObj_New _CFMutableDictionaryRefObj_New ! #define CFMutableDictionaryRefObj_Convert _CFMutableDictionaryRefObj_Convert ! ! extern PyObject *_CFURLRefObj_New(CFURLRef); ! extern int _CFURLRefObj_Convert(PyObject *, CFURLRef *); ! extern int _OptionalCFURLRefObj_Convert(PyObject *, CFURLRef *); ! #define CFURLRefObj_New _CFURLRefObj_New ! #define CFURLRefObj_Convert _CFURLRefObj_Convert ! #define OptionalCFURLRefObj_Convert _OptionalCFURLRefObj_Convert #endif *************** *** 3123,3128 **** ! // PyMac_INIT_TOOLBOX_OBJECT_NEW(Track, TrackObj_New); ! // PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Track, TrackObj_Convert); --- 3158,3179 ---- ! PyMac_INIT_TOOLBOX_OBJECT_NEW(CFTypeRef, CFTypeRefObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFTypeRef, CFTypeRefObj_Convert); ! PyMac_INIT_TOOLBOX_OBJECT_NEW(CFStringRef, CFStringRefObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFStringRef, CFStringRefObj_Convert); ! PyMac_INIT_TOOLBOX_OBJECT_NEW(CFMutableStringRef, CFMutableStringRefObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFMutableStringRef, CFMutableStringRefObj_Convert); ! ! PyMac_INIT_TOOLBOX_OBJECT_NEW(CFArrayRef, CFArrayRefObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFArrayRef, CFArrayRefObj_Convert); ! PyMac_INIT_TOOLBOX_OBJECT_NEW(CFMutableArrayRef, CFMutableArrayRefObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFMutableArrayRef, CFMutableArrayRefObj_Convert); ! PyMac_INIT_TOOLBOX_OBJECT_NEW(CFDictionaryRef, CFDictionaryRefObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFDictionaryRef, CFDictionaryRefObj_Convert); ! PyMac_INIT_TOOLBOX_OBJECT_NEW(CFMutableDictionaryRef, CFMutableDictionaryRefObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFMutableDictionaryRef, CFMutableDictionaryRefObj_Convert); ! PyMac_INIT_TOOLBOX_OBJECT_NEW(CFURLRef, CFURLRefObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFURLRef, CFURLRefObj_Convert); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFURLRef, CFURLRefObj_Convert); From jackjansen@users.sourceforge.net Mon Nov 5 14:39:14 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 06:39:14 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/cf cfsupport.py,1.11,1.12 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/cf In directory usw-pr-cvs1:/tmp/cvs-serv23364/python/Mac/Modules/cf Modified Files: cfsupport.py Log Message: Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me. Index: cfsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/cf/cfsupport.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** cfsupport.py 2001/09/05 10:31:37 1.11 --- cfsupport.py 2001/11/05 14:39:11 1.12 *************** *** 54,74 **** #endif ! /* For now we declare them forward here. They'll go to mactoolbox later */ ! staticforward PyObject *CFTypeRefObj_New(CFTypeRef); ! staticforward int CFTypeRefObj_Convert(PyObject *, CFTypeRef *); ! staticforward PyObject *CFStringRefObj_New(CFStringRef); ! staticforward int CFStringRefObj_Convert(PyObject *, CFStringRef *); ! staticforward PyObject *CFURLRefObj_New(CFURLRef); ! staticforward int CFURLRefObj_Convert(PyObject *, CFURLRef *); ! staticforward int CFURLRefObj_Convert(PyObject *, CFURLRef *); ! // ADD declarations ! #ifdef NOTYET_USE_TOOLBOX_OBJECT_GLUE ! //extern PyObject *_CFTypeRefObj_New(CFTypeRef); ! //extern int _CFTypeRefObj_Convert(PyObject *, CFTypeRef *); ! //#define CFTypeRefObj_New _CFTypeRefObj_New ! //#define CFTypeRefObj_Convert _CFTypeRefObj_Convert #endif --- 54,109 ---- #endif ! #ifdef USE_TOOLBOX_OBJECT_GLUE ! extern PyObject *_CFTypeRefObj_New(CFTypeRef); ! extern int _CFTypeRefObj_Convert(PyObject *, CFTypeRef *); ! #define CFTypeRefObj_New _CFTypeRefObj_New ! #define CFTypeRefObj_Convert _CFTypeRefObj_Convert ! extern PyObject *_CFStringRefObj_New(CFStringRef); ! extern int _CFStringRefObj_Convert(PyObject *, CFStringRef *); ! #define CFStringRefObj_New _CFStringRefObj_New ! #define CFStringRefObj_Convert _CFStringRefObj_Convert ! extern PyObject *_CFMutableStringRefObj_New(CFMutableStringRef); ! extern int _CFMutableStringRefObj_Convert(PyObject *, CFMutableStringRef *); ! #define CFMutableStringRefObj_New _CFMutableStringRefObj_New ! #define CFMutableStringRefObj_Convert _CFMutableStringRefObj_Convert ! extern PyObject *_CFArrayRefObj_New(CFArrayRef); ! extern int _CFArrayRefObj_Convert(PyObject *, CFArrayRef *); ! #define CFArrayRefObj_New _CFArrayRefObj_New ! #define CFArrayRefObj_Convert _CFArrayRefObj_Convert ! ! extern PyObject *_CFMutableArrayRefObj_New(CFMutableArrayRef); ! extern int _CFMutableArrayRefObj_Convert(PyObject *, CFMutableArrayRef *); ! #define CFMutableArrayRefObj_New _CFMutableArrayRefObj_New ! #define CFMutableArrayRefObj_Convert _CFMutableArrayRefObj_Convert ! ! extern PyObject *_CFDataRefObj_New(CFDataRef); ! extern int _CFDataRefObj_Convert(PyObject *, CFDataRef *); ! #define CFDataRefObj_New _CFDataRefObj_New ! #define CFDataRefObj_Convert _CFDataRefObj_Convert ! ! extern PyObject *_CFMutableDataRefObj_New(CFMutableDataRef); ! extern int _CFMutableDataRefObj_Convert(PyObject *, CFMutableDataRef *); ! #define CFMutableDataRefObj_New _CFMutableDataRefObj_New ! #define CFMutableDataRefObj_Convert _CFMutableDataRefObj_Convert ! ! extern PyObject *_CFDictionaryRefObj_New(CFDictionaryRef); ! extern int _CFDictionaryRefObj_Convert(PyObject *, CFDictionaryRef *); ! #define CFDictionaryRefObj_New _CFDictionaryRefObj_New ! #define CFDictionaryRefObj_Convert _CFDictionaryRefObj_Convert ! ! extern PyObject *_CFMutableDictionaryRefObj_New(CFMutableDictionaryRef); ! extern int _CFMutableDictionaryRefObj_Convert(PyObject *, CFMutableDictionaryRef *); ! #define CFMutableDictionaryRefObj_New _CFMutableDictionaryRefObj_New ! #define CFMutableDictionaryRefObj_Convert _CFMutableDictionaryRefObj_Convert ! ! extern PyObject *_CFURLRefObj_New(CFURLRef); ! extern int _CFURLRefObj_Convert(PyObject *, CFURLRef *); ! extern int _OptionalCFURLRefObj_Convert(PyObject *, CFURLRef *); ! #define CFURLRefObj_New _CFURLRefObj_New ! #define CFURLRefObj_Convert _CFURLRefObj_Convert ! #define OptionalCFURLRefObj_Convert _OptionalCFURLRefObj_Convert #endif *************** *** 108,113 **** initstuff = initstuff + """ ! // PyMac_INIT_TOOLBOX_OBJECT_NEW(Track, TrackObj_New); ! // PyMac_INIT_TOOLBOX_OBJECT_CONVERT(Track, TrackObj_Convert); """ --- 143,164 ---- initstuff = initstuff + """ ! PyMac_INIT_TOOLBOX_OBJECT_NEW(CFTypeRef, CFTypeRefObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFTypeRef, CFTypeRefObj_Convert); ! PyMac_INIT_TOOLBOX_OBJECT_NEW(CFStringRef, CFStringRefObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFStringRef, CFStringRefObj_Convert); ! PyMac_INIT_TOOLBOX_OBJECT_NEW(CFMutableStringRef, CFMutableStringRefObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFMutableStringRef, CFMutableStringRefObj_Convert); ! ! PyMac_INIT_TOOLBOX_OBJECT_NEW(CFArrayRef, CFArrayRefObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFArrayRef, CFArrayRefObj_Convert); ! PyMac_INIT_TOOLBOX_OBJECT_NEW(CFMutableArrayRef, CFMutableArrayRefObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFMutableArrayRef, CFMutableArrayRefObj_Convert); ! PyMac_INIT_TOOLBOX_OBJECT_NEW(CFDictionaryRef, CFDictionaryRefObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFDictionaryRef, CFDictionaryRefObj_Convert); ! PyMac_INIT_TOOLBOX_OBJECT_NEW(CFMutableDictionaryRef, CFMutableDictionaryRefObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFMutableDictionaryRef, CFMutableDictionaryRefObj_Convert); ! PyMac_INIT_TOOLBOX_OBJECT_NEW(CFURLRef, CFURLRefObj_New); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFURLRef, CFURLRefObj_Convert); ! PyMac_INIT_TOOLBOX_OBJECT_CONVERT(CFURLRef, CFURLRefObj_Convert); """ From jackjansen@users.sourceforge.net Mon Nov 5 14:39:19 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 06:39:19 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python mactoolboxglue.c,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv23401/python/Python Modified Files: mactoolboxglue.c Log Message: Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me. Index: mactoolboxglue.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/mactoolboxglue.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** mactoolboxglue.c 2001/10/31 12:11:48 1.7 --- mactoolboxglue.c 2001/11/05 14:39:17 1.8 *************** *** 460,462 **** --- 460,484 ---- GLUE_NEW(WindowPtr, WinObj_WhichWindow, "Carbon.Win") + GLUE_CONVERT(CFTypeRef, CFTypeRefObj_Convert, "Carbon.CF") + GLUE_NEW(CFTypeRef, CFTypeRefObj_New, "Carbon.CF") + + GLUE_CONVERT(CFStringRef, CFStringRefObj_Convert, "Carbon.CF") + GLUE_NEW(CFStringRef, CFStringRefObj_New, "Carbon.CF") + GLUE_CONVERT(CFMutableStringRef, CFMutableStringRefObj_Convert, "Carbon.CF") + GLUE_NEW(CFMutableStringRef, CFMutableStringRefObj_New, "Carbon.CF") + + GLUE_CONVERT(CFArrayRef, CFArrayRefObj_Convert, "Carbon.CF") + GLUE_NEW(CFArrayRef, CFArrayRefObj_New, "Carbon.CF") + GLUE_CONVERT(CFMutableArrayRef, CFMutableArrayRefObj_Convert, "Carbon.CF") + GLUE_NEW(CFMutableArrayRef, CFMutableArrayRefObj_New, "Carbon.CF") + + GLUE_CONVERT(CFDictionaryRef, CFDictionaryRefObj_Convert, "Carbon.CF") + GLUE_NEW(CFDictionaryRef, CFDictionaryRefObj_New, "Carbon.CF") + GLUE_CONVERT(CFMutableDictionaryRef, CFMutableDictionaryRefObj_Convert, "Carbon.CF") + GLUE_NEW(CFMutableDictionaryRef, CFMutableDictionaryRefObj_New, "Carbon.CF") + + GLUE_CONVERT(CFURLRef, CFURLRefObj_Convert, "Carbon.CF") + GLUE_CONVERT(CFURLRef, OptionalCFURLRefObj_Convert, "Carbon.CF") + GLUE_NEW(CFURLRef, CFURLRefObj_New, "Carbon.CF") + #endif /* USE_TOOLBOX_OBJECT_GLUE */ From jackjansen@users.sourceforge.net Mon Nov 5 14:39:24 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 06:39:24 -0800 Subject: [Python-checkins] CVS: python/dist/src/Include pymactoolbox.h,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv23432/python/Include Modified Files: pymactoolbox.h Log Message: Make the CoreFoundation object _New and _Convert routines available to other modules. Idea by Donovan Preston, implementaion by me. Index: pymactoolbox.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pymactoolbox.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pymactoolbox.h 2001/09/10 22:09:30 1.3 --- pymactoolbox.h 2001/11/05 14:39:22 1.4 *************** *** 16,19 **** --- 16,25 ---- #include #include + #include + #include + #include + #include + #include + #include #else #include *************** *** 168,171 **** --- 174,195 ---- extern PyObject *WinObj_WhichWindow(WindowPtr); + /* CF exports */ + extern PyObject *CFTypeRefObj_New(CFTypeRef); + extern int CFTypeRefObj_Convert(PyObject *, CFTypeRef *); + extern PyObject *CFStringRefObj_New(CFStringRef); + extern int CFStringRefObj_Convert(PyObject *, CFStringRef *); + extern PyObject *CFMutableStringRefObj_New(CFMutableStringRef); + extern int CFMutableStringRefObj_Convert(PyObject *, CFMutableStringRef *); + extern PyObject *CFArrayRefObj_New(CFArrayRef); + extern int CFArrayRefObj_Convert(PyObject *, CFArrayRef *); + extern PyObject *CFMutableArrayRefObj_New(CFMutableArrayRef); + extern int CFMutableArrayRefObj_Convert(PyObject *, CFMutableArrayRef *); + extern PyObject *CFDictionaryRefObj_New(CFDictionaryRef); + extern int CFDictionaryRefObj_Convert(PyObject *, CFDictionaryRef *); + extern PyObject *CFMutableDictionaryRefObj_New(CFMutableDictionaryRef); + extern int CFMutableDictionaryRefObj_Convert(PyObject *, CFMutableDictionaryRef *); + extern PyObject *CFURLRefObj_New(CFURLRef); + extern int CFURLRefObj_Convert(PyObject *, CFURLRef *); + extern int OptionalCFURLRefObj_Convert(PyObject *, CFURLRef *); #ifdef __cplusplus From jackjansen@users.sourceforge.net Mon Nov 5 14:43:07 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 06:43:07 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/carbonevt - New directory Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/carbonevt In directory usw-pr-cvs1:/tmp/cvs-serv24372/carbonevt Log Message: Directory /cvsroot/python/python/dist/src/Mac/Modules/carbonevt added to the repository From jackjansen@users.sourceforge.net Mon Nov 5 14:44:20 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 06:44:20 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/carbonevt CarbonEvtscan.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/carbonevt In directory usw-pr-cvs1:/tmp/cvs-serv24622/python/Mac/Modules/carbonevt Added Files: CarbonEvtscan.py Log Message: Carbon Event Manager module donated by Donovan Preston. Checked in as I received them (except for namechange), these will not work as-is, that'll be fixed in a later checkin. --- NEW FILE: CarbonEvtscan.py --- # IBCarbonscan.py import sys import os import string import MacOS BGENDIR= '/Users/dsp/Documents/python/dist/src/Tools/bgen/bgen' sys.path.append(BGENDIR) from bgenlocations import TOOLBOXDIR from scantools import Scanner, Scanner_OSX def main(): print "---Scanning CarbonEvents.h---" input = ["CarbonEvents.h"] output = "CarbonEventsgen.py" defsoutput = TOOLBOXDIR + "CarbonEvents.py" scanner = CarbonEvents_Scanner(input, output, defsoutput) scanner.scan() scanner.close() print "--done scanning, importing--" import CarbonEventssupport print "done" RefObjectTypes = ["EventRef", "EventQueueRef", "EventLoopRef", "EventLoopTimerRef", "EventHandlerRef", "EventHandlerCallRef", "EventTargetRef", "EventHotKeyRef", ] class CarbonEvents_Scanner(Scanner): def destination(self, type, name, arglist): classname = "CarbonEventsFunction" listname = "functions" if arglist: t, n, m = arglist[0] print "*********", t, if t in RefObjectTypes and m == "InMode": print "method" classname = "CarbonEventsMethod" listname = t + "methods" else: print "not method" return classname, listname def makeblacklistnames(self): return [ "MacCreateEvent", "TrackMouseLocationWithOptions", "TrackMouseLocation", "TrackMouseRegion", "RegisterToolboxObjectClass", "UnregisterToolboxObjectClass", "ProcessHICommand", "GetCFRunLoopFromEventLoop", "InvokeEventHandlerUPP", "InvokeEventComparatorUPP", "InvokeEventLoopTimerUPP", # Wrote by hand "InstallEventHandler", "RunApplicationEventLoop", # Write by hand? "GetEventParameter", "FlushSpecificEventsFromQueue", "FindSpecificEventInQueue", "InstallEventLoopTimer", # Don't do these because they require a CFRelease "CreateTypeStringWithOSType", "CopyEvent", ] # def makeblacklisttypes(self): # return ["EventComparatorUPP", # "EventLoopTimerUPP", # #"EventHandlerUPP", # "EventComparatorProcPtr", # "EventLoopTimerProcPtr", # "EventHandlerProcPtr", # ] if __name__ == "__main__": main() From jackjansen@users.sourceforge.net Mon Nov 5 14:44:25 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 06:44:25 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/carbonevt CarbonEvtsupport.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/carbonevt In directory usw-pr-cvs1:/tmp/cvs-serv24650/python/Mac/Modules/carbonevt Added Files: CarbonEvtsupport.py Log Message: Carbon Event Manager module donated by Donovan Preston. Checked in as I received them (except for namechange), these will not work as-is, that'll be fixed in a later checkin. --- NEW FILE: CarbonEvtsupport.py --- # IBCarbonsupport.py from macsupport import * from CarbonEventsscan import RefObjectTypes # where should this go? macsupport.py? CFStringRef = OpaqueByValueType('CFStringRef') for typ in RefObjectTypes: execstr = "%(name)s = OpaqueByValueType('%(name)s')" % {"name": typ} exec execstr # these types will have no methods and will merely be opaque blobs # should write getattr and setattr for them? StructObjectTypes = ["EventTypeSpec", "HIPoint", "HICommand", "EventHotKeyID", ] for typ in StructObjectTypes: execstr = "%(name)s = OpaqueType('%(name)s')" % {"name": typ} exec execstr EventTypeSpec_ptr = OpaqueType("EventTypeSpec *", "EventTypeSpec") # is this the right type for the void * in GetEventParameter #void_ptr = FixedInputBufferType(1024) void_ptr = stringptr # here are some types that are really other types EventTime = double EventTimeout = EventTime EventTimerInterval = EventTime EventAttributes = UInt32 EventParamName = OSType EventParamType = OSType EventPriority = SInt16 EventMask = UInt16 EventComparatorUPP = FakeType("(EventComparatorUPP)0") EventLoopTimerUPP = FakeType("(EventLoopTimerUPP)0") EventHandlerUPP = FakeType("(EventHandlerUPP)0") EventHandlerUPP = FakeType("(EventHandlerUPP)0") EventComparatorProcPtr = FakeType("(EventComparatorProcPtr)0") EventLoopTimerProcPtr = FakeType("(EventLoopTimerProcPtr)0") EventHandlerProcPtr = FakeType("(EventHandlerProcPtr)0") CarbonEventsFunction = OSErrFunctionGenerator CarbonEventsMethod = OSErrMethodGenerator includestuff = """ #include #include "macglue.h" #define USE_MAC_MP_MULTITHREADING 1 #if USE_MAC_MP_MULTITHREADING static PyThreadState *_save; static MPCriticalRegionID reentrantLock; #endif /* USE_MAC_MP_MULTITHREADING */ extern int CFStringRef_New(CFStringRef *); extern int CFStringRef_Convert(PyObject *, CFStringRef *); extern int CFBundleRef_Convert(PyObject *, CFBundleRef *); int EventTargetRef_Convert(PyObject *, EventTargetRef *); PyObject *EventHandlerCallRef_New(EventHandlerCallRef itself); PyObject *EventRef_New(EventRef itself); /********** EventTypeSpec *******/ static PyObject* EventTypeSpec_New(EventTypeSpec *in) { return Py_BuildValue("ll", in->eventClass, in->eventKind); } static int EventTypeSpec_Convert(PyObject *v, EventTypeSpec *out) { if (PyArg_ParseTuple(v, "ll", &(out->eventClass), &(out->eventKind))) return 1; return NULL; } /********** end EventTypeSpec *******/ /********** HIPoint *******/ static PyObject* HIPoint_New(HIPoint *in) { return Py_BuildValue("ff", in->x, in->y); } static int HIPoint_Convert(PyObject *v, HIPoint *out) { if (PyArg_ParseTuple(v, "ff", &(out->x), &(out->y))) return 1; return NULL; } /********** end HIPoint *******/ /********** EventHotKeyID *******/ static PyObject* EventHotKeyID_New(EventHotKeyID *in) { return Py_BuildValue("ll", in->signature, in->id); } static int EventHotKeyID_Convert(PyObject *v, EventHotKeyID *out) { if (PyArg_ParseTuple(v, "ll", &out->signature, &out->id)) return 1; return NULL; } /********** end EventHotKeyID *******/ /******** handlecommand ***********/ pascal OSStatus CarbonEvents_HandleCommand(EventHandlerCallRef handlerRef, Even tRef event, void *outPyObject) { PyObject *retValue; int status; #if USE_MAC_MP_MULTITHREADING MPEnterCriticalRegion(reentrantLock, kDurationForever); PyEval_RestoreThread(_save); #endif /* USE_MAC_MP_MULTITHREADING */ retValue = PyObject_CallFunction((PyObject *)outPyObject, "O&O&", EventHand lerCallRef_New, handlerRef, EventRef_New, event); status = PyInt_AsLong(retValue); #if USE_MAC_MP_MULTITHREADING _save = PyEval_SaveThread(); MPExitCriticalRegion(reentrantLock); #endif /* USE_MAC_MP_MULTITHREADING */ return status; } /******** end handlecommand ***********/ """ module = MacModule('CarbonEvents', 'CarbonEvents', includestuff, finalstuff, in itstuff) #class CFReleaserObj(GlobalObjectDefinition): # def outputFreeIt(self, name): # Output("CFRelease(%s);" % name) for typ in RefObjectTypes: execstr = typ + 'object = GlobalObjectDefinition(typ)' exec execstr module.addobject(eval(typ + 'object')) functions = [] for typ in RefObjectTypes: ## go thru all ObjectTypes as defined in CarbonEvent sscan.py # initialize the lists for carbongen to fill execstr = typ + 'methods = []' exec execstr execfile('CarbonEventsgen.py') for f in functions: module.add(f) # add all the functions carboneventsgen put in the list for typ in RefObjectTypes: ## go thru all ObjectT ypes as defined in CarbonEventsscan.py methods = eval(typ + 'methods') ## get a reference to the method list from the main namespace obj = eval(typ + 'object') ## get a reference to the obj ect for m in methods: obj.add(m) ## add each method in the list to the o bject installeventhandler = """ EventTypeSpec inSpec; PyObject *callback; EventHandlerRef outRef; OSStatus _err; EventHandlerUPP event; if (!PyArg_ParseTuple(_args, "O&O", EventTypeSpec_Convert, &inSpec, &callback)) return NULL; event = NewEventHandlerUPP(CarbonEvents_HandleCommand); _err = InstallEventHandler(_self->ob_itself, event, 1, &inSpec, (void *)callbac k, &outRef); if (_err != noErr) return PyMac_Error(_err); return Py_BuildValue("l", outRef); """ f = ManualGenerator("InstallEventHandler", installeventhandler); f.docstring = lambda: "(EventTargetRef inTarget, EventTypeSpec inSpec, Method c allback) -> (EventHandlerRef outRef)" EventTargetRefobject.add(f) runappeventloop = """ #if USE_MAC_MP_MULTITHREADING if (MPCreateCriticalRegion(&reentrantLock) != noErr) { printf("lock failure\n"); return NULL; } _save = PyEval_SaveThread(); #endif /* USE_MAC_MP_MULTITHREADING */ RunApplicationEventLoop(); #if USE_MAC_MP_MULTITHREADING PyEval_RestoreThread(_save); MPDeleteCriticalRegion(reentrantLock); #endif /* USE_MAC_MP_MULTITHREADING */ Py_INCREF(Py_None); return Py_None; """ f = ManualGenerator("RunApplicationEventLoop", runappeventloop); f.docstring = lambda: "() -> ()" module.add(f) SetOutputFileName('_CarbonEvents.c') module.generate() import os os.system("python setup.py build") From jackjansen@users.sourceforge.net Mon Nov 5 16:14:28 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 08:14:28 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCore.exp,1.19,1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv17824/python/Mac/Build Modified Files: PythonCore.exp Log Message: Regenerated with CF accessors. Index: PythonCore.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.exp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** PythonCore.exp 2001/10/31 11:41:16 1.19 --- PythonCore.exp 2001/11/05 16:14:25 1.20 *************** *** 243,246 **** --- 243,248 ---- PyObject_IsSubclass PyObject_IsInstance + PyObject_CallFunctionObjArgs + PyObject_CallMethodObjArgs PyObject_CallMethod PyObject_CallFunction *************** *** 960,963 **** --- 962,999 ---- PyMacGluePtr_WinObj_Convert PyMacGluePtr_WinObj_WhichWindow + PyMacGluePtr_CFTypeRefObj_Convert + PyMacGluePtr_CFTypeRefObj_New + PyMacGluePtr_CFStringRefObj_Convert + PyMacGluePtr_CFStringRefObj_New + PyMacGluePtr_CFMutableStringRefObj_Convert + PyMacGluePtr_CFMutableStringRefObj_New + PyMacGluePtr_CFArrayRefObj_Convert + PyMacGluePtr_CFArrayRefObj_New + PyMacGluePtr_CFMutableArrayRefObj_Convert + PyMacGluePtr_CFMutableArrayRefObj_New + PyMacGluePtr_CFDictionaryRefObj_Convert + PyMacGluePtr_CFDictionaryRefObj_New + PyMacGluePtr_CFMutableDictionaryRefObj_Convert + PyMacGluePtr_CFMutableDictionaryRefObj_New + PyMacGluePtr_CFURLRefObj_Convert + PyMacGluePtr_OptionalCFURLRefObj_Convert + PyMacGluePtr_CFURLRefObj_New + CFURLRefObj_New + OptionalCFURLRefObj_Convert + CFURLRefObj_Convert + CFMutableDictionaryRefObj_New + CFMutableDictionaryRefObj_Convert + CFDictionaryRefObj_New + CFDictionaryRefObj_Convert + CFMutableArrayRefObj_New + CFMutableArrayRefObj_Convert + CFArrayRefObj_New + CFArrayRefObj_Convert + CFMutableStringRefObj_New + CFMutableStringRefObj_Convert + CFStringRefObj_New + CFStringRefObj_Convert + CFTypeRefObj_New + CFTypeRefObj_Convert WinObj_WhichWindow WinObj_Convert From jackjansen@users.sourceforge.net Mon Nov 5 16:14:35 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 08:14:35 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCoreCarbon.exp,1.19,1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv17920/python/Mac/Build Modified Files: PythonCoreCarbon.exp Log Message: Regenerated with CF accessors. Index: PythonCoreCarbon.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCoreCarbon.exp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** PythonCoreCarbon.exp 2001/10/31 11:41:25 1.19 --- PythonCoreCarbon.exp 2001/11/05 16:14:33 1.20 *************** *** 243,246 **** --- 243,248 ---- PyObject_IsSubclass PyObject_IsInstance + PyObject_CallFunctionObjArgs + PyObject_CallMethodObjArgs PyObject_CallMethod PyObject_CallFunction *************** *** 954,957 **** --- 956,993 ---- PyMacGluePtr_WinObj_Convert PyMacGluePtr_WinObj_WhichWindow + PyMacGluePtr_CFTypeRefObj_Convert + PyMacGluePtr_CFTypeRefObj_New + PyMacGluePtr_CFStringRefObj_Convert + PyMacGluePtr_CFStringRefObj_New + PyMacGluePtr_CFMutableStringRefObj_Convert + PyMacGluePtr_CFMutableStringRefObj_New + PyMacGluePtr_CFArrayRefObj_Convert + PyMacGluePtr_CFArrayRefObj_New + PyMacGluePtr_CFMutableArrayRefObj_Convert + PyMacGluePtr_CFMutableArrayRefObj_New + PyMacGluePtr_CFDictionaryRefObj_Convert + PyMacGluePtr_CFDictionaryRefObj_New + PyMacGluePtr_CFMutableDictionaryRefObj_Convert + PyMacGluePtr_CFMutableDictionaryRefObj_New + PyMacGluePtr_CFURLRefObj_Convert + PyMacGluePtr_OptionalCFURLRefObj_Convert + PyMacGluePtr_CFURLRefObj_New + CFURLRefObj_New + OptionalCFURLRefObj_Convert + CFURLRefObj_Convert + CFMutableDictionaryRefObj_New + CFMutableDictionaryRefObj_Convert + CFDictionaryRefObj_New + CFDictionaryRefObj_Convert + CFMutableArrayRefObj_New + CFMutableArrayRefObj_Convert + CFArrayRefObj_New + CFArrayRefObj_Convert + CFMutableStringRefObj_New + CFMutableStringRefObj_Convert + CFStringRefObj_New + CFStringRefObj_Convert + CFTypeRefObj_New + CFTypeRefObj_Convert WinObj_WhichWindow WinObj_Convert From jackjansen@users.sourceforge.net Mon Nov 5 16:15:42 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 08:15:42 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/carbonevt CarbonEvtscan.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/carbonevt In directory usw-pr-cvs1:/tmp/cvs-serv18324/python/Mac/Modules/carbonevt Modified Files: CarbonEvtscan.py Log Message: Fixed broken newlines and changed module name. Still untested. Index: CarbonEvtscan.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/carbonevt/CarbonEvtscan.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CarbonEvtscan.py 2001/11/05 14:44:18 1.1 --- CarbonEvtscan.py 2001/11/05 16:15:40 1.2 *************** *** 5,10 **** import string import MacOS ! BGENDIR= '/Users/dsp/Documents/python/dist/src/Tools/bgen/bgen' sys.path.append(BGENDIR) --- 5,11 ---- import string import MacOS + import sys ! BGENDIR= os.path.join(sys.prefix, ':Tools:bgen:bgen:') sys.path.append(BGENDIR) *************** *** 22,26 **** scanner.close() print "--done scanning, importing--" ! import CarbonEventssupport print "done" --- 23,27 ---- scanner.close() print "--done scanning, importing--" ! import CarbonEvtsupport print "done" *************** *** 88,91 **** --- 89,96 ---- # "EventHandlerProcPtr", # ] + + def makerepairinstructions(self): + return [] + if __name__ == "__main__": main() From jackjansen@users.sourceforge.net Mon Nov 5 16:15:47 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 08:15:47 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/carbonevt CarbonEvtsupport.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/carbonevt In directory usw-pr-cvs1:/tmp/cvs-serv18358/python/Mac/Modules/carbonevt Modified Files: CarbonEvtsupport.py Log Message: Fixed broken newlines and changed module name. Still untested. Index: CarbonEvtsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/carbonevt/CarbonEvtsupport.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** CarbonEvtsupport.py 2001/11/05 14:44:23 1.1 --- CarbonEvtsupport.py 2001/11/05 16:15:45 1.2 *************** *** 127,132 **** /******** handlecommand ***********/ ! pascal OSStatus CarbonEvents_HandleCommand(EventHandlerCallRef handlerRef, Even ! tRef event, void *outPyObject) { PyObject *retValue; int status; --- 127,131 ---- /******** handlecommand ***********/ ! pascal OSStatus CarbonEvents_HandleCommand(EventHandlerCallRef handlerRef, EventRef event, void *outPyObject) { PyObject *retValue; int status; *************** *** 137,142 **** #endif /* USE_MAC_MP_MULTITHREADING */ ! retValue = PyObject_CallFunction((PyObject *)outPyObject, "O&O&", EventHand ! lerCallRef_New, handlerRef, EventRef_New, event); status = PyInt_AsLong(retValue); --- 136,140 ---- #endif /* USE_MAC_MP_MULTITHREADING */ ! retValue = PyObject_CallFunction((PyObject *)outPyObject, "O&O&", EventHandlerCallRef_New, handlerRef, EventRef_New, event); status = PyInt_AsLong(retValue); *************** *** 153,158 **** """ ! module = MacModule('CarbonEvents', 'CarbonEvents', includestuff, finalstuff, in ! itstuff) #class CFReleaserObj(GlobalObjectDefinition): --- 151,155 ---- """ ! module = MacModule('CarbonEvents', 'CarbonEvents', includestuff, finalstuff, initstuff) #class CFReleaserObj(GlobalObjectDefinition): *************** *** 166,171 **** functions = [] ! for typ in RefObjectTypes: ## go thru all ObjectTypes as defined in CarbonEvent ! sscan.py # initialize the lists for carbongen to fill execstr = typ + 'methods = []' --- 163,167 ---- functions = [] ! for typ in RefObjectTypes: ## go thru all ObjectTypes as defined in CarbonEventsscan.py # initialize the lists for carbongen to fill execstr = typ + 'methods = []' *************** *** 174,188 **** execfile('CarbonEventsgen.py') ! for f in functions: module.add(f) # add all the functions carboneventsgen ! put in the list ! for typ in RefObjectTypes: ## go thru all ObjectT ! ypes as defined in CarbonEventsscan.py methods = eval(typ + 'methods') ## get a reference to the method list from the main namespace ! obj = eval(typ + 'object') ## get a reference to the obj ! ect ! for m in methods: obj.add(m) ## add each method in the list to the o ! bject installeventhandler = """ --- 170,180 ---- execfile('CarbonEventsgen.py') ! for f in functions: module.add(f) # add all the functions carboneventsgen put in the list ! for typ in RefObjectTypes: ## go thru all ObjectTypes as defined in CarbonEventsscan.py methods = eval(typ + 'methods') ## get a reference to the method list from the main namespace ! obj = eval(typ + 'object') ## get a reference to the object ! for m in methods: obj.add(m) ## add each method in the list to the object installeventhandler = """ *************** *** 197,202 **** event = NewEventHandlerUPP(CarbonEvents_HandleCommand); ! _err = InstallEventHandler(_self->ob_itself, event, 1, &inSpec, (void *)callbac ! k, &outRef); if (_err != noErr) return PyMac_Error(_err); --- 189,193 ---- event = NewEventHandlerUPP(CarbonEvents_HandleCommand); ! _err = InstallEventHandler(_self->ob_itself, event, 1, &inSpec, (void *)callback, &outRef); if (_err != noErr) return PyMac_Error(_err); *************** *** 205,210 **** f = ManualGenerator("InstallEventHandler", installeventhandler); ! f.docstring = lambda: "(EventTargetRef inTarget, EventTypeSpec inSpec, Method c ! allback) -> (EventHandlerRef outRef)" EventTargetRefobject.add(f) --- 196,200 ---- f = ManualGenerator("InstallEventHandler", installeventhandler); ! f.docstring = lambda: "(EventTargetRef inTarget, EventTypeSpec inSpec, Method callback) -> (EventHandlerRef outRef)" EventTargetRefobject.add(f) *************** *** 235,239 **** module.add(f) ! SetOutputFileName('_CarbonEvents.c') module.generate() --- 225,229 ---- module.add(f) ! SetOutputFileName('_CarbonEvt.c') module.generate() From jackjansen@users.sourceforge.net Mon Nov 5 16:16:17 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 08:16:17 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/win winsupport.py,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/win In directory usw-pr-cvs1:/tmp/cvs-serv18566/python/Mac/Modules/win Modified Files: winsupport.py Log Message: First tweaks to allow MacPython to be compiled with Universal Headers 3.4 Index: winsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/win/winsupport.py,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** winsupport.py 2001/09/05 10:31:18 1.27 --- winsupport.py 2001/11/05 16:16:15 1.28 *************** *** 71,79 **** #endif ! #if !ACCESSOR_CALLS_ARE_FUNCTIONS /* Carbon calls that we emulate in classic mode */ #define GetWindowSpareFlag(win) (((CWindowPeek)(win))->spareFlag) #define GetWindowFromPort(port) ((WindowRef)(port)) #define GetWindowPortBounds(win, rectp) (*(rectp) = ((CWindowPeek)(win))->port.portRect) #define IsPointerValid(p) (((long)p&3) == 0) #endif --- 71,81 ---- #endif ! #if !ACCESSOR_CALLS_ARE_FUNCTIONS && UNIVERSAL_INTERFACES_VERSION < 0x340 /* Carbon calls that we emulate in classic mode */ #define GetWindowSpareFlag(win) (((CWindowPeek)(win))->spareFlag) #define GetWindowFromPort(port) ((WindowRef)(port)) #define GetWindowPortBounds(win, rectp) (*(rectp) = ((CWindowPeek)(win))->port.portRect) + #endif + #if !ACCESSOR_CALLS_ARE_FUNCTIONS #define IsPointerValid(p) (((long)p&3) == 0) #endif From jackjansen@users.sourceforge.net Mon Nov 5 16:16:25 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 08:16:25 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/win _Winmodule.c,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/win In directory usw-pr-cvs1:/tmp/cvs-serv18621/python/Mac/Modules/win Modified Files: _Winmodule.c Log Message: First tweaks to allow MacPython to be compiled with Universal Headers 3.4 Index: _Winmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/win/_Winmodule.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** _Winmodule.c 2001/09/05 10:29:15 1.3 --- _Winmodule.c 2001/11/05 16:16:22 1.4 *************** *** 37,45 **** #endif ! #if !ACCESSOR_CALLS_ARE_FUNCTIONS /* Carbon calls that we emulate in classic mode */ #define GetWindowSpareFlag(win) (((CWindowPeek)(win))->spareFlag) #define GetWindowFromPort(port) ((WindowRef)(port)) #define GetWindowPortBounds(win, rectp) (*(rectp) = ((CWindowPeek)(win))->port.portRect) #define IsPointerValid(p) (((long)p&3) == 0) #endif --- 37,47 ---- #endif ! #if !ACCESSOR_CALLS_ARE_FUNCTIONS && UNIVERSAL_INTERFACES_VERSION < 0x340 /* Carbon calls that we emulate in classic mode */ #define GetWindowSpareFlag(win) (((CWindowPeek)(win))->spareFlag) #define GetWindowFromPort(port) ((WindowRef)(port)) #define GetWindowPortBounds(win, rectp) (*(rectp) = ((CWindowPeek)(win))->port.portRect) + #endif + #if !ACCESSOR_CALLS_ARE_FUNCTIONS #define IsPointerValid(p) (((long)p&3) == 0) #endif From jackjansen@users.sourceforge.net Mon Nov 5 16:16:29 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 08:16:29 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/dlg dlgscan.py,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/dlg In directory usw-pr-cvs1:/tmp/cvs-serv18671/python/Mac/Modules/dlg Modified Files: dlgscan.py Log Message: First tweaks to allow MacPython to be compiled with Universal Headers 3.4 Index: dlgscan.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/dlg/dlgscan.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** dlgscan.py 2000/12/10 23:43:36 1.13 --- dlgscan.py 2001/11/05 16:16:27 1.14 *************** *** 54,57 **** --- 54,58 ---- 'SetDialogMovableModal', 'GetDialogControlNotificationProc', + 'SetGrafPortOfDialog', # Funny, and probably not useful ] From jackjansen@users.sourceforge.net Mon Nov 5 16:16:41 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 08:16:41 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/dlg dlgsupport.py,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/dlg In directory usw-pr-cvs1:/tmp/cvs-serv18756/python/Mac/Modules/dlg Modified Files: dlgsupport.py Log Message: First tweaks to allow MacPython to be compiled with Universal Headers 3.4 Index: dlgsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/dlg/dlgsupport.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** dlgsupport.py 2001/08/23 13:48:18 1.25 --- dlgsupport.py 2001/11/05 16:16:39 1.26 *************** *** 48,52 **** #endif ! #if !ACCESSOR_CALLS_ARE_FUNCTIONS #define GetDialogTextEditHandle(dlg) (((DialogPeek)(dlg))->textH) #define SetPortDialogPort(dlg) SetPort(dlg) --- 48,52 ---- #endif ! #if !ACCESSOR_CALLS_ARE_FUNCTIONS && UNIVERSAL_INTERFACES_VERSION < 0x340 #define GetDialogTextEditHandle(dlg) (((DialogPeek)(dlg))->textH) #define SetPortDialogPort(dlg) SetPort(dlg) From jackjansen@users.sourceforge.net Mon Nov 5 16:16:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 08:16:36 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/dlg _Dlgmodule.c,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/dlg In directory usw-pr-cvs1:/tmp/cvs-serv18710/python/Mac/Modules/dlg Modified Files: _Dlgmodule.c Log Message: First tweaks to allow MacPython to be compiled with Universal Headers 3.4 Index: _Dlgmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/dlg/_Dlgmodule.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** _Dlgmodule.c 2001/09/05 10:30:32 1.3 --- _Dlgmodule.c 2001/11/05 16:16:34 1.4 *************** *** 37,41 **** #endif ! #if !ACCESSOR_CALLS_ARE_FUNCTIONS #define GetDialogTextEditHandle(dlg) (((DialogPeek)(dlg))->textH) #define SetPortDialogPort(dlg) SetPort(dlg) --- 37,41 ---- #endif ! #if !ACCESSOR_CALLS_ARE_FUNCTIONS && UNIVERSAL_INTERFACES_VERSION < 0x340 #define GetDialogTextEditHandle(dlg) (((DialogPeek)(dlg))->textH) #define SetPortDialogPort(dlg) SetPort(dlg) *************** *** 770,787 **** } - #if !TARGET_API_MAC_CARBON - - static PyObject *DlgObj_SetGrafPortOfDialog(DialogObject *_self, PyObject *_args) - { - PyObject *_res = NULL; - if (!PyArg_ParseTuple(_args, "")) - return NULL; - SetGrafPortOfDialog(_self->ob_itself); - Py_INCREF(Py_None); - _res = Py_None; - return _res; - } - #endif - static PyMethodDef DlgObj_methods[] = { {"DrawDialog", (PyCFunction)DlgObj_DrawDialog, 1, --- 770,773 ---- *************** *** 866,873 **** "() -> (CGrafPtr _rv)"}, - #if !TARGET_API_MAC_CARBON - {"SetGrafPortOfDialog", (PyCFunction)DlgObj_SetGrafPortOfDialog, 1, - "() -> None"}, - #endif {NULL, NULL, 0} }; --- 852,855 ---- From jackjansen@users.sourceforge.net Mon Nov 5 16:21:42 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 08:21:42 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/carbonevt _CarbonEvt.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/carbonevt In directory usw-pr-cvs1:/tmp/cvs-serv20375/python/Mac/Modules/carbonevt Added Files: _CarbonEvt.c Log Message: Correctly builds the C module now. --- NEW FILE: _CarbonEvt.c --- /* ====================== Module CarbonEvents ======================= */ #include "Python.h" #include #include "macglue.h" #define USE_MAC_MP_MULTITHREADING 1 #if USE_MAC_MP_MULTITHREADING static PyThreadState *_save; static MPCriticalRegionID reentrantLock; #endif /* USE_MAC_MP_MULTITHREADING */ extern int CFStringRef_New(CFStringRef *); [...1557 lines suppressed...] EventHandlerRef_Type.ob_type = &PyType_Type; Py_INCREF(&EventHandlerRef_Type); if (PyDict_SetItemString(d, "EventHandlerRefType", (PyObject *)&EventHandlerRef_Type) != 0) Py_FatalError("can't initialize EventHandlerRefType"); EventHandlerCallRef_Type.ob_type = &PyType_Type; Py_INCREF(&EventHandlerCallRef_Type); if (PyDict_SetItemString(d, "EventHandlerCallRefType", (PyObject *)&EventHandlerCallRef_Type) != 0) Py_FatalError("can't initialize EventHandlerCallRefType"); EventTargetRef_Type.ob_type = &PyType_Type; Py_INCREF(&EventTargetRef_Type); if (PyDict_SetItemString(d, "EventTargetRefType", (PyObject *)&EventTargetRef_Type) != 0) Py_FatalError("can't initialize EventTargetRefType"); EventHotKeyRef_Type.ob_type = &PyType_Type; Py_INCREF(&EventHotKeyRef_Type); if (PyDict_SetItemString(d, "EventHotKeyRefType", (PyObject *)&EventHotKeyRef_Type) != 0) Py_FatalError("can't initialize EventHotKeyRefType"); } /* ==================== End module CarbonEvents ===================== */ From jackjansen@users.sourceforge.net Mon Nov 5 16:21:47 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 05 Nov 2001 08:21:47 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/carbonevt CarbonEvtsupport.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/carbonevt In directory usw-pr-cvs1:/tmp/cvs-serv20425/python/Mac/Modules/carbonevt Modified Files: CarbonEvtsupport.py Log Message: Correctly builds the C module now. Index: CarbonEvtsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/carbonevt/CarbonEvtsupport.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CarbonEvtsupport.py 2001/11/05 16:15:45 1.2 --- CarbonEvtsupport.py 2001/11/05 16:21:45 1.3 *************** *** 3,7 **** from macsupport import * ! from CarbonEventsscan import RefObjectTypes # where should this go? macsupport.py? --- 3,7 ---- from macsupport import * ! from CarbonEvtscan import RefObjectTypes # where should this go? macsupport.py? *************** *** 173,178 **** for typ in RefObjectTypes: ## go thru all ObjectTypes as defined in CarbonEventsscan.py ! methods = eval(typ + 'methods') ## get a reference to the method list ! from the main namespace obj = eval(typ + 'object') ## get a reference to the object for m in methods: obj.add(m) ## add each method in the list to the object --- 173,177 ---- for typ in RefObjectTypes: ## go thru all ObjectTypes as defined in CarbonEventsscan.py ! methods = eval(typ + 'methods') ## get a reference to the method list from the main namespace obj = eval(typ + 'object') ## get a reference to the object for m in methods: obj.add(m) ## add each method in the list to the object *************** *** 228,231 **** module.generate() ! import os ! os.system("python setup.py build") --- 227,230 ---- module.generate() ! ##import os ! ##os.system("python setup.py build") From fdrake@users.sourceforge.net Mon Nov 5 17:40:50 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 05 Nov 2001 09:40:50 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib UserDict.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv11352 Modified Files: UserDict.py Log Message: copy(): Make sure the copy of a derived class cannot share the data of the original by replacing self.data temporarily, then using the update() method on the new mapping object to populate it. This closes SF bug #476616. Index: UserDict.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/UserDict.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** UserDict.py 2001/08/07 17:40:42 1.15 --- UserDict.py 2001/11/05 17:40:48 1.16 *************** *** 20,24 **** return UserDict(self.data) import copy ! return copy.copy(self) def keys(self): return self.data.keys() def items(self): return self.data.items() --- 20,31 ---- return UserDict(self.data) import copy ! data = self.data ! try: ! self.data = {} ! c = copy.copy(self) ! finally: ! self.data = data ! c.update(self) ! return c def keys(self): return self.data.keys() def items(self): return self.data.items() From fdrake@users.sourceforge.net Mon Nov 5 17:41:50 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 05 Nov 2001 09:41:50 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_userdict.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv11572/test Modified Files: test_userdict.py Log Message: Add regression test for SF bug #476616 -- make sure copy of a derived class does not share data with the original. Index: test_userdict.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_userdict.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_userdict.py 2001/08/07 17:50:06 1.4 --- test_userdict.py 2001/11/05 17:41:48 1.5 *************** *** 76,79 **** --- 76,83 ---- verify(m2a == m2) + # SF bug #476616 -- copy() of UserDict subclass shared data + m2['foo'] = 'bar' + verify(m2a != m2) + # Test keys, items, values From bwarsaw@users.sourceforge.net Mon Nov 5 17:50:55 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 05 Nov 2001 09:50:55 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib email.tex,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv13904/Doc/lib Modified Files: email.tex Log Message: Finally fleshed out the examples section with 4 code samples! Some of my own doing, some originally written by Matthew Dixon Cowles. Index: email.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/email.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** email.tex 2001/11/05 01:55:03 1.7 --- email.tex 2001/11/05 17:50:53 1.8 *************** *** 319,321 **** \subsection{Examples} ! Coming soon... --- 319,617 ---- \subsection{Examples} ! Here are a few examples of how to use the \module{email} package to ! read, write, and send simple email messages, as well as more complex ! MIME messages. ! ! First, let's see how to create and send a simple text message: ! ! \begin{verbatim} ! # Import smtplib for the actual sending function ! import smtplib ! ! # Here are the email pacakge modules we'll need ! from email import Encoders ! from email.MIMEText import MIMEText ! ! # Open a plain text file for reading ! fp = open(textfile) ! # Create a text/plain message, using Quoted-Printable encoding for non-ASCII ! # characters. ! msg = MIMEText(fp.read(), _encoder=Encoders.encode_quopri) ! fp.close() ! ! # me == the sender's email address ! # you == the recipient's email address ! msg['Subject'] = 'The contents of \%s' \% textfile ! msg['From'] = me ! msg['To'] = you ! ! # Send the message via our own SMTP server. Use msg.as_string() with ! # unixfrom=0 so as not to confuse SMTP. ! s = smtplib.SMTP() ! s.connect() ! s.sendmail(me, [you], msg.as_string(0)) ! s.close() ! \end{verbatim} ! ! Here's an example of how to send a MIME message containing a bunch of ! family pictures: ! ! \begin{verbatim} ! # Import smtplib for the actual sending function ! import smtplib ! ! # Here are the email pacakge modules we'll need ! from email.MIMEImage import MIMEImage ! from email.MIMEBase import MIMEBase ! ! COMMASPACE = ', ' ! ! # Create the container (outer) email message. ! # me == the sender's email address ! # family = the list of all recipients' email addresses ! msg = MIMEBase('multipart', 'mixed') ! msg['Subject'] = 'Our family reunion' ! msg['From'] = me ! msg['To'] = COMMASPACE.join(family) ! msg.preamble = 'Our family reunion' ! # Guarantees the message ends in a newline ! msg.epilogue = '' ! ! # Assume we know that the image files are all in PNG format ! for file in pngfiles: ! # Open the files in binary mode. Let the MIMEIMage class automatically ! # guess the specific image type. ! fp = open(file, 'rb') ! img = MIMEImage(fp.read()) ! fp.close() ! msg.attach(img) ! ! # Send the email via our own SMTP server. ! s = smtplib.SMTP() ! s.connect() ! s.sendmail(me, family, msg.as_string(unixfrom=0)) ! s.close() ! \end{verbatim} ! ! Here's an example\footnote{Thanks to Matthew Dixon Cowles for the ! original inspiration and examples.} of how to send the entire contents ! of a directory as an email message: ! ! \begin{verbatim} ! #!/usr/bin/env python ! ! """Send the contents of a directory as a MIME message. ! ! Usage: dirmail [options] from to [to ...]* ! ! Options: ! -h / --help ! Print this message and exit. ! ! -d directory ! --directory=directory ! Mail the contents of the specified directory, otherwise use the ! current directory. Only the regular files in the directory are sent, ! and we don't recurse to subdirectories. ! ! `from' is the email address of the sender of the message. ! ! `to' is the email address of the recipient of the message, and multiple ! recipients may be given. ! ! The email is sent by forwarding to your local SMTP server, which then does the ! normal delivery process. Your local machine must be running an SMTP server. ! """ ! ! import sys ! import os ! import getopt ! import smtplib ! # For guessing MIME type based on file name extension ! import mimetypes ! ! from email import Encoders ! from email.Message import Message ! from email.MIMEAudio import MIMEAudio ! from email.MIMEBase import MIMEBase ! from email.MIMEImage import MIMEImage ! from email.MIMEText import MIMEText ! ! COMMASPACE = ', ' ! ! ! def usage(code, msg=''): ! print >> sys.stderr, __doc__ ! if msg: ! print >> sys.stderr, msg ! sys.exit(code) ! ! ! def main(): ! try: ! opts, args = getopt.getopt(sys.argv[1:], 'hd:', ['help', 'directory=']) ! except getopt.error, msg: ! usage(1, msg) ! ! dir = os.curdir ! for opt, arg in opts: ! if opt in ('-h', '--help'): ! usage(0) ! elif opt in ('-d', '--directory'): ! dir = arg ! ! if len(args) < 2: ! usage(1) ! ! sender = args[0] ! recips = args[1:] ! ! # Create the enclosing (outer) message ! outer = MIMEBase('multipart', 'mixed') ! outer['Subject'] = 'Contents of directory \%s' \% os.path.abspath(dir) ! outer['To'] = sender ! outer['From'] = COMMASPACE.join(recips) ! outer.preamble = 'You will not see this in a MIME-aware mail reader.\n' ! # To guarantee the message ends with a newline ! outer.epilogue = '' ! ! for filename in os.listdir(dir): ! path = os.path.join(dir, filename) ! if not os.path.isfile(path): ! continue ! # Guess the Content-Type: based on the file's extension. Encoding ! # will be ignored, although we should check for simple things like ! # gzip'd or compressed files ! ctype, encoding = mimetypes.guess_type(path) ! if ctype is None or encoding is not None: ! # No guess could be made, or the file is encoded (compressed), so ! # use a generic bag-of-bits type. ! ctype = 'application/octet-stream' ! maintype, subtype = ctype.split('/', 1) ! if maintype == 'text': ! fp = open(path) ! # Note: we should handle calculating the charset ! msg = MIMEText(fp.read(), _subtype=subtype) ! fp.close() ! elif maintype == 'image': ! fp = open(path, 'rb') ! msg = MIMEImage(fp.read(), _subtype=subtype) ! fp.close() ! elif maintype == 'audio': ! fp = open(path, 'rb') ! msg = MIMEAudio(fp.read(), _subtype=subtype) ! fp.close() ! else: ! fp = open(path, 'rb') ! msg = MIMEBase(maintype, subtype) ! msg.add_payload(fp.read()) ! fp.close() ! # Encode the payload using Base64 ! Encoders.encode_base64(msg) ! # Set the filename parameter ! msg.add_header('Content-Disposition', 'attachment', filename=filename) ! outer.attach(msg) ! ! fp = open('/tmp/debug.pck', 'w') ! import cPickle ! cPickle.dump(outer, fp) ! fp.close() ! # Now send the message ! s = smtplib.SMTP() ! s.connect() ! s.sendmail(sender, recips, outer.as_string(0)) ! s.close() ! ! ! if __name__ == '__main__': ! main() ! \end{verbatim} ! ! And finally, here's an example of how to unpack a MIME message like ! the one above, into a directory of files: ! ! \begin{verbatim} ! #!/usr/bin/env python ! ! """Unpack a MIME message into a directory of files. ! ! Usage: unpackmail [options] msgfile ! ! Options: ! -h / --help ! Print this message and exit. ! ! -d directory ! --directory=directory ! Unpack the MIME message into the named directory, which will be ! created if it doesn't already exist. ! ! msgfile is the path to the file containing the MIME message. ! """ ! ! import sys ! import os ! import getopt ! import errno ! import mimetypes ! import email ! ! ! def usage(code, msg=''): ! print >> sys.stderr, __doc__ ! if msg: ! print >> sys.stderr, msg ! sys.exit(code) ! ! ! def main(): ! try: ! opts, args = getopt.getopt(sys.argv[1:], 'hd:', ['help', 'directory=']) ! except getopt.error, msg: ! usage(1, msg) ! ! dir = os.curdir ! for opt, arg in opts: ! if opt in ('-h', '--help'): ! usage(0) ! elif opt in ('-d', '--directory'): ! dir = arg ! ! try: ! msgfile = args[0] ! except IndexError: ! usage(1) ! ! try: ! os.mkdir(dir) ! except OSError, e: ! # Ignore directory exists error ! if e.errno <> errno.EEXIST: raise ! ! fp = open(msgfile) ! msg = email.message_from_file(fp) ! fp.close() ! ! counter = 1 ! for part in msg.walk(): ! # multipart/* are just containers ! if part.get_main_type() == 'multipart': ! continue ! # Applications should really sanitize the given filename so that an ! # email message can't be used to overwrite important files ! filename = part.get_filename() ! if not filename: ! ext = mimetypes.guess_extension(part.get_type()) ! if not ext: ! # Use a generic bag-of-bits extension ! ext = '.bin' ! filename = 'part-\%03d\%s' \% (counter, ext) ! counter += 1 ! fp = open(os.path.join(dir, filename), 'wb') ! fp.write(part.get_payload(decode=1)) ! fp.close() ! ! ! if __name__ == '__main__': ! main() ! \end{verbatim} From bwarsaw@users.sourceforge.net Mon Nov 5 19:19:57 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 05 Nov 2001 11:19:57 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/email Message.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv5878 Modified Files: Message.py Log Message: walk(): Fix docstring; traversal is depth-first. Closes mimelib bug #477864. Index: Message.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Message.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Message.py 2001/10/25 22:43:45 1.6 --- Message.py 2001/11/05 19:19:55 1.7 *************** *** 424,428 **** """Walk over the message tree, yielding each subpart. ! The walk is performed in breadth-first order. This method is a generator. """ --- 424,428 ---- """Walk over the message tree, yielding each subpart. ! The walk is performed in depth-first order. This method is a generator. """ From tim_one@users.sourceforge.net Mon Nov 5 20:46:10 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Mon, 05 Nov 2001 12:46:10 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0238.txt,1.18,1.19 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv31121 Modified Files: pep-0238.txt Log Message: Documented 2.2's approach to long true division (this was implemented a long time ago). Spelled out that true division can lose information for ints as well as longs. Added a "Resolved Issues" section, and split one of the Open Issues into three Resolved issues. Index: pep-0238.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0238.txt,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** pep-0238.txt 2001/10/18 18:00:15 1.18 --- pep-0238.txt 2001/11/05 20:46:08 1.19 *************** *** 319,332 **** be the same as classic division. ! Note that for long arguments, true division may lose information; ! this is in the nature of true division (as long as rationals are ! not in the language). Algorithms that consciously use longs ! should consider using //. If and when a rational type is added to Python (see PEP 239[2]), true division for ints and longs should probably return a ! rational. This avoids the problem with true division of longs ! losing information. But until then, for consistency, float is the ! only choice for true division. --- 319,341 ---- be the same as classic division. ! The 2.2 implementation of true division acts as if the float type ! had unbounded range, so that overflow doesn't occur unless the ! magnitude of the mathematical *result* is too large to represent ! as a float. For example, after "x = 1L << 40000", float(x) raises ! OverflowError (note that this is also new in 2.2: previously the ! outcome was platform-dependent, most commonly a float infinity). But ! x/x returns 1.0 without exception, while x/1 raises OverflowError. ! ! Note that for int and long arguments, true division may lose ! information; this is in the nature of true division (as long as ! rationals are not in the language). Algorithms that consciously ! use longs should consider using //, as true division of longs ! retains no more than 53 bits of precision (on most platforms). If and when a rational type is added to Python (see PEP 239[2]), true division for ints and longs should probably return a ! rational. This avoids the problem with true division of ints and ! longs losing information. But until then, for consistency, float is ! the only choice for true division. *************** *** 371,383 **** library packages available in their environment. - - For very large long integers, the definition of true division as - returning a float causes problems, since the range of Python - longs is much larger than that of Python floats. This problem - will disappear if and when rational numbers are supported. In - the interim, maybe the long-to-float conversion could be made to - raise OverflowError if the long is out of range. Tim Peters - will make sure that whenever an in-range float is returned, - decent precision is guaranteed. - - For classes to have to support all three of __div__(), __floordiv__() and __truediv__() seems painful; and what to do --- 380,383 ---- *************** *** 385,388 **** --- 385,419 ---- maybe at least true division should try __truediv__() first and __div__() second. + + + Resolved Issues + + - Issue: For very large long integers, the definition of true + division as returning a float causes problems, since the range of + Python longs is much larger than that of Python floats. This + problem will disappear if and when rational numbers are supported. + + Resolution: For long true division, Python uses an internal + float type with native double precision but unbounded range, so + that OverflowError doesn't occur unless the quotient is too large + to represent as a native double. + + - Issue: In the interim, maybe the long-to-float conversion could be + made to raise OverflowError if the long is out of range. + + Resolution: This has been implemented, but, as above, the + magnitude of the inputs to long true division doesn't matter; only + the magnitude of the quotient matters. + + - Issue: Tim Peters will make sure that whenever an in-range float + is returned, decent precision is guaranteed. + + Resolution: Provided the quotient of long true division is + representable as a float, it suffers no more than 3 rounding + errors: one each for converting the inputs to an internal float + type with native double precision but unbounded range, and + one more for the division. However, note that if the magnitude + of the quotient is too *small* to represent as a native double, + 0.0 is returned without exception ("silent underflow"). From akuchling@users.sourceforge.net Mon Nov 5 21:21:58 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Mon, 05 Nov 2001 13:21:58 -0800 Subject: [Python-checkins] CVS: python/dist/src/Demo/curses life.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/curses In directory usw-pr-cvs1:/tmp/cvs-serv11128 Modified Files: life.py Log Message: Remove obsolete e-mail address Index: life.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/curses/life.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** life.py 2000/12/13 03:50:20 1.1 --- life.py 2001/11/05 21:21:55 1.2 *************** *** 1,5 **** #!/usr/bin/env python # life.py -- A curses-based version of Conway's Game of Life. ! # Contributed by A.M. Kuchling # # An empty board will be displayed, and the following commands are available: --- 1,5 ---- #!/usr/bin/env python # life.py -- A curses-based version of Conway's Game of Life. ! # Contributed by AMK # # An empty board will be displayed, and the following commands are available: From akuchling@users.sourceforge.net Mon Nov 5 21:22:43 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Mon, 05 Nov 2001 13:22:43 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules mmapmodule.c,2.32,2.33 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv11321 Modified Files: mmapmodule.c Log Message: Remove obsolete e-mail address Index: mmapmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/mmapmodule.c,v retrieving revision 2.32 retrieving revision 2.33 diff -C2 -d -r2.32 -r2.33 *** mmapmodule.c 2001/07/16 15:47:36 2.32 --- mmapmodule.c 2001/11/05 21:22:41 2.33 *************** *** 1,5 **** /* / Author: Sam Rushing ! / Hacked for Unix by A.M. Kuchling / $Id$ --- 1,5 ---- /* / Author: Sam Rushing ! / Hacked for Unix by AMK / $Id$ From tim_one@users.sourceforge.net Mon Nov 5 21:25:04 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Mon, 05 Nov 2001 13:25:04 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_ntpath.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv11207/python/Lib/test Modified Files: test_ntpath.py Log Message: SF bug 478425: Change in os.path.join (ntpath.py) ntpath.join('a', '') was producing 'a' instead of 'a\\' as in 2.1. Impossible to guess what was ever *intended*, but since split('a\\') produces ('a', ''), I think it's best if join('a', '') gives 'a\\' back. Index: test_ntpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_ntpath.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** test_ntpath.py 2001/08/30 22:05:26 1.12 --- test_ntpath.py 2001/11/05 21:25:02 1.13 *************** *** 75,78 **** --- 75,86 ---- tester("ntpath.join('c:/', 'd:/a/b')", 'd:/a/b') + tester("ntpath.join('')", '') + tester("ntpath.join('', '', '', '', '')", '') + tester("ntpath.join('a')", 'a') + tester("ntpath.join('', 'a')", 'a') + tester("ntpath.join('', '', '', '', 'a')", 'a') + tester("ntpath.join('a', '')", 'a\\') + tester("ntpath.join('a', '', '', '', '')", 'a\\') + tester("ntpath.normpath('A//////././//.//B')", r'A\B') tester("ntpath.normpath('A/./B')", r'A\B') From tim_one@users.sourceforge.net Mon Nov 5 21:25:04 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Mon, 05 Nov 2001 13:25:04 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib ntpath.py,1.43,1.44 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv11207/python/Lib Modified Files: ntpath.py Log Message: SF bug 478425: Change in os.path.join (ntpath.py) ntpath.join('a', '') was producing 'a' instead of 'a\\' as in 2.1. Impossible to guess what was ever *intended*, but since split('a\\') produces ('a', ''), I think it's best if join('a', '') gives 'a\\' back. Index: ntpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/ntpath.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** ntpath.py 2001/10/10 04:16:20 1.43 --- ntpath.py 2001/11/05 21:25:02 1.44 *************** *** 83,86 **** --- 83,92 ---- else: path += "\\" + b + else: + # path is not empty and does not end with a backslash, + # but b is empty; since, e.g., split('a/') produces + # ('a', ''), it's best if join() adds a backslash in + # this case. + path += '\\' return path From akuchling@users.sourceforge.net Mon Nov 5 21:30:12 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Mon, 05 Nov 2001 13:30:12 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libcrypto.tex,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv13746 Modified Files: libcrypto.tex Log Message: Update URL, and remove e-mail address reference (readers can get it from the Web page) Index: libcrypto.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcrypto.tex,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** libcrypto.tex 2000/09/16 05:02:24 1.18 --- libcrypto.tex 2001/11/05 21:30:10 1.19 *************** *** 10,19 **** Hardcore cypherpunks will probably find the cryptographic modules ! written by Andrew Kuchling of further interest; the package adds built-in modules for DES and IDEA encryption, provides a Python module for reading and decrypting PGP files, and then some. These modules are not distributed with Python but available separately. See the URL ! \url{http://starship.python.net/crew/amk/python/code/crypto.html} or ! send email to \email{amk1@bigfoot.com} for more information. \index{PGP} \index{Pretty Good Privacy} --- 10,19 ---- Hardcore cypherpunks will probably find the cryptographic modules ! written by A.M. Kuchling of further interest; the package adds built-in modules for DES and IDEA encryption, provides a Python module for reading and decrypting PGP files, and then some. These modules are not distributed with Python but available separately. See the URL ! \url{http://www.amk.ca/python/code/crypto.html} ! for more information. \index{PGP} \index{Pretty Good Privacy} From akuchling@users.sourceforge.net Mon Nov 5 21:31:17 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Mon, 05 Nov 2001 13:31:17 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libpyexpat.tex,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv14154 Modified Files: libpyexpat.tex Log Message: Remove obsolete e-mail address Index: libpyexpat.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpyexpat.tex,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** libpyexpat.tex 2001/09/20 20:43:28 1.16 --- libpyexpat.tex 2001/11/05 21:31:15 1.17 *************** *** 14,18 **** \modulesynopsis{An interface to the Expat non-validating XML parser.} \moduleauthor{Paul Prescod}{paul@prescod.net} - \sectionauthor{A.M. Kuchling}{amk1@bigfoot.com} \versionadded{2.0} --- 14,17 ---- *************** *** 535,539 **** \subsection{Expat error constants \label{expat-errors}} - \sectionauthor{A.M. Kuchling}{amk1@bigfoot.com} The following constants are provided in the \code{errors} object of --- 534,537 ---- From akuchling@users.sourceforge.net Mon Nov 5 21:31:35 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Mon, 05 Nov 2001 13:31:35 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libcursespanel.tex,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv14269 Modified Files: libcursespanel.tex Log Message: Update obsolete e-mail address Index: libcursespanel.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcursespanel.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** libcursespanel.tex 2001/03/29 22:22:23 1.2 --- libcursespanel.tex 2001/11/05 21:31:33 1.3 *************** *** 3,7 **** \declaremodule{standard}{curses.panel} ! \sectionauthor{A.M. Kuchling}{amk1@bigfoot.com} \modulesynopsis{A panel stack extension that adds depth to curses windows.} --- 3,7 ---- \declaremodule{standard}{curses.panel} ! \sectionauthor{A.M. Kuchling}{akuchlin@mems-exchange.org} \modulesynopsis{A panel stack extension that adds depth to curses windows.} From tim_one@users.sourceforge.net Mon Nov 5 21:33:06 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Mon, 05 Nov 2001 13:33:06 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_ntpath.py,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv14564/python/Lib/test Modified Files: test_ntpath.py Log Message: A couple more test cases to ensure join() doesn't add an "extra" backslash in the presence of empty-string arguments. Index: test_ntpath.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_ntpath.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** test_ntpath.py 2001/11/05 21:25:02 1.13 --- test_ntpath.py 2001/11/05 21:33:04 1.14 *************** *** 82,85 **** --- 82,87 ---- tester("ntpath.join('a', '')", 'a\\') tester("ntpath.join('a', '', '', '', '')", 'a\\') + tester("ntpath.join('a\\', '')", 'a\\') + tester("ntpath.join('a\\', '', '', '', '')", 'a\\') tester("ntpath.normpath('A//////././//.//B')", r'A\B') From akuchling@users.sourceforge.net Mon Nov 5 21:34:38 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Mon, 05 Nov 2001 13:34:38 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libre.tex,1.70,1.71 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv15382 Modified Files: libre.tex Log Message: Update obsolete e-mail address, and remove myself as a module author Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** libre.tex 2001/11/03 19:35:42 1.70 --- libre.tex 2001/11/05 21:34:36 1.71 *************** *** 2,8 **** Regular expression operations} \declaremodule{standard}{re} - \moduleauthor{Andrew M. Kuchling}{amk1@bigfoot.com} \moduleauthor{Fredrik Lundh}{effbot@telia.com} ! \sectionauthor{Andrew M. Kuchling}{amk1@bigfoot.com} --- 2,7 ---- Regular expression operations} \declaremodule{standard}{re} \moduleauthor{Fredrik Lundh}{effbot@telia.com} ! \sectionauthor{Andrew M. Kuchling}{akuchlin@mems-exchange.org} From jackjansen@users.sourceforge.net Tue Nov 6 11:10:16 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 06 Nov 2001 03:10:16 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules hfsplusmodule.c,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv28821/python/Mac/Modules Added Files: hfsplusmodule.c Log Message: HFS+ API contributed by Nitin Ganatra. This checkin is identical to what he sent me, except for the namechange (fmgr->hfsplus). --- NEW FILE: hfsplusmodule.c --- /* $Log: hfsplusmodule.c,v $ Revision 1.1 2001/11/06 11:10:13 jackjansen HFS+ API contributed by Nitin Ganatra. This checkin is identical to what he sent me, except for the namechange (fmgr->hfsplus). Revision 1.8 2001/10/03 17:29:01 ganatra add parent method to FSRef class Revision 1.7 2001/04/13 20:54:19 ganatra More standard format for MacOSError exceptions Revision 1.6 2001/04/11 04:07:40 ganatra Add permissions constants and log header.. */ #include #include "Python.h" [...1508 lines suppressed...] } //__________________________________________________________________________________________________ static PyObject *obj_to_hfsunistr(PyObject *in, HFSUniStr255 *uni) { PyObject *out; out = PyUnicode_FromObject(in); if (out == NULL) return NULL; BlockMoveData(PyUnicode_AS_UNICODE(out), uni->unicode, PyUnicode_GET_DATA_SIZE(out)); uni->length = PyUnicode_GET_SIZE(out); return out; } From jackjansen@users.sourceforge.net Tue Nov 6 12:06:41 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 06 Nov 2001 04:06:41 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules hfsplusmodule.c,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv21504/python/Mac/Modules Modified Files: hfsplusmodule.c Log Message: First couple of fixes to make it compile with Universal 3.3.2. Index: hfsplusmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/hfsplusmodule.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** hfsplusmodule.c 2001/11/06 11:10:13 1.1 --- hfsplusmodule.c 2001/11/06 12:06:39 1.2 *************** *** 1,6 **** /* $Log$ ! Revision 1.1 2001/11/06 11:10:13 jackjansen ! HFS+ API contributed by Nitin Ganatra. This checkin is identical to what he sent me, except for the namechange (fmgr->hfsplus). Revision 1.8 2001/10/03 17:29:01 ganatra --- 1,6 ---- /* $Log$ ! Revision 1.2 2001/11/06 12:06:39 jackjansen ! First couple of fixes to make it compile with Universal 3.3.2. Revision 1.8 2001/10/03 17:29:01 ganatra *************** *** 16,21 **** - #include #include "Python.h" static PyObject * --- 16,25 ---- #include "Python.h" + #ifdef WITHOUT_FRAMEWORKS + #include + #else + #include + #endif static PyObject * *************** *** 1060,1064 **** Py_BEGIN_ALLOW_THREADS ! err = FSPathMakeRef(path, &ref, NULL); Py_END_ALLOW_THREADS if (err != noErr) --- 1064,1068 ---- Py_BEGIN_ALLOW_THREADS ! err = FSPathMakeRef((UInt8 *)path, &ref, NULL); Py_END_ALLOW_THREADS if (err != noErr) *************** *** 1097,1101 **** Py_BEGIN_ALLOW_THREADS ! err = FSPathMakeRef(path, &ref, &isdir); Py_END_ALLOW_THREADS --- 1101,1105 ---- Py_BEGIN_ALLOW_THREADS ! err = FSPathMakeRef((UInt8 *)path, &ref, &isdir); Py_END_ALLOW_THREADS *************** *** 1129,1133 **** Py_BEGIN_ALLOW_THREADS ! err = FSPathMakeRef(path, &ref, &isdir); Py_END_ALLOW_THREADS --- 1133,1137 ---- Py_BEGIN_ALLOW_THREADS ! err = FSPathMakeRef((UInt8 *)path, &ref, &isdir); Py_END_ALLOW_THREADS *************** *** 1167,1171 **** Py_BEGIN_ALLOW_THREADS ! err = FSPathMakeRef(path, &ref, &isdir); Py_END_ALLOW_THREADS --- 1171,1175 ---- Py_BEGIN_ALLOW_THREADS ! err = FSPathMakeRef((UInt8 *)path, &ref, &isdir); Py_END_ALLOW_THREADS *************** *** 1194,1201 **** //__________________________________________________________________________________________________ ! // Initialization function for the module (*must* be called initfmgr) // DL_EXPORT(void) ! initfmgr(void) { PyObject *m, *d; --- 1198,1205 ---- //__________________________________________________________________________________________________ ! // Initialization function for the module (*must* be called inithfsplus) // DL_EXPORT(void) ! inithfsplus(void) { PyObject *m, *d; *************** *** 1406,1410 **** --- 1410,1416 ---- { UInt32 storage; + #if UNIVERSAL_INTERFACES_VERSION > 0x0332 FSPermissionInfo *permissions; + #endif // Dates *************** *** 1415,1418 **** --- 1421,1425 ---- if (fetch_utcdatetime(bitmap, kFSCatInfoBackupDate, dict, _kFSCatInfoBackupDate, &info->backupDate)) return NULL; + #if UNIVERSAL_INTERFACES_VERSION > 0x0332 // Permissions permissions = (FSPermissionInfo *) info->permissions; *************** *** 1423,1427 **** if (fetch_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoUserAccess, &storage)) return NULL; permissions->userAccess = (UInt8) storage; ! // IDs if (fetch_long(bitmap, kFSCatInfoTextEncoding, dict, _kFSCatInfoTextEncoding, &info->textEncodingHint)) return NULL; --- 1430,1434 ---- if (fetch_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoUserAccess, &storage)) return NULL; permissions->userAccess = (UInt8) storage; ! #endif // IDs if (fetch_long(bitmap, kFSCatInfoTextEncoding, dict, _kFSCatInfoTextEncoding, &info->textEncodingHint)) return NULL; *************** *** 1454,1458 **** --- 1461,1467 ---- PyObject *dict; PyObject *id; + #if UNIVERSAL_INTERFACES_VERSION > 0x0332 FSPermissionInfo *permissions; + #endif char buffer[1024]; *************** *** 1484,1487 **** --- 1493,1497 ---- if (insert_longlong(bitmap, kFSCatInfoRsrcSizes, dict, _kFSCatInfoRsrcPhysical, info->rsrcPhysicalSize)) return NULL; + #if UNIVERSAL_INTERFACES_VERSION > 0x0332 // Permissions permissions = (FSPermissionInfo *) info->permissions; *************** *** 1490,1493 **** --- 1500,1504 ---- if (insert_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoUserAccess, permissions->userAccess)) return NULL; if (insert_long(bitmap, kFSCatInfoPermissions, dict, _kFSCatInfoMode, permissions->mode)) return NULL; + #endif // Dates From jackjansen@users.sourceforge.net Tue Nov 6 12:10:07 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 06 Nov 2001 04:10:07 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macmodule.c,1.47,1.48 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv23696/python/Mac/Modules Modified Files: macmodule.c Log Message: Removed unused variable. Index: macmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macmodule.c,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** macmodule.c 2001/10/23 22:28:23 1.47 --- macmodule.c 2001/11/06 12:10:05 1.48 *************** *** 571,575 **** PyObject *args; { - PyObject *v; struct stat st; char *path; --- 571,574 ---- From jackjansen@users.sourceforge.net Tue Nov 6 12:11:07 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 06 Nov 2001 04:11:07 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Include pyconfig.h,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Include In directory usw-pr-cvs1:/tmp/cvs-serv24275/python/Mac/Include Modified Files: pyconfig.h Log Message: Enabled WITH_LONG_LONG. No reason it was disabled, it has been supported by the Metrowerks compiler for quite some time. Index: pyconfig.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Include/pyconfig.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** pyconfig.h 2001/08/07 15:30:13 1.3 --- pyconfig.h 2001/11/06 12:11:05 1.4 *************** *** 186,190 **** /* Define this if you have the type long long */ ! #undef HAVE_LONG_LONG /* Define if your compiler supports function prototypes */ --- 186,190 ---- /* Define this if you have the type long long */ ! #define HAVE_LONG_LONG /* Define if your compiler supports function prototypes */ *************** *** 342,346 **** /* The number of bytes in a long long. */ ! #undef SIZEOF_LONG_LONG /* The number of bytes in a short. */ --- 342,346 ---- /* The number of bytes in a long long. */ ! #define SIZEOF_LONG_LONG 8 /* The number of bytes in a short. */ From jackjansen@users.sourceforge.net Tue Nov 6 15:55:17 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 06 Nov 2001 07:55:17 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCore.exp,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv23566/python/Mac/Build Modified Files: PythonCore.exp Log Message: Added longlong routines. Index: PythonCore.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.exp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** PythonCore.exp 2001/11/05 16:14:25 1.20 --- PythonCore.exp 2001/11/06 15:55:15 1.21 *************** *** 432,435 **** --- 432,439 ---- PyLong_FromUnicode PyLong_FromString + PyLong_AsUnsignedLongLong + PyLong_AsLongLong + PyLong_FromUnsignedLongLong + PyLong_FromLongLong PyLong_AsVoidPtr PyLong_FromVoidPtr *************** *** 2103,2107 **** __dt__Q23std9bad_allocFv # std::bad_alloc::~bad_alloc() qd - exit __console_exit __stdio_exit --- 2107,2110 ---- From jackjansen@users.sourceforge.net Tue Nov 6 15:55:25 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 06 Nov 2001 07:55:25 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCoreCarbon.exp,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv23661/python/Mac/Build Modified Files: PythonCoreCarbon.exp Log Message: Added longlong routines. Index: PythonCoreCarbon.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCoreCarbon.exp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** PythonCoreCarbon.exp 2001/11/05 16:14:33 1.20 --- PythonCoreCarbon.exp 2001/11/06 15:55:23 1.21 *************** *** 432,435 **** --- 432,439 ---- PyLong_FromUnicode PyLong_FromString + PyLong_AsUnsignedLongLong + PyLong_AsLongLong + PyLong_FromUnsignedLongLong + PyLong_FromLongLong PyLong_AsVoidPtr PyLong_FromVoidPtr From jackjansen@users.sourceforge.net Tue Nov 6 15:56:00 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 06 Nov 2001 07:56:00 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonStandSmall.mcp,1.30,1.31 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv23916/python/Mac/Build Modified Files: PythonStandSmall.mcp Log Message: Added hfsplusapi module. Index: PythonStandSmall.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonStandSmall.mcp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 Binary files /tmp/cvsmu9nZh and /tmp/cvs0s2xDq differ From jackjansen@users.sourceforge.net Tue Nov 6 15:56:43 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 06 Nov 2001 07:56:43 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macconfig.c,1.28,1.29 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv24442/python/Mac/Modules Modified Files: macconfig.c Log Message: Added hfsplusapi module. Index: macconfig.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macconfig.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** macconfig.c 2001/08/27 22:50:41 1.28 --- macconfig.c 2001/11/06 15:56:41 1.29 *************** *** 82,85 **** --- 82,86 ---- extern void init_codecs(); extern void initNav(); + extern void inithfsplus(); #ifdef USE_MACCTB extern void initctb(); *************** *** 248,252 **** --- 249,256 ---- {"_CF", init_CF}, #endif + #if TARGET_API_MAC_CARBON + {"hfsplus", inithfsplus}, #endif + #endif /* USE_TOOLBOX */ #ifdef USE_QT {"_Cm", init_Cm}, From jackjansen@users.sourceforge.net Tue Nov 6 15:56:51 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 06 Nov 2001 07:56:51 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts fullbuild.py,1.75,1.76 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv24520/python/Mac/scripts Modified Files: fullbuild.py Log Message: Added hfsplusapi module. Index: fullbuild.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/fullbuild.py,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** fullbuild.py 2001/10/23 22:23:34 1.75 --- fullbuild.py 2001/11/06 15:56:49 1.76 *************** *** 293,296 **** --- 293,297 ---- (":Mac:Build:zlib.carbon.mcp", "zlib.carbon"), (":Mac:Build:_dummy_tkinter.mcp", "_tkinter.carbon"), + (":Mac:Build:hfsplus.mcp", "hfsplus.carbon"), ## (":Extensions:Imaging:_tkinter.carbon.mcp", "_tkinter.carbon"), (":Mac:Build:ColorPicker.carbon.mcp", "ColorPicker.carbon"), From jackjansen@users.sourceforge.net Tue Nov 6 15:57:00 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 06 Nov 2001 07:57:00 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts genpluginprojects.py,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv24581/python/Mac/scripts Modified Files: genpluginprojects.py Log Message: Added hfsplusapi module. Index: genpluginprojects.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/genpluginprojects.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** genpluginprojects.py 2001/10/23 22:23:44 1.21 --- genpluginprojects.py 2001/11/06 15:56:56 1.22 *************** *** 158,161 **** --- 158,162 ---- # Carbon Only? genpluginproject("carbon", "_CF", outputdir="::Lib:Carbon") + genpluginproject("carbon", "hfsplus") # Other Mac modules From jackjansen@users.sourceforge.net Tue Nov 6 15:57:28 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 06 Nov 2001 07:57:28 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macfsmodule.c,1.47,1.48 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv24824/python/Mac/Modules Modified Files: macfsmodule.c Log Message: Added an error message when using FSRef objects on platforms that don't support them. Index: macfsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macfsmodule.c,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** macfsmodule.c 2001/11/01 14:00:19 1.47 --- macfsmodule.c 2001/11/06 15:57:26 1.48 *************** *** 1132,1135 **** --- 1132,1136 ---- { #if TARGET_API_MAC_OS8 + PyErr_SetString(PyExc_TypeError, "FSRef objects not supported on this platform"); return 0; #else From jackjansen@users.sourceforge.net Tue Nov 6 15:58:02 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 06 Nov 2001 07:58:02 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules hfsplusmodule.c,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv25156/python/Mac/Modules Modified Files: hfsplusmodule.c Log Message: Changed names, added bridge functions to macfs.fsref objects and generally did things to get it working. Index: hfsplusmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/hfsplusmodule.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** hfsplusmodule.c 2001/11/06 12:06:39 1.2 --- hfsplusmodule.c 2001/11/06 15:57:59 1.3 *************** *** 1,20 **** /* ! $Log$ ! Revision 1.2 2001/11/06 12:06:39 jackjansen ! First couple of fixes to make it compile with Universal 3.3.2. ! ! Revision 1.8 2001/10/03 17:29:01 ganatra ! add parent method to FSRef class ! ! Revision 1.7 2001/04/13 20:54:19 ganatra ! More standard format for MacOSError exceptions ! ! Revision 1.6 2001/04/11 04:07:40 ganatra ! Add permissions constants and log header.. ! */ #include "Python.h" #ifdef WITHOUT_FRAMEWORKS #include --- 1,10 ---- /* ! ** Interface to hfs+ API. ! ** Contributed by Nitin Ganatra. */ #include "Python.h" + #include "pymactoolbox.h" #ifdef WITHOUT_FRAMEWORKS #include *************** *** 674,677 **** --- 664,680 ---- //__________________________________________________________________________________________________ + static char fsRefObject_as_fsref__doc__[] = + "as_fsref() -> macfs.fsref\n\n\ + Return a macfs.fsref-style object from an hfsplus.fsref style object"; + + static + PyObject *fsRefObject_as_fsref(fsRefObject *self, PyObject *args) + { + if (!PyArg_ParseTuple(args, "")) + return NULL; + return PyMac_BuildFSRef(&self->ref); + } + + //__________________________________________________________________________________________________ static char fsRefObject_openfork__doc__[] = "openfork([resourcefork [,perms]]) -> forkRef\n\n\ *************** *** 976,979 **** --- 979,983 ---- {"openfork", (PyCFunction)fsRefObject_openfork, METH_VARARGS, fsRefObject_openfork__doc__}, + {"as_fsref", (PyCFunction)fsRefObject_as_fsref, METH_VARARGS, fsRefObject_as_fsref__doc__}, {NULL, NULL} }; *************** *** 1042,1046 **** //____________________________________ MODULE FUNCTIONS ____________________________________________ //__________________________________________________________________________________________________ ! static char fmgrmodule_getcatinfo__doc__[] = "getcatinfo(path[,bitmap]) -> Dict\n\n\ Returns a dictionary of attributes for the given item\n\ --- 1046,1050 ---- //____________________________________ MODULE FUNCTIONS ____________________________________________ //__________________________________________________________________________________________________ ! static char hfsplusmodule_getcatinfo__doc__[] = "getcatinfo(path[,bitmap]) -> Dict\n\n\ Returns a dictionary of attributes for the given item\n\ *************** *** 1050,1056 **** static ! PyObject *fmgrmodule_getcatinfo(PyObject *self, PyObject *args) { - char *path; PyObject *dict; FSRef ref; --- 1054,1059 ---- static ! PyObject *hfsplusmodule_getcatinfo(PyObject *self, PyObject *args) { PyObject *dict; FSRef ref; *************** *** 1060,1077 **** FSCatalogInfoBitmap bitmap = kFSCatInfoGettableInfo; ! if (!PyArg_ParseTuple(args, "s|l", &path, &bitmap)) return NULL; Py_BEGIN_ALLOW_THREADS - err = FSPathMakeRef((UInt8 *)path, &ref, NULL); - Py_END_ALLOW_THREADS - if (err != noErr) - return macos_error_for_call(err, "FSPathMakeRef", path); - - Py_BEGIN_ALLOW_THREADS err = FSGetCatalogInfo(&ref, bitmap, &info, &uni, NULL, NULL); Py_END_ALLOW_THREADS if (err != noErr) ! return macos_error_for_call(err, "FSGetCatalogInfo", path); dict = dict_from_cataloginfo(bitmap, &info, &uni); --- 1063,1074 ---- FSCatalogInfoBitmap bitmap = kFSCatInfoGettableInfo; ! if (!PyArg_ParseTuple(args, "O&|l", PyMac_GetFSRef, &ref, &bitmap)) return NULL; Py_BEGIN_ALLOW_THREADS err = FSGetCatalogInfo(&ref, bitmap, &info, &uni, NULL, NULL); Py_END_ALLOW_THREADS if (err != noErr) ! return macos_error_for_call(err, "FSGetCatalogInfo", NULL); dict = dict_from_cataloginfo(bitmap, &info, &uni); *************** *** 1084,1111 **** //__________________________________________________________________________________________________ ! static char fmgrmodule_opendir__doc__[] = "opendir(path) -> iterator\n\n\ Return an iterator for listdir."; static ! PyObject *fmgrmodule_opendir(PyObject *self, PyObject *args) { - char *path; iteratorObject *rv; FSRef ref; OSErr err; Boolean isdir; ! if (!PyArg_ParseTuple(args, "s", &path)) return NULL; - - Py_BEGIN_ALLOW_THREADS - err = FSPathMakeRef((UInt8 *)path, &ref, &isdir); - Py_END_ALLOW_THREADS ! if (err != noErr) ! return macos_error_for_call(err, "FSPathMakeRef", path); ! else if (isdir == false) return PyErr_Format(PyExc_SyntaxError, "requires a directory"); rv = newIteratorObject(args, &ref); --- 1081,1105 ---- //__________________________________________________________________________________________________ ! static char hfsplusmodule_opendir__doc__[] = "opendir(path) -> iterator\n\n\ Return an iterator for listdir."; static ! PyObject *hfsplusmodule_opendir(PyObject *self, PyObject *args) { iteratorObject *rv; FSRef ref; OSErr err; + #if 0 Boolean isdir; + #endif ! if (!PyArg_ParseTuple(args, "O&", PyMac_GetFSRef, &ref)) return NULL; ! #if 0 ! if (isdir == false) return PyErr_Format(PyExc_SyntaxError, "requires a directory"); + #endif rv = newIteratorObject(args, &ref); *************** *** 1116,1142 **** //__________________________________________________________________________________________________ ! static char fmgrmodule_fsref__doc__[] = "fsref(path) -> FSRef\n\n\ Return an FSRef object."; static ! PyObject *fmgrmodule_fsref(PyObject *self, PyObject *args) { - char *path; fsRefObject *obj; FSRef ref; ! OSErr err; ! Boolean isdir; ! if (!PyArg_ParseTuple(args, "s", &path)) return NULL; - Py_BEGIN_ALLOW_THREADS - err = FSPathMakeRef((UInt8 *)path, &ref, &isdir); - Py_END_ALLOW_THREADS - - if (err != noErr) - return macos_error_for_call(err, "FSPathMakeRef", path); - obj = newFSRefObject(args, &ref, true, isdir); if (obj == NULL) --- 1110,1127 ---- //__________________________________________________________________________________________________ ! static char hfsplusmodule_fsref__doc__[] = "fsref(path) -> FSRef\n\n\ Return an FSRef object."; static ! PyObject *hfsplusmodule_fsref(PyObject *self, PyObject *args) { fsRefObject *obj; FSRef ref; ! Boolean isdir = 0; ! if (!PyArg_ParseTuple(args, "O&", PyMac_GetFSRef, &ref)) return NULL; obj = newFSRefObject(args, &ref, true, isdir); if (obj == NULL) *************** *** 1146,1150 **** //__________________________________________________________________________________________________ ! static char fmgrmodule_openfork__doc__[] = "openfork(path[,resourcefork[,perms]]) -> forkRef\n\n\ Return a forkRef object for reading/writing/etc. Optionally,\n\ --- 1131,1135 ---- //__________________________________________________________________________________________________ ! static char hfsplusmodule_openfork__doc__[] = "openfork(path[,resourcefork[,perms]]) -> forkRef\n\n\ Return a forkRef object for reading/writing/etc. Optionally,\n\ *************** *** 1158,1182 **** static ! PyObject *fmgrmodule_openfork(PyObject *self, PyObject *args) { - char *path; forkRefObject *rv; FSRef ref; ! OSErr err; Boolean isdir; int resfork = 0, perms = fsRdPerm; ! if (!PyArg_ParseTuple(args, "s|ii", &path, &resfork, &perms)) return NULL; - - Py_BEGIN_ALLOW_THREADS - err = FSPathMakeRef((UInt8 *)path, &ref, &isdir); - Py_END_ALLOW_THREADS ! if (err != noErr) { ! return macos_error_for_call(err, "FSPathMakeRef", path); ! } else if (isdir == true) { return PyErr_Format(PyExc_SyntaxError, "requires a file"); } rv = newForkRefObject(args, &ref, resfork, perms); --- 1143,1163 ---- static ! PyObject *hfsplusmodule_openfork(PyObject *self, PyObject *args) { forkRefObject *rv; FSRef ref; ! #if 0 Boolean isdir; + #endif int resfork = 0, perms = fsRdPerm; ! if (!PyArg_ParseTuple(args, "s|ii", PyMac_GetFSRef, &ref, &resfork, &perms)) return NULL; ! #if 0 ! if (isdir == true) { return PyErr_Format(PyExc_SyntaxError, "requires a file"); } + #endif rv = newForkRefObject(args, &ref, resfork, perms); *************** *** 1189,1197 **** // List of functions defined in the module // ! static PyMethodDef fmgrmodule_methods[] = { ! {"getcatinfo", fmgrmodule_getcatinfo, METH_VARARGS, fmgrmodule_getcatinfo__doc__}, ! {"opendir", fmgrmodule_opendir, METH_VARARGS, fmgrmodule_opendir__doc__}, ! {"openfork", fmgrmodule_openfork, METH_VARARGS, fmgrmodule_openfork__doc__}, ! {"fsref", fmgrmodule_fsref, METH_VARARGS, fmgrmodule_fsref__doc__}, {NULL, NULL} }; --- 1170,1178 ---- // List of functions defined in the module // ! static PyMethodDef hfsplusmodule_methods[] = { ! {"getcatinfo", hfsplusmodule_getcatinfo, METH_VARARGS, hfsplusmodule_getcatinfo__doc__}, ! {"opendir", hfsplusmodule_opendir, METH_VARARGS, hfsplusmodule_opendir__doc__}, ! {"openfork", hfsplusmodule_openfork, METH_VARARGS, hfsplusmodule_openfork__doc__}, ! {"fsref", hfsplusmodule_fsref, METH_VARARGS, hfsplusmodule_fsref__doc__}, {NULL, NULL} }; *************** *** 1212,1216 **** /* Create the module and add the functions */ ! m = Py_InitModule("fmgr", fmgrmodule_methods); /* Add some symbolic constants to the module */ --- 1193,1197 ---- /* Create the module and add the functions */ ! m = Py_InitModule("hfsplus", hfsplusmodule_methods); /* Add some symbolic constants to the module */ *************** *** 1226,1230 **** insert_int(d, "fsFromMark", fsFromMark); insert_int(d, "noCacheMask", noCacheMask); ! ErrorObject = PyErr_NewException("fmgr.error", NULL, NULL); PyDict_SetItemString(d, "error", ErrorObject); } --- 1207,1211 ---- insert_int(d, "fsFromMark", fsFromMark); insert_int(d, "noCacheMask", noCacheMask); ! ErrorObject = PyErr_NewException("hfsplus.error", NULL, NULL); PyDict_SetItemString(d, "error", ErrorObject); } From fdrake@users.sourceforge.net Tue Nov 6 16:36:55 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 06 Nov 2001 08:36:55 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib weakref.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv14499 Modified Files: weakref.py Log Message: WeakKeyDictionary.has_key(): If the key being tested is not weakly referencable (weakref.ref() raises TypeError), return 0 instead of propogating the TypeError. This closes SF bug #478536; bugfix candidate. Index: weakref.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/weakref.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** weakref.py 2001/10/05 21:54:09 1.14 --- weakref.py 2001/11/06 16:36:53 1.15 *************** *** 180,184 **** def has_key(self, key): ! return self.data.has_key(ref(key)) def items(self): --- 180,188 ---- def has_key(self, key): ! try: ! wr = ref(key) ! except TypeError: ! return 0 ! return self.data.has_key(wr) def items(self): From fdrake@users.sourceforge.net Tue Nov 6 16:38:36 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 06 Nov 2001 08:38:36 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_weakref.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv15487/test Modified Files: test_weakref.py Log Message: Add a regression test for SF bug #478536: If a value cannot be weakly referenced, WeakKeyDictionary.has_key() should return 0 instead of raising TypeError. Index: test_weakref.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_weakref.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** test_weakref.py 2001/10/18 19:28:29 1.14 --- test_weakref.py 2001/11/06 16:38:34 1.15 *************** *** 273,277 **** # # This exercises d.copy(), d.items(), d[] = v, d[], del d[], ! # len(d). # dict, objects = self.make_weak_keyed_dict() --- 273,277 ---- # # This exercises d.copy(), d.items(), d[] = v, d[], del d[], ! # len(d), d.has_key(). # dict, objects = self.make_weak_keyed_dict() *************** *** 295,298 **** --- 295,302 ---- self.assert_(len(dict) == 0, "deleting the keys did not clear the dictionary") + o = Object(42) + dict[o] = "What is the meaning of the universe?" + self.assert_(dict.has_key(o)) + self.assert_(not dict.has_key(34)) def test_weak_keyed_iters(self): From fdrake@users.sourceforge.net Tue Nov 6 22:10:50 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 06 Nov 2001 14:10:50 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libxmllib.tex,1.32,1.33 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv16213/lib Modified Files: libxmllib.tex Log Message: Remove extra period. Index: libxmllib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libxmllib.tex,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** libxmllib.tex 2001/07/14 02:50:55 1.32 --- libxmllib.tex 2001/11/06 22:10:47 1.33 *************** *** 14,18 **** package includes full support for XML 1.0.} ! \versionchanged[Added namespace support.]{1.5.2} This module defines a class \class{XMLParser} which serves as the basis --- 14,18 ---- package includes full support for XML 1.0.} ! \versionchanged[Added namespace support]{1.5.2} This module defines a class \class{XMLParser} which serves as the basis From fdrake@users.sourceforge.net Tue Nov 6 22:13:21 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 06 Nov 2001 14:13:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib xmlsaxhandler.tex,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv17659/lib Modified Files: xmlsaxhandler.tex Log Message: A variety of small cleanups, including one to avoid a margin overrun in the PDF version. Index: xmlsaxhandler.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/xmlsaxhandler.tex,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** xmlsaxhandler.tex 2001/10/20 04:24:09 1.5 --- xmlsaxhandler.tex 2001/11/06 22:13:19 1.6 *************** *** 18,47 **** methods get default implementations. ! \begin{classdesc}{ContentHandler}{} This is the main callback interface in SAX, and the one most important to applications. The order of events in this interface mirrors the order of the information in the document. ! \end{classdesc} ! \begin{classdesc}{DTDHandler}{} Handle DTD events. This interface specifies only those DTD events required for basic parsing (unparsed entities and attributes). ! \end{classdesc} ! \begin{classdesc}{EntityResolver}{} Basic interface for resolving entities. If you create an object implementing this interface, then register the object with your Parser, the parser will call the method in your object to resolve all external entities. ! \end{classdesc} ! \begin{classdesc}{ErrorHandler}{} Interface used by the parser to present error and warning messages to the application. The methods of this object control whether errors are immediately converted to exceptions or are handled in some other way. ! \end{classdesc} In addition to these classes, \module{xml.sax.handler} provides --- 18,47 ---- methods get default implementations. ! \begin{classdesc*}{ContentHandler} This is the main callback interface in SAX, and the one most important to applications. The order of events in this interface mirrors the order of the information in the document. ! \end{classdesc*} ! \begin{classdesc*}{DTDHandler} Handle DTD events. This interface specifies only those DTD events required for basic parsing (unparsed entities and attributes). ! \end{classdesc*} ! \begin{classdesc*}{EntityResolver} Basic interface for resolving entities. If you create an object implementing this interface, then register the object with your Parser, the parser will call the method in your object to resolve all external entities. ! \end{classdesc*} ! \begin{classdesc*}{ErrorHandler} Interface used by the parser to present error and warning messages to the application. The methods of this object control whether errors are immediately converted to exceptions or are handled in some other way. ! \end{classdesc*} In addition to these classes, \module{xml.sax.handler} provides *************** *** 53,57 **** false: Optionally do not perform Namespace processing (implies namespace-prefixes).\\ ! access: (parsing) read-only; (not parsing) read/write\\ \end{datadesc} --- 53,57 ---- false: Optionally do not perform Namespace processing (implies namespace-prefixes).\\ ! access: (parsing) read-only; (not parsing) read/write \end{datadesc} *************** *** 188,193 **** Namespace processing: the SAX XML reader will automatically replace prefixes for element and attribute names when the ! \code{http://xml.org/sax/features/namespaces} feature is true (the ! default). %% XXX This is not really the default, is it? MvL --- 188,192 ---- Namespace processing: the SAX XML reader will automatically replace prefixes for element and attribute names when the ! \code{feature_namespaces} feature is enabled (the default). %% XXX This is not really the default, is it? MvL *************** *** 241,246 **** Parsers may set the \var{qname} parameter to \code{None}, unless the ! \code{http://xml.org/sax/features/namespace-prefixes} feature is ! activated. \end{methoddesc} --- 240,244 ---- Parsers may set the \var{qname} parameter to \code{None}, unless the ! \code{feature_namespace_prefixes} feature is activated. \end{methoddesc} *************** *** 249,253 **** The \var{name} parameter contains the name of the element type, just ! as with the startElementNS event, likewise the \var{qname} parameter. \end{methoddesc} --- 247,252 ---- The \var{name} parameter contains the name of the element type, just ! as with the \method{startElementNS()} method, likewise the ! \var{qname} parameter. \end{methoddesc} *************** *** 308,314 **** declared in an external DTD subset). All processors may skip external entities, depending on the values of the ! \code{http://xml.org/sax/features/external-general-entities} and the ! \code{http://xml.org/sax/features/external-parameter-entities} ! properties. \end{methoddesc} --- 307,312 ---- declared in an external DTD subset). All processors may skip external entities, depending on the values of the ! \code{feature_external_ges} and the ! \code{feature_external_pes} properties. \end{methoddesc} From fdrake@users.sourceforge.net Tue Nov 6 22:14:43 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 06 Nov 2001 14:14:43 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libcalendar.tex,1.11,1.12 librobotparser.tex,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv18454/lib Modified Files: libcalendar.tex librobotparser.tex Log Message: Adjust the module synopsis to avoid margin overruns in the PDF format. Index: libcalendar.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcalendar.tex,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** libcalendar.tex 2001/08/22 12:43:38 1.11 --- libcalendar.tex 2001/11/06 22:14:34 1.12 *************** *** 3,7 **** \declaremodule{standard}{calendar} ! \modulesynopsis{General functions for working with the calendar, including some emulation of the \UNIX\ \program{cal} program.} --- 3,7 ---- \declaremodule{standard}{calendar} ! \modulesynopsis{Functions for working with calendars, including some emulation of the \UNIX\ \program{cal} program.} Index: librobotparser.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/librobotparser.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** librobotparser.tex 2001/07/14 02:50:55 1.3 --- librobotparser.tex 2001/11/06 22:14:35 1.4 *************** *** 3,10 **** \declaremodule{standard}{robotparser} ! \modulesynopsis{Accepts as input a list of lines or URL that refers to a ! robots.txt file, parses the file, then builds a ! set of rules from that list and answers questions ! about fetchability of other URLs.} \sectionauthor{Skip Montanaro}{skip@mojam.com} --- 3,8 ---- \declaremodule{standard}{robotparser} ! \modulesynopsis{Loads a \protect\file{robots.txt} file and ! answers questions about fetchability of other URLs.} \sectionauthor{Skip Montanaro}{skip@mojam.com} From fdrake@users.sourceforge.net Tue Nov 6 22:11:36 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 06 Nov 2001 14:11:36 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib xmlsaxreader.tex,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv16989/lib Modified Files: xmlsaxreader.tex Log Message: Remove stray quotes; probably left over from conversion from docstrings. Index: xmlsaxreader.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/xmlsaxreader.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** xmlsaxreader.tex 2001/07/06 20:30:11 1.2 --- xmlsaxreader.tex 2001/11/06 22:11:34 1.3 *************** *** 198,202 **** parser so that it is ready to parse new documents. The results of calling parse or feed after close without calling reset are ! undefined.""" \end{methoddesc} --- 198,202 ---- parser so that it is ready to parse new documents. The results of calling parse or feed after close without calling reset are ! undefined. \end{methoddesc} From tim_one@users.sourceforge.net Wed Nov 7 04:42:06 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 06 Nov 2001 20:42:06 -0800 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.95,1.96 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv19824/python/PCbuild Modified Files: python20.wse Log Message: SF bug #478949 Windows installer start menu registry. I'm guessing at this, pending more info from the bug submitter. Wise changed how the %GROUP% vrbl got defined between versions 5.0a (used before Python 2.2) and 8.14, to hold the full path to Start Menu group instead of just the group name. If I'm guessing correctly, the info the bug report is complaining about is in one of the registry keys we set up that neither Windows nor Python cares about. We did store a full path there in 2.2b1 instead of just the group name; the patch cuts it back to just the name again. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** python20.wse 2001/10/19 17:55:30 1.95 --- python20.wse 2001/11/07 04:42:04 1.96 *************** *** 1874,1878 **** end item: Install File ! Source=..\Lib\compiler\*.py Destination=%MAINDIR%\Lib\compiler Description=Python compiler written in Python --- 1874,1878 ---- end item: Install File ! Source=..\lib\compiler\*.py Destination=%MAINDIR%\Lib\compiler Description=Python compiler written in Python *************** *** 1905,1909 **** end item: Install File ! Source=..\Lib\email\*.py Destination=%MAINDIR%\Lib\email Description=Library email package --- 1905,1909 ---- end item: Install File ! Source=..\lib\email\*.py Destination=%MAINDIR%\Lib\email Description=Library email package *************** *** 1921,1925 **** end item: Install File ! Source=..\Lib\hotshot\*.py Destination=%MAINDIR%\Lib\hotshot Description=Fast Python profiler --- 1921,1925 ---- end item: Install File ! Source=..\lib\hotshot\*.py Destination=%MAINDIR%\Lib\hotshot Description=Fast Python profiler *************** *** 2584,2588 **** Total Keys=1 Key=Software\Python\PythonCore\%PY_VERSION%\InstallPath\InstallGroup ! New Value=%GROUP% Root=2 end --- 2584,2589 ---- Total Keys=1 Key=Software\Python\PythonCore\%PY_VERSION%\InstallPath\InstallGroup ! New Value=%CGROUP_SAVE% ! New Value= Root=2 end *************** *** 2621,2625 **** Total Keys=1 Key=Software\Python\PythonCore\%PY_VERSION%\InstallPath\InstallGroup ! New Value=%GROUP% Root=1 end --- 2622,2627 ---- Total Keys=1 Key=Software\Python\PythonCore\%PY_VERSION%\InstallPath\InstallGroup ! New Value=%CGROUP_SAVE% ! New Value= Root=1 end From fdrake@users.sourceforge.net Wed Nov 7 06:22:28 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 06 Nov 2001 22:22:28 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libfuncs.tex,1.94,1.95 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv19297/lib Modified Files: libfuncs.tex Log Message: apply() documentation: Remove a detail about the implementation that does not affect the API. Clean up the text about call syntax apply() is equivalent to. Based on comments by Thomas Guettler. Index: libfuncs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v retrieving revision 1.94 retrieving revision 1.95 diff -C2 -d -r1.94 -r1.95 *** libfuncs.tex 2001/10/29 22:25:44 1.94 --- libfuncs.tex 2001/11/07 06:22:25 1.95 *************** *** 66,78 **** The \var{function} argument must be a callable object (a user-defined or built-in function or method, or a class object) and ! the \var{args} argument must be a sequence (if it is not a tuple, ! the sequence is first converted to a tuple). The \var{function} is called with \var{args} as the argument list; the number of arguments ! is the the length of the tuple. (This is different from just ! calling \code{\var{func}(\var{args})}, since in that case there is ! always exactly one argument.) If the optional \var{keywords} argument is present, it must be a dictionary whose keys are strings. It specifies keyword arguments to be added to the end of the the argument list. \end{funcdesc} --- 66,79 ---- The \var{function} argument must be a callable object (a user-defined or built-in function or method, or a class object) and ! the \var{args} argument must be a sequence. The \var{function} is called with \var{args} as the argument list; the number of arguments ! is the the length of the tuple. If the optional \var{keywords} argument is present, it must be a dictionary whose keys are strings. It specifies keyword arguments to be added to the end of the the argument list. + Calling \function{apply()} is different from just calling + \code{\var{func}(\var{args})}, since in that case there is always + exactly one argument. The use of \function{apply()} is equivalent + to \code{\var{function}(*\var{args}, **\var{keywords})}. \end{funcdesc} From fdrake@users.sourceforge.net Wed Nov 7 06:23:29 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 06 Nov 2001 22:23:29 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc ACKS,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv19466 Modified Files: ACKS Log Message: Another name! Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ACKS,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ACKS 2001/09/11 19:58:51 1.27 --- ACKS 2001/11/07 06:23:27 1.28 *************** *** 62,65 **** --- 62,66 ---- Nathaniel Gray Grant Griffin + Thomas Guettler Anders Hammarquist Mark Hammond From fdrake@users.sourceforge.net Wed Nov 7 06:28:49 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 06 Nov 2001 22:28:49 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libfuncs.tex,1.95,1.96 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv20400/lib Modified Files: libfuncs.tex Log Message: When referring to a formal parameter from the description, use the name given with the signature, not an ad hoc abbreviated form. Index: libfuncs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfuncs.tex,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** libfuncs.tex 2001/11/07 06:22:25 1.95 --- libfuncs.tex 2001/11/07 06:28:47 1.96 *************** *** 73,77 **** to be added to the end of the the argument list. Calling \function{apply()} is different from just calling ! \code{\var{func}(\var{args})}, since in that case there is always exactly one argument. The use of \function{apply()} is equivalent to \code{\var{function}(*\var{args}, **\var{keywords})}. --- 73,77 ---- to be added to the end of the the argument list. Calling \function{apply()} is different from just calling ! \code{\var{function}(\var{args})}, since in that case there is always exactly one argument. The use of \function{apply()} is equivalent to \code{\var{function}(*\var{args}, **\var{keywords})}. From loewis@users.sourceforge.net Wed Nov 7 08:31:05 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Wed, 07 Nov 2001 00:31:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules getaddrinfo.c,1.8,1.9 socketmodule.c,1.193,1.194 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv11992 Modified Files: getaddrinfo.c socketmodule.c Log Message: Fix memory leaks detecting in bug report #478003. Index: getaddrinfo.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/getaddrinfo.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** getaddrinfo.c 2001/09/07 16:10:00 1.8 --- getaddrinfo.c 2001/11/07 08:31:03 1.9 *************** *** 572,581 **** break; } ! goto bad; } if ((hp->h_name == NULL) || (hp->h_name[0] == 0) || ! (hp->h_addr_list[0] == NULL)) ! ERR(EAI_FAIL); for (i = 0; (ap = hp->h_addr_list[i]) != NULL; i++) { --- 572,583 ---- break; } ! goto free; } if ((hp->h_name == NULL) || (hp->h_name[0] == 0) || ! (hp->h_addr_list[0] == NULL)) { ! error = EAI_FAIL; ! goto free; ! } for (i = 0; (ap = hp->h_addr_list[i]) != NULL; i++) { *************** *** 633,637 **** freehostent(hp); #endif ! bad: *res = NULL; return error; --- 635,639 ---- freehostent(hp); #endif ! /* bad: */ *res = NULL; return error; Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.193 retrieving revision 1.194 diff -C2 -d -r1.193 -r1.194 *** socketmodule.c 2001/11/05 02:45:58 1.193 --- socketmodule.c 2001/11/07 08:31:03 1.194 *************** *** 607,610 **** --- 607,611 ---- } if (res->ai_next) { + freeaddrinfo(res); PyErr_SetString(PySocket_Error, "wildcard resolved to multiple address"); *************** *** 2462,2466 **** PySocket_getaddrinfo(PyObject *self, PyObject *args) { ! struct addrinfo hints, *res0, *res; PyObject *pobj = (PyObject *)NULL; char pbuf[30]; --- 2463,2468 ---- PySocket_getaddrinfo(PyObject *self, PyObject *args) { ! struct addrinfo hints, *res; ! struct addrinfo *res0 = NULL; PyObject *pobj = (PyObject *)NULL; char pbuf[30]; *************** *** 2523,2526 **** --- 2525,2530 ---- Py_XDECREF(single); Py_XDECREF(all); + if (res0) + freeaddrinfo(res0); return (PyObject *)NULL; } From lemburg@users.sourceforge.net Wed Nov 7 14:54:51 2001 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Wed, 07 Nov 2001 06:54:51 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.287,2.288 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv19062/Python Modified Files: ceval.c Log Message: Add fast-path for comparing interned (true) string objects. This patch boosts performance for comparing identical string object by some 20% on my machine while not causing any noticable slow-down for other operations (according to tests done with pybench). Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.287 retrieving revision 2.288 diff -C2 -d -r2.287 -r2.288 *** ceval.c 2001/10/18 20:49:35 2.287 --- ceval.c 2001/11/07 14:54:49 2.288 *************** *** 1779,1782 **** --- 1779,1797 ---- Py_INCREF(x); } + else if (v == w && PyString_CheckExact(v)) { + /* Fast-path for comparing interned strings */ + switch (oparg) { + case EQ: x = Py_True; break; + case LE: x = Py_True; break; + case GE: x = Py_True; break; + case NE: x = Py_False; break; + case GT: x = Py_False; break; + case LT: x = Py_False; break; + case IS: x = Py_True; break; + case IS_NOT: x = Py_False; break; + default: goto slow_compare; + } + Py_INCREF(x); + } else { slow_compare: From jeremy@zope.com Wed Nov 7 20:02:19 2001 From: jeremy@zope.com (Jeremy Hylton) Date: Wed, 7 Nov 2001 15:02:19 -0500 (EST) Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.287,2.288 In-Reply-To: References: Message-ID: <15337.37707.681014.720550@slothrop.digicool.com> >>>>> "MAL" == M -A Lemburg writes: MAL> Update of /cvsroot/python/python/dist/src/Python In directory MAL> usw-pr-cvs1:/tmp/cvs-serv19062/Python MAL> Modified Files: MAL> ceval.c MAL> Log Message: Add fast-path for comparing interned (true) string MAL> objects. MAL> This patch boosts performance for comparing identical string MAL> object by some 20% on my machine while not causing any MAL> noticable slow-down for other operations (according to tests MAL> done with pybench). Hey! Don't do that. The last time this came up, I thought there was a pretty clear conclusion that we did not want to make thise change. The tests done with pybench are empirical observations, but they don't disprove the theory that this change does slowdown comparisons of other objects. The last discussion we had on this subject was this message: --------------------------------------------------------------- From: "Tim Peters" To: Subject: RE: [Python-Dev] Slices and "==" optimization Date: Thu, 1 Nov 2001 02:42:39 -0500 Before we special-case strings more, we should fix what we've got: Martin (IIRC) inserted a fast path at the start of do_richcmp early in the 2.2 cycle: --------------------------------------------------------------- Did anyone try to fix what we already have? I'd like to see what the effect of that is. Jeremy From mal@lemburg.com Wed Nov 7 20:22:27 2001 From: mal@lemburg.com (M.-A. Lemburg) Date: Wed, 07 Nov 2001 21:22:27 +0100 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.287,2.288 References: <15337.37707.681014.720550@slothrop.digicool.com> Message-ID: <3BE99803.D8A68D04@lemburg.com> Jeremy Hylton wrote: > > >>>>> "MAL" == M -A Lemburg writes: > > MAL> Update of /cvsroot/python/python/dist/src/Python In directory > MAL> usw-pr-cvs1:/tmp/cvs-serv19062/Python > > MAL> Modified Files: > MAL> ceval.c > MAL> Log Message: Add fast-path for comparing interned (true) string > MAL> objects. > > MAL> This patch boosts performance for comparing identical string > MAL> object by some 20% on my machine while not causing any > MAL> noticable slow-down for other operations (according to tests > MAL> done with pybench). > > Hey! Don't do that. > > The last time this came up, I thought there was a pretty clear > conclusion that we did not want to make thise change. Huh ? > The tests done > with pybench are empirical observations, but they don't disprove the > theory that this change does slowdown comparisons of other objects. AFAIR, there was consent over this and the tests I did using pybench showed that there in fact is no noticable slowdown which was to be expected from theory: If you look at the code, you'll see that only identical objects trigger the fast path -- that's one pointer compare plus a conditional jump; not a whole lot if you track down the paths all other objects have to take through the rich compare logic. As for using pybench to determine the impact: I am pretty confident that the results shown by pybench can be mapped to many different applications out there. It tests a wide variety of different corners in the Python interpreter, so slow-downs and performance gains can be easily noticed and tracked down. It's certainly a lot better than relying on pystone or timing regression suites. > The last discussion we had on this subject was this message: > > --------------------------------------------------------------- > > From: "Tim Peters" > To: > Subject: RE: [Python-Dev] Slices and "==" optimization > Date: Thu, 1 Nov 2001 02:42:39 -0500 > > Before we special-case strings more, we should fix what we've got: Martin > (IIRC) inserted a fast path at the start of do_richcmp early in the 2.2 > cycle: > > --------------------------------------------------------------- > > Did anyone try to fix what we already have? I'd like to see what the > effect of that is. Tim already checked in patches for this, so I figured it was time to look into the fast path patch which I did today. If you want to look at the pybench test output, I can post that too. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Consulting & Company: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/ From fredrik@pythonware.com Wed Nov 7 20:44:08 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 7 Nov 2001 21:44:08 +0100 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.287,2.288 References: <15337.37707.681014.720550@slothrop.digicool.com> <3BE99803.D8A68D04@lemburg.com> Message-ID: <00ae01c167cc$f57920b0$ced241d5@hagrid> mal wrote: > AFAIR, there was consent over this where? cannot find anything in the "slices and == optimization" thread (at least not in the parts that reached my mailbox) (guido agreed that it would be nice if lists supported slice objects, but it doesn't look like that was what you checked in ;-) From mal@lemburg.com Wed Nov 7 20:41:13 2001 From: mal@lemburg.com (M.-A. Lemburg) Date: Wed, 07 Nov 2001 21:41:13 +0100 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.287,2.288 References: <15337.37707.681014.720550@slothrop.digicool.com> <3BE99803.D8A68D04@lemburg.com> <00ae01c167cc$f57920b0$ced241d5@hagrid> Message-ID: <3BE99C69.B0245D19@lemburg.com> Fredrik Lundh wrote: > > mal wrote: > > AFAIR, there was consent over this > > where? Guido: """ > As with all micro-optimizations, the win usually only shows > up in some applications. The one I'm writing uses lot's of > > if tagtype == 'starttag': > if tagtype == 'endtag': > ... > > Since the 'starttag' and 'endtag' strings are interned and > I'm also interning the strings which are stored in tagtype, > I'd like to benefit from the fact that the compare will actually > work as 'is'-compare. However, I don't want to use 'is' because > I consider interning only an optimization and not a feature > of the language. Agreed. > That's why I would like the simple > > if (v == w) return 0; > > integrated into the ceval loop right along the INT-compare > optimization. Maybe this could be done as follows: if (v == w && PyString_CheckExact(v)) return 0; """ > cannot find anything in the "slices and == optimization" > thread (at least not in the parts that reached my mailbox) > > (guido agreed that it would be nice if lists supported slice > objects, but it doesn't look like that was what you checked > in ;-) Barry mentioned that this would have been a new feature and we're in a feature freeze... I'll continue to work on that one for 2.3. -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Consulting & Company: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/ From jeremy@zope.com Wed Nov 7 21:13:31 2001 From: jeremy@zope.com (Jeremy Hylton) Date: Wed, 7 Nov 2001 16:13:31 -0500 (EST) Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.287,2.288 In-Reply-To: <3BE99C69.B0245D19@lemburg.com> References: <15337.37707.681014.720550@slothrop.digicool.com> <3BE99803.D8A68D04@lemburg.com> <00ae01c167cc$f57920b0$ced241d5@hagrid> <3BE99C69.B0245D19@lemburg.com> Message-ID: <15337.41979.342045.625908@slothrop.digicool.com> >>>>> "MAL" == M -A Lemburg writes: MAL> Fredrik Lundh wrote: >> mal wrote: >> > AFAIR, there was consent over this >> >> where? You quoted a long message from Guido where he 1) agreed that interning is an internal language implementation feature and 2) said the following: """ Maybe this could be done as follows: if (v == w && PyString_CheckExact(v)) return 0; """ I don't see a comment that says "maybe this could be done as follows" as agreement that it should be done. I don't even seen a +0. No consensus as far as I can tell. Jeremy From loewis@users.sourceforge.net Wed Nov 7 22:38:11 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Wed, 07 Nov 2001 14:38:11 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/lib-tk tkFileDialog.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/lib-tk In directory usw-pr-cvs1:/tmp/cvs-serv397/Lib/lib-tk Modified Files: tkFileDialog.py Log Message: Patch #478654: Expose tk_chooseDirectory. Also delegate kw arguments through ** calls. Index: tkFileDialog.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/tkFileDialog.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tkFileDialog.py 1998/03/20 20:45:49 1.2 --- tkFileDialog.py 2001/11/07 22:38:08 1.3 *************** *** 65,68 **** --- 65,72 ---- command = "tk_getSaveFile" + class Directory(_Dialog): + "Ask for a directory" + + command = "tk_chooseDirectory" # *************** *** 72,81 **** "Ask for a filename to open" ! return apply(Open, (), options).show() def asksaveasfilename(**options): "Ask for a filename to save as" ! return apply(SaveAs, (), options).show() # FIXME: are the following two perhaps a bit too convenient? --- 76,85 ---- "Ask for a filename to open" ! return Open(**options).show() def asksaveasfilename(**options): "Ask for a filename to save as" ! return SaveAs(**options).show() # FIXME: are the following two perhaps a bit too convenient? *************** *** 84,88 **** "Ask for a filename to open, and returned the opened file" ! filename = apply(Open, (), options).show() if filename: return open(filename, mode) --- 88,92 ---- "Ask for a filename to open, and returned the opened file" ! filename = Open(**options).show() if filename: return open(filename, mode) *************** *** 92,100 **** "Ask for a filename to save as, and returned the opened file" ! filename = apply(SaveAs, (), options).show() if filename: return open(filename, mode) return None # -------------------------------------------------------------------- --- 96,107 ---- "Ask for a filename to save as, and returned the opened file" ! filename = SaveAs(**options).show() if filename: return open(filename, mode) return None + def askdirectory (**options): + "Ask for a directory, and return the file name" + return Directory(**options).show() # -------------------------------------------------------------------- From loewis@users.sourceforge.net Wed Nov 7 22:38:11 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Wed, 07 Nov 2001 14:38:11 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.309,1.310 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv397/Misc Modified Files: NEWS Log Message: Patch #478654: Expose tk_chooseDirectory. Also delegate kw arguments through ** calls. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.309 retrieving revision 1.310 diff -C2 -d -r1.309 -r1.310 *** NEWS 2001/11/05 02:51:07 1.309 --- NEWS 2001/11/07 22:38:08 1.310 *************** *** 52,55 **** --- 52,58 ---- Library + - tkFileDialog exposes a Directory class and askdirectory + convenience function. + - Symbolic group names in regular expressions must be unique. For example, the regexp r'(?P)(?P)' is not allowed, because a From fredrik@pythonware.com Wed Nov 7 22:54:29 2001 From: fredrik@pythonware.com (Fredrik Lundh) Date: Wed, 7 Nov 2001 23:54:29 +0100 Subject: [Python-checkins] CVS: python/dist/src/Lib/lib-tk tkFileDialog.py,1.2,1.3 References: Message-ID: <019801c167df$40740dc0$ced241d5@hagrid> > Patch #478654: Expose tk_chooseDirectory. > Also delegate kw arguments through ** calls. ahem. I did check in a tkDirectoryChooser module last week... From tim.one@home.com Thu Nov 8 07:08:57 2001 From: tim.one@home.com (Tim Peters) Date: Thu, 8 Nov 2001 02:08:57 -0500 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.287,2.288 In-Reply-To: <15337.37707.681014.720550@slothrop.digicool.com> Message-ID: > Did anyone try to fix what we already have? I'd like to see what the > effect of that is. > > Jeremy Yes, I repaired the existing fast-path. On artificial string-compare tests it sped stuff up from a few percent to 10%, "depending". It should also help for all compares of same-type builtins. From lemburg@users.sourceforge.net Thu Nov 8 08:34:46 2001 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Thu, 08 Nov 2001 00:34:46 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.288,2.289 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv17428 Modified Files: ceval.c Log Message: Backing out the fast path for interned string compares again as requested. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.288 retrieving revision 2.289 diff -C2 -d -r2.288 -r2.289 *** ceval.c 2001/11/07 14:54:49 2.288 --- ceval.c 2001/11/08 08:34:43 2.289 *************** *** 1779,1797 **** Py_INCREF(x); } - else if (v == w && PyString_CheckExact(v)) { - /* Fast-path for comparing interned strings */ - switch (oparg) { - case EQ: x = Py_True; break; - case LE: x = Py_True; break; - case GE: x = Py_True; break; - case NE: x = Py_False; break; - case GT: x = Py_False; break; - case LT: x = Py_False; break; - case IS: x = Py_True; break; - case IS_NOT: x = Py_False; break; - default: goto slow_compare; - } - Py_INCREF(x); - } else { slow_compare: --- 1779,1782 ---- From fdrake@users.sourceforge.net Thu Nov 8 17:19:31 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 08 Nov 2001 09:19:31 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib urllib2.py,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv1799 Modified Files: urllib2.py Log Message: Clean up one comment, fix typos in others. Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** urllib2.py 2001/10/09 16:18:45 1.22 --- urllib2.py 2001/11/08 17:19:29 1.23 *************** *** 73,81 **** # XXX issues: # If an authentication error handler that tries to perform ! # authentication for some reason but fails, how should the error be ! # signalled? The client needs to know the HTTP error code. But if ! # the handler knows that the problem was, e.g., that it didn't know ! # that hash algo that requested in the challenge, it would be good to ! # pass that information along to the client, too. # XXX to do: --- 73,81 ---- # XXX issues: # If an authentication error handler that tries to perform ! # authentication for some reason but fails, how should the error be ! # signalled? The client needs to know the HTTP error code. But if ! # the handler knows that the problem was, e.g., that it didn't know ! # that hash algo that requested in the challenge, it would be good to ! # pass that information along to the client, too. # XXX to do: *************** *** 329,334 **** def error(self, proto, *args): if proto in ['http', 'https']: ! # XXX http[s] protocols are special cased ! dict = self.handle_error['http'] # https is not different then http proto = args[2] # YUCK! meth_name = 'http_error_%d' % proto --- 329,334 ---- def error(self, proto, *args): if proto in ['http', 'https']: ! # XXX http[s] protocols are special-cased ! dict = self.handle_error['http'] # https is not different than http proto = args[2] # YUCK! meth_name = 'http_error_%d' % proto From loewis@users.sourceforge.net Thu Nov 8 17:51:37 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 08 Nov 2001 09:51:37 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/lib-tk tkFileDialog.py,1.3,1.4 tkDirectoryChooser.py,1.1,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Lib/lib-tk In directory usw-pr-cvs1:/tmp/cvs-serv10640 Modified Files: tkFileDialog.py Removed Files: tkDirectoryChooser.py Log Message: Merge directory chooser into tkFileDialog. Index: tkFileDialog.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/tkFileDialog.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tkFileDialog.py 2001/11/07 22:38:08 1.3 --- tkFileDialog.py 2001/11/08 17:51:33 1.4 *************** *** 6,10 **** # # this module provides interfaces to the native file dialogues ! # available in Tk 4.2 and newer. # # written by Fredrik Lundh, May 1997. --- 6,11 ---- # # this module provides interfaces to the native file dialogues ! # available in Tk 4.2 and newer, and the directory dialogue available ! # in Tk 8.3 and newer. # # written by Fredrik Lundh, May 1997. *************** *** 29,32 **** --- 30,39 ---- # - title: dialog title # + # options for the directory chooser: + # + # - initialdir, parent, title: see above + # + # - mustexist: if true, user must pick an existing directory + # from tkCommonDialog import Dialog *************** *** 65,72 **** command = "tk_getSaveFile" ! class Directory(_Dialog): "Ask for a directory" command = "tk_chooseDirectory" # --- 72,88 ---- command = "tk_getSaveFile" ! ! # the directory dialog has its own _fix routines. ! class Directory(Dialog): "Ask for a directory" command = "tk_chooseDirectory" + + def _fixresult(self, widget, result): + if result: + # keep directory until next time + self.options["initialdir"] = result + self.directory = result # compatibility + return result # --- tkDirectoryChooser.py DELETED --- From fdrake@users.sourceforge.net Fri Nov 9 03:49:31 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 08 Nov 2001 19:49:31 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib liburllib2.tex,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv9093/lib Modified Files: liburllib2.tex Log Message: Fix a variety of typographical, grammatical, and clarity problems reported by Detlef Lannert. Index: liburllib2.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburllib2.tex,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** liburllib2.tex 2001/10/20 04:24:09 1.5 --- liburllib2.tex 2001/11/09 03:49:29 1.6 *************** *** 16,20 **** \begin{funcdesc}{urlopen}{url\optional{, data}} ! Open the url \var{url}, which can either a string or a \class{Request} object (currently the code checks that it really is a \class{Request} instance, or an instance of a subclass of \class{Request}). --- 16,20 ---- \begin{funcdesc}{urlopen}{url\optional{, data}} ! Open the URL \var{url}, which can be either a string or a \class{Request} object (currently the code checks that it really is a \class{Request} instance, or an instance of a subclass of \class{Request}). *************** *** 38,42 **** \begin{funcdesc}{install_opener}{opener} ! Install a \class{OpenerDirector} instance as the default opener. The code does not check for a real \class{OpenerDirector}, and any class with the appropriate interface will work. --- 38,42 ---- \begin{funcdesc}{install_opener}{opener} ! Install an \class{OpenerDirector} instance as the default opener. The code does not check for a real \class{OpenerDirector}, and any class with the appropriate interface will work. *************** *** 48,53 **** of \class{BaseHandler}, or subclasses of \class{BaseHandler} (in which case it must be possible to call the constructor without ! any parameters. Instances of the following classes will be in ! the front of the \var{handler}s, unless the \var{handler}s contain them, instances of them or subclasses of them: --- 48,53 ---- of \class{BaseHandler}, or subclasses of \class{BaseHandler} (in which case it must be possible to call the constructor without ! any parameters). Instances of the following classes will be in ! front of the \var{handler}s, unless the \var{handler}s contain them, instances of them or subclasses of them: *************** *** 63,68 **** \begin{excdesc}{URLError} ! The error handlers raise when they run into a problem. It is a ! subclass of \exception{IOError}. \end{excdesc} --- 63,68 ---- \begin{excdesc}{URLError} ! The handlers raise this exception (or derived exceptions) when they ! run into a problem. It is a subclass of \exception{IOError}. \end{excdesc} *************** *** 85,89 **** This class is an abstraction of a URL request. ! \var{url} should be a string which is a valid URL. For descrtion of \var{data} see the \method{add_data()} description. \var{headers} should be a dictionary, and will be treated as if --- 85,89 ---- This class is an abstraction of a URL request. ! \var{url} should be a string which is a valid URL. For a description of \var{data} see the \method{add_data()} description. \var{headers} should be a dictionary, and will be treated as if *************** *** 135,173 **** This is a mixin class that helps with HTTP authentication, both to the remote host and to a proxy. ! ! \var{password_mgr} should be something that is compatible with ! \class{HTTPPasswordMgr} --- supplies the documented interface above. \end{classdesc} \begin{classdesc}{HTTPBasicAuthHandler}{\optional{password_mgr}} Handle authentication with the remote host. ! Valid \var{password_mgr}, if given, are the same as for ! \class{AbstractBasicAuthHandler}. \end{classdesc} \begin{classdesc}{ProxyBasicAuthHandler}{\optional{password_mgr}} Handle authentication with the proxy. ! Valid \var{password_mgr}, if given, are the same as for ! \class{AbstractBasicAuthHandler}. \end{classdesc} \begin{classdesc}{AbstractDigestAuthHandler}{\optional{password_mgr}} ! This is a mixin class, that helps with HTTP authentication, both to the remote host and to a proxy. ! ! \var{password_mgr} should be something that is compatible with ! \class{HTTPPasswordMgr} --- supplies the documented interface above. \end{classdesc} \begin{classdesc}{HTTPDigestAuthHandler}{\optional{password_mgr}} Handle authentication with the remote host. ! Valid \var{password_mgr}, if given, are the same as for ! \class{AbstractBasicAuthHandler}. \end{classdesc} \begin{classdesc}{ProxyDigestAuthHandler}{\optional{password_mgr}} Handle authentication with the proxy. ! \var{password_mgr}, if given, shoudl be the same as for ! the constructor of \class{AbstractDigestAuthHandler}. \end{classdesc} --- 135,177 ---- This is a mixin class that helps with HTTP authentication, both to the remote host and to a proxy. ! \var{password_mgr}, if given, should be something that is compatible ! with \class{HTTPPasswordMgr}; refer to section~\ref{http-password-mgr} ! for information on the interface that must be supported. \end{classdesc} \begin{classdesc}{HTTPBasicAuthHandler}{\optional{password_mgr}} Handle authentication with the remote host. ! \var{password_mgr}, if given, should be something that is compatible ! with \class{HTTPPasswordMgr}; refer to section~\ref{http-password-mgr} ! for information on the interface that must be supported. \end{classdesc} \begin{classdesc}{ProxyBasicAuthHandler}{\optional{password_mgr}} Handle authentication with the proxy. ! \var{password_mgr}, if given, should be something that is compatible ! with \class{HTTPPasswordMgr}; refer to section~\ref{http-password-mgr} ! for information on the interface that must be supported. \end{classdesc} \begin{classdesc}{AbstractDigestAuthHandler}{\optional{password_mgr}} ! This is a mixin class that helps with HTTP authentication, both to the remote host and to a proxy. ! \var{password_mgr}, if given, should be something that is compatible ! with \class{HTTPPasswordMgr}; refer to section~\ref{http-password-mgr} ! for information on the interface that must be supported. \end{classdesc} \begin{classdesc}{HTTPDigestAuthHandler}{\optional{password_mgr}} Handle authentication with the remote host. ! \var{password_mgr}, if given, should be something that is compatible ! with \class{HTTPPasswordMgr}; refer to section~\ref{http-password-mgr} ! for information on the interface that must be supported. \end{classdesc} \begin{classdesc}{ProxyDigestAuthHandler}{\optional{password_mgr}} Handle authentication with the proxy. ! \var{password_mgr}, if given, should be something that is compatible ! with \class{HTTPPasswordMgr}; refer to section~\ref{http-password-mgr} ! for information on the interface that must be supported. \end{classdesc} *************** *** 208,222 **** \begin{methoddesc}[Request]{add_data}{data} ! Set the \class{Request} data to \var{data} is ignored by all handlers except HTTP handlers --- and there it should be an \mimetype{application/x-www-form-encoded} buffer, and will change the ! request to be \code{POST} rather then \code{GET}. \end{methoddesc} ! \begin{methoddesc}[Request]{has_data}{data} Return whether the instance has a non-\code{None} data. \end{methoddesc} ! \begin{methoddesc}[Request]{get_data}{data} Return the instance's data. \end{methoddesc} --- 212,226 ---- \begin{methoddesc}[Request]{add_data}{data} ! Set the \class{Request} data to \var{data}. This is ignored by all handlers except HTTP handlers --- and there it should be an \mimetype{application/x-www-form-encoded} buffer, and will change the ! request to be \code{POST} rather than \code{GET}. \end{methoddesc} ! \begin{methoddesc}[Request]{has_data}{} Return whether the instance has a non-\code{None} data. \end{methoddesc} ! \begin{methoddesc}[Request]{get_data}{} Return the instance's data. \end{methoddesc} *************** *** 225,233 **** Add another header to the request. Headers are currently ignored by all handlers except HTTP handlers, where they are added to the list ! of headers sent to the server. Note that there cannot be more then one header with the same name, and later calls will overwrite previous calls in case the \var{key} collides. Currently, this is no loss of HTTP functionality, since all headers which have meaning ! when used more then once have a (header-specific) way of gaining the same functionality using only one header. \end{methoddesc} --- 229,237 ---- Add another header to the request. Headers are currently ignored by all handlers except HTTP handlers, where they are added to the list ! of headers sent to the server. Note that there cannot be more than one header with the same name, and later calls will overwrite previous calls in case the \var{key} collides. Currently, this is no loss of HTTP functionality, since all headers which have meaning ! when used more than once have a (header-specific) way of gaining the same functionality using only one header. \end{methoddesc} *************** *** 242,246 **** \begin{methoddesc}[Request]{get_host}{} ! Return the host to which connection will be made. \end{methoddesc} --- 246,250 ---- \begin{methoddesc}[Request]{get_host}{} ! Return the host to which a connection will be made. \end{methoddesc} *************** *** 251,256 **** \begin{methoddesc}[Request]{set_proxy}{host, type} ! Make the request by connecting to a proxy server. The \var{host} and ! \var{type} will replace those of the instance, and the instance's selector will be the original URL given in the constructor. \end{methoddesc} --- 255,260 ---- \begin{methoddesc}[Request]{set_proxy}{host, type} ! Prepare the request by connecting to a proxy server. The \var{host} ! and \var{type} will replace those of the instance, and the instance's selector will be the original URL given in the constructor. \end{methoddesc} *************** *** 278,282 **** Because the \class{OpenerDirector} needs to know the registered handlers, and a handler needs to know who the \class{OpenerDirector} who called ! it is, there is a reference cycles. Even though recent versions of Python have cycle-collection, it is sometimes preferable to explicitly break the cycles. --- 282,286 ---- Because the \class{OpenerDirector} needs to know the registered handlers, and a handler needs to know who the \class{OpenerDirector} who called ! it is, there is a reference cycle. Even though recent versions of Python have cycle-collection, it is sometimes preferable to explicitly break the cycles. *************** *** 284,288 **** \begin{methoddesc}[OpenerDirector]{open}{url\optional{, data}} ! Open the given \var{url}. (which can be a request object or a string), optionally passing the given \var{data}. Arguments, return values and exceptions raised are the same as those --- 288,292 ---- \begin{methoddesc}[OpenerDirector]{open}{url\optional{, data}} ! Open the given \var{url} (which can be a request object or a string), optionally passing the given \var{data}. Arguments, return values and exceptions raised are the same as those *************** *** 293,299 **** \begin{methoddesc}[OpenerDirector]{error}{proto\optional{, arg\optional{, \moreargs}}} ! Handle an error in a given protocol. The HTTP protocol is special cased to ! use the code as the error. This will call the registered error handlers ! for the given protocol with the given arguments (which are protocol specific). Return values and exceptions raised are the same as those --- 297,305 ---- \begin{methoddesc}[OpenerDirector]{error}{proto\optional{, arg\optional{, \moreargs}}} ! Handle an error in a given protocol. This will call the registered ! error handlers for the given protocol with the given arguments (which ! are protocol specific). The HTTP protocol is a special case which ! uses the HTTP response code to determine the specific error handler; ! refer to the \method{http_error_*()} methods of the handler classes. Return values and exceptions raised are the same as those *************** *** 316,320 **** \end{methoddesc} ! The following members and methods should be used only be classes derived from \class{BaseHandler}: --- 322,326 ---- \end{methoddesc} ! The following members and methods should only be used by classes derived from \class{BaseHandler}: *************** *** 328,338 **** subclasses should define it if they want to catch all URLs. ! This method, if exists, will be called by the \member{parent} \class{OpenerDirector}. It should return a file-like object as described in the return value of the \method{open()} of ! \class{OpenerDirector} or \code{None}. It should raise \exception{URLError}, unless a truly exceptional thing happens (for example, \exception{MemoryError} should not be mapped to ! \exception{URLError}. This method will be called before any protocol-specific open method. --- 334,344 ---- subclasses should define it if they want to catch all URLs. ! This method, if implemented, will be called by the parent \class{OpenerDirector}. It should return a file-like object as described in the return value of the \method{open()} of ! \class{OpenerDirector}, or \code{None}. It should raise \exception{URLError}, unless a truly exceptional thing happens (for example, \exception{MemoryError} should not be mapped to ! \exception{URLError}). This method will be called before any protocol-specific open method. *************** *** 344,348 **** protocol. ! This method, if defined, will be called by the \member{parent} \class{OpenerDirector}. Return values should be the same as for \method{default_open()}. --- 350,354 ---- protocol. ! This method, if defined, will be called by the parent \class{OpenerDirector}. Return values should be the same as for \method{default_open()}. *************** *** 352,358 **** This method is \var{not} defined in \class{BaseHandler}, but subclasses should define it if they want to catch all URLs with no ! specific registerd handler to open it. ! This method, if exists, will be called by the \member{parent} \class{OpenerDirector}. Return values should be the same as for \method{default_open()}. --- 358,364 ---- This method is \var{not} defined in \class{BaseHandler}, but subclasses should define it if they want to catch all URLs with no ! specific registered handler to open it. ! This method, if implemented, will be called by the \member{parent} \class{OpenerDirector}. Return values should be the same as for \method{default_open()}. *************** *** 449,456 **** \begin{methoddesc}[AbstractBasicAuthHandler]{handle_authentication_request} {authreq, host, req, headers} ! Handle an authentication request by getting user/password pair, and retrying. ! \var{authreq} should be the name of the header where the information about ! the realm, \var{host} is the host to authenticate too, \var{req} should be the ! (failed) \class{Request} object, and \var{headers} should be the error headers. \end{methoddesc} --- 455,464 ---- \begin{methoddesc}[AbstractBasicAuthHandler]{handle_authentication_request} {authreq, host, req, headers} ! Handle an authentication request by getting a user/password pair, and ! re-trying the request. \var{authreq} should be the name of the header ! where the information about the realm is included in the request, ! \var{host} is the host to authenticate to, \var{req} should be the ! (failed) \class{Request} object, and \var{headers} should be the error ! headers. \end{methoddesc} *************** *** 461,465 **** \begin{methoddesc}[HTTPBasicAuthHandler]{http_error_401}{req, fp, code, msg, hdrs} ! Retry the request with authentication info, if available. \end{methoddesc} --- 469,473 ---- \begin{methoddesc}[HTTPBasicAuthHandler]{http_error_401}{req, fp, code, msg, hdrs} ! Retry the request with authentication information, if available. \end{methoddesc} *************** *** 470,474 **** \begin{methoddesc}[ProxyBasicAuthHandler]{http_error_407}{req, fp, code, msg, hdrs} ! Retry the request with authentication info, if available. \end{methoddesc} --- 478,482 ---- \begin{methoddesc}[ProxyBasicAuthHandler]{http_error_407}{req, fp, code, msg, hdrs} ! Retry the request with authentication information, if available. \end{methoddesc} *************** *** 480,486 **** {authreq, host, req, headers} \var{authreq} should be the name of the header where the information about ! the realm, \var{host} should be the host to authenticate too, \var{req} ! should be the (failed) \class{Request} object, and \var{headers} should be the ! error headers. \end{methoddesc} --- 488,494 ---- {authreq, host, req, headers} \var{authreq} should be the name of the header where the information about ! the realm is included in the request, \var{host} should be the host to ! authenticate to, \var{req} should be the (failed) \class{Request} ! object, and \var{headers} should be the error headers. \end{methoddesc} *************** *** 491,495 **** \begin{methoddesc}[HTTPDigestAuthHandler]{http_error_401}{req, fp, code, msg, hdrs} ! Retry the request with authentication info, if available. \end{methoddesc} --- 499,503 ---- \begin{methoddesc}[HTTPDigestAuthHandler]{http_error_401}{req, fp, code, msg, hdrs} ! Retry the request with authentication information, if available. \end{methoddesc} *************** *** 507,511 **** \begin{methoddesc}[HTTPHandler]{http_open}{req} ! Send an HTTP request, whcih can be either GET or POST, depending on \code{\var{req}.has_data()}. \end{methoddesc} --- 515,519 ---- \begin{methoddesc}[HTTPHandler]{http_open}{req} ! Send an HTTP request, which can be either GET or POST, depending on \code{\var{req}.has_data()}. \end{methoddesc} From fdrake@users.sourceforge.net Fri Nov 9 05:03:08 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 08 Nov 2001 21:03:08 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libhttplib.tex,1.26,1.27 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv26905/lib Modified Files: libhttplib.tex Log Message: Cleaned up some markup stupidity and a usage problem reported by Detlef Lannert. Added descriptions of HTTP_PORT and HTTPS_PORT. Index: libhttplib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libhttplib.tex,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** libhttplib.tex 2001/10/20 04:24:09 1.26 --- libhttplib.tex 2001/11/09 05:03:05 1.27 *************** *** 38,53 **** \begin{enumerate} ! \item[1.] Make exactly one call to the \method{putrequest()} method. ! \item[2.] Make zero or more calls to the \method{putheader()} method. ! \item[3.] Call the \method{endheaders()} method (this can be omitted if step 4 makes no calls). ! \item[4.] Optional calls to the \method{send()} method. ! \item[5.] Call the \method{getreply()} method. ! \item[6.] Call the \method{getfile()} method and read the data off the file object that it returns. --- 38,53 ---- \begin{enumerate} ! \item Make exactly one call to the \method{putrequest()} method. ! \item Make zero or more calls to the \method{putheader()} method. ! \item Call the \method{endheaders()} method (this can be omitted if step 4 makes no calls). ! \item Optional calls to the \method{send()} method. ! \item Call the \method{getreply()} method. ! \item Call the \method{getfile()} method and read the data off the file object that it returns. *************** *** 55,60 **** \end{classdesc} ! \subsection{HTTP Objects} \class{HTTP} instances have the following methods: --- 55,69 ---- \end{classdesc} ! \begin{datadesc}{HTTP_PORT} ! The default port for the HTTP protocol (always \code{80}). ! \end{datadesc} ! ! \begin{datadesc}{HTTPS_PORT} ! The default port for the HTTPS protocol (always \code{443}). ! \end{datadesc} ! + \subsection{HTTP Objects \label{http-objects}} + \class{HTTP} instances have the following methods: *************** *** 68,73 **** \begin{methoddesc}{connect}{host\optional{, port}} Connect to the server given by \var{host} and \var{port}. See the ! intro for the default port. This should be called directly only if ! the instance was instantiated without passing a host. \end{methoddesc} --- 77,83 ---- \begin{methoddesc}{connect}{host\optional{, port}} Connect to the server given by \var{host} and \var{port}. See the ! introduction to the \refmodule{httplib} module for information on the ! default ports. This should be called directly only if the instance ! was instantiated without passing a host. \end{methoddesc} From mwh@users.sourceforge.net Fri Nov 9 10:06:25 2001 From: mwh@users.sourceforge.net (Michael Hudson) Date: Fri, 09 Nov 2001 02:06:25 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules cPickle.c,2.67,2.68 socketmodule.c,1.194,1.195 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv1934 Modified Files: cPickle.c socketmodule.c Log Message: Fixes to compile cPickle.c & socketmodule.c on cygwin and possibly other platforms that have funny ideas about whether addresses of functions in dlls are compile-time constants. Index: cPickle.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cPickle.c,v retrieving revision 2.67 retrieving revision 2.68 diff -C2 -d -r2.67 -r2.68 *** cPickle.c 2001/10/16 17:10:49 2.67 --- cPickle.c 2001/11/09 10:06:23 2.68 *************** *** 2495,2500 **** 0, /* tp_call */ 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ ! PyObject_GenericSetAttr, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ --- 2495,2500 ---- 0, /* tp_call */ 0, /* tp_str */ ! 0, /* set below */ /* tp_getattro */ ! 0, /* set below */ /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ *************** *** 4669,4672 **** --- 4669,4674 ---- Picklertype.ob_type = &PyType_Type; + Picklertype.tp_getattro = PyObject_GenericGetAttr; + Picklertype.tp_setattro = PyObject_GenericSetAttr; Unpicklertype.ob_type = &PyType_Type; PdataType.ob_type = &PyType_Type; Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.194 retrieving revision 1.195 diff -C2 -d -r1.194 -r1.195 *** socketmodule.c 2001/11/07 08:31:03 1.194 --- socketmodule.c 2001/11/09 10:06:23 1.195 *************** *** 1878,1882 **** 0, /* tp_call */ 0, /* tp_str */ ! PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ --- 1878,1882 ---- 0, /* tp_call */ 0, /* tp_str */ ! 0, /* set below */ /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ *************** *** 1898,1904 **** 0, /* tp_dictoffset */ PySocketSock_init, /* tp_init */ ! PyType_GenericAlloc, /* tp_alloc */ PySocketSock_new, /* tp_new */ ! _PyObject_Del, /* tp_free */ }; --- 1898,1904 ---- 0, /* tp_dictoffset */ PySocketSock_init, /* tp_init */ ! 0, /* set below */ /* tp_alloc */ PySocketSock_new, /* tp_new */ ! 0, /* set below */ /* tp_free */ }; *************** *** 3134,3137 **** --- 3134,3140 ---- #endif /* RISCOS */ PySocketSock_Type.ob_type = &PyType_Type; + PySocketSock_Type.tp_getattro = PyObject_GenericGetAttr; + PySocketSock_Type.tp_alloc = PyType_GenericAlloc; + PySocketSock_Type.tp_free = _PyObject_Del; #ifdef USE_SSL PySSL_Type.ob_type = &PyType_Type; From fdrake@users.sourceforge.net Fri Nov 9 15:58:14 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 09 Nov 2001 07:58:14 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules sunaudiodev.c,1.24,1.25 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv8671/Modules Modified Files: sunaudiodev.c Log Message: Fix memory leak. This is part of SF patch #478006. Index: sunaudiodev.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/sunaudiodev.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** sunaudiodev.c 2000/09/01 23:29:27 1.24 --- sunaudiodev.c 2001/11/09 15:58:12 1.25 *************** *** 104,107 **** --- 104,108 ---- if (fd < 0) { PyErr_SetFromErrnoWithFilename(SunAudioError, opendev); + PyMem_DEL(ctldev); return NULL; } From fdrake@users.sourceforge.net Fri Nov 9 15:59:39 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 09 Nov 2001 07:59:39 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules _hotshot.c,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv9182/Modules Modified Files: _hotshot.c Log Message: Fix memory leak. This is (very!) similar to part of SF patch #478006. Index: _hotshot.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_hotshot.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** _hotshot.c 2001/10/29 20:45:57 1.8 --- _hotshot.c 2001/11/09 15:59:36 1.9 *************** *** 1445,1448 **** --- 1445,1449 ---- pack_add_info(self, "platform", Py_GetPlatform()); pack_add_info(self, "executable", Py_GetProgramFullPath()); + free(buffer); buffer = (char *) Py_GetVersion(); if (buffer == NULL) From fdrake@users.sourceforge.net Fri Nov 9 16:00:43 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 09 Nov 2001 08:00:43 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python thread_pthread.h,2.35,2.36 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv9589/Python Modified Files: thread_pthread.h Log Message: Fix memory leak. This is part of SF patch #478006. Index: thread_pthread.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_pthread.h,v retrieving revision 2.35 retrieving revision 2.36 diff -C2 -d -r2.35 -r2.36 *** thread_pthread.h 2001/10/16 21:13:49 2.35 --- thread_pthread.h 2001/11/09 16:00:41 2.36 *************** *** 201,205 **** SET_THREAD_SIGMASK(SIG_SETMASK, &oldmask, NULL); ! #ifdef THREAD_STACK_SIZE pthread_attr_destroy(&attrs); #endif --- 201,205 ---- SET_THREAD_SIGMASK(SIG_SETMASK, &oldmask, NULL); ! #if defined(THREAD_STACK_SIZE) || defined(PTHREAD_SYSTEM_SCHED_SUPPORTED) pthread_attr_destroy(&attrs); #endif From jhylton@users.sourceforge.net Fri Nov 9 16:15:06 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 09 Nov 2001 08:15:06 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib pickle.py,1.53,1.54 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv13019 Modified Files: pickle.py Log Message: A better new, unique object Index: pickle.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pickle.py,v retrieving revision 1.53 retrieving revision 1.54 diff -C2 -d -r1.53 -r1.54 *** pickle.py 2001/10/15 21:29:28 1.53 --- pickle.py 2001/11/09 16:15:04 1.54 *************** *** 578,582 **** def load(self): ! self.mark = ['spam'] # Any new unique object self.stack = [] self.append = self.stack.append --- 578,582 ---- def load(self): ! self.mark = object() # any new unique object self.stack = [] self.append = self.stack.append From jhylton@users.sourceforge.net Fri Nov 9 16:17:11 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 09 Nov 2001 08:17:11 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_file.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv13525 Modified Files: test_file.py Log Message: Fix SF buf #476953: Bad more for opening file gives bad msg. If fopen() fails with EINVAL it means that the mode argument is invalid. Return the mode in the error message instead of the filename. Index: test_file.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_file.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_file.py 2001/01/17 19:11:13 1.3 --- test_file.py 2001/11/09 16:17:09 1.4 *************** *** 47,49 **** --- 47,60 ---- f.close() + # verify that we get a sensible error message for bad made argument + bad_mode = "qwerty" + try: + open(TESTFN, bad_mode) + except IOError, msg: + s = str(msg) + if s.find(TESTFN) != -1 or s.find(bad_mode) == -1: + print "bad error message for invalid mode: %s" % s + else: + print "no error for invalid mode: %s" % bad_mode + os.unlink(TESTFN) From jhylton@users.sourceforge.net Fri Nov 9 16:17:26 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 09 Nov 2001 08:17:26 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects fileobject.c,2.136,2.137 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv13611 Modified Files: fileobject.c Log Message: Fix SF buf #476953: Bad more for opening file gives bad msg. If fopen() fails with EINVAL it means that the mode argument is invalid. Return the mode in the error message instead of the filename. Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.136 retrieving revision 2.137 diff -C2 -d -r2.136 -r2.137 *** fileobject.c 2001/10/31 18:51:01 2.136 --- fileobject.c 2001/11/09 16:17:24 2.137 *************** *** 122,126 **** #ifdef NO_FOPEN_ERRNO /* Metroworks only, not testable, so unchanged */ ! if ( errno == 0 ) { PyErr_SetString(PyExc_IOError, "Cannot open file"); Py_DECREF(f); --- 122,126 ---- #ifdef NO_FOPEN_ERRNO /* Metroworks only, not testable, so unchanged */ ! if (errno == 0) { PyErr_SetString(PyExc_IOError, "Cannot open file"); Py_DECREF(f); *************** *** 128,132 **** } #endif ! PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); f = NULL; } --- 128,136 ---- } #endif ! if (errno == EINVAL) ! PyErr_Format(PyExc_IOError, "invalid argument: %s", ! mode); ! else ! PyErr_SetFromErrnoWithFilename(PyExc_IOError, name); f = NULL; } From jhylton@users.sourceforge.net Fri Nov 9 16:24:37 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 09 Nov 2001 08:24:37 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/compiler pycodegen.py,1.56,1.57 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/compiler In directory usw-pr-cvs1:/tmp/cvs-serv15667 Modified Files: pycodegen.py Log Message: Fix SF bug #479186: compiler generates bad code for "del" Fix by Neil Schemenauer. Visit the Subscript node when trying to find the operation for a statement. XXX Not sure if there are other nodes that should be visited. Index: pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compiler/pycodegen.py,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** pycodegen.py 2001/10/18 21:57:37 1.56 --- pycodegen.py 2001/11/09 16:24:34 1.57 *************** *** 1334,1337 **** --- 1334,1338 ---- raise ValueError, "mixed ops in stmt" visitAssAttr = visitAssName + visitSubscript = visitAssName class Delegator: From jhylton@users.sourceforge.net Fri Nov 9 16:46:53 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 09 Nov 2001 08:46:53 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib urllib2.py,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv24845 Modified Files: urllib2.py Log Message: Fix SF bug 468948 & 451295: urllib2 authentication problems Fix contributed by Jeffrey C. Ollie. I haven't tested the fix because the situation is non-trivial to reproduce. The basic solution is to get rid of the __current_realm attribute of authentication handlers. Instead, prevent infinite retries by checking for the presence of an Authenticate: header in the request object that exactly matches the Authenticate: header that would be added. The problem prevent authentication from working correctly in the presence of retries. Ollie mentioned that digest authentication has the same problem and I applied the same solution there. Index: urllib2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urllib2.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** urllib2.py 2001/11/08 17:19:29 1.23 --- urllib2.py 2001/11/09 16:46:51 1.24 *************** *** 579,587 **** self.passwd = password_mgr self.add_password = self.passwd.add_password - self.__current_realm = None - # if __current_realm is not None, then the server must have - # refused our name/password and is asking for authorization - # again. must be careful to set it to None on successful - # return. def http_error_auth_reqed(self, authreq, host, req, headers): --- 579,582 ---- *************** *** 596,619 **** def retry_http_basic_auth(self, host, req, realm): - if self.__current_realm is None: - self.__current_realm = realm - else: - self.__current_realm = realm - return None user,pw = self.passwd.find_user_password(realm, host) if pw: raw = "%s:%s" % (user, pw) ! auth = base64.encodestring(raw).strip() ! req.add_header(self.header, 'Basic %s' % auth) ! resp = self.parent.open(req) ! self.__current_realm = None ! return resp else: - self.__current_realm = None return None class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): ! header = 'Authorization' def http_error_401(self, req, fp, code, msg, headers): --- 591,608 ---- def retry_http_basic_auth(self, host, req, realm): user,pw = self.passwd.find_user_password(realm, host) if pw: raw = "%s:%s" % (user, pw) ! auth = 'Basic %s' % base64.encodestring(raw).strip() ! if req.headers.get(self.auth_header, None) == auth: ! return None ! req.add_header(self.auth_header, auth) ! return self.parent.open(req) else: return None class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): ! auth_header = 'Authorization' def http_error_401(self, req, fp, code, msg, headers): *************** *** 625,629 **** class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): ! header = 'Proxy-Authorization' def http_error_407(self, req, fp, code, msg, headers): --- 614,618 ---- class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): ! auth_header = 'Proxy-Authorization' def http_error_407(self, req, fp, code, msg, headers): *************** *** 640,647 **** self.passwd = passwd self.add_password = self.passwd.add_password - self.__current_realm = None def http_error_auth_reqed(self, authreq, host, req, headers): ! authreq = headers.get(self.header, None) if authreq: kind = authreq.split()[0] --- 629,635 ---- self.passwd = passwd self.add_password = self.passwd.add_password def http_error_auth_reqed(self, authreq, host, req, headers): ! authreq = headers.get(self.auth_header, None) if authreq: kind = authreq.split()[0] *************** *** 654,660 **** auth = self.get_authorization(req, chal) if auth: ! req.add_header(self.header, 'Digest %s' % auth) resp = self.parent.open(req) - self.__current_realm = None return resp --- 642,650 ---- auth = self.get_authorization(req, chal) if auth: ! auth_val = 'Digest %s' % auth ! if req.headers.get(self.auth_header, None) == auth_val: ! return None ! req.add_header(self.auth_header, auth_val) resp = self.parent.open(req) return resp *************** *** 668,677 **** opaque = chal.get('opaque', None) except KeyError: - return None - - if self.__current_realm is None: - self.__current_realm = realm - else: - self.__current_realm = realm return None --- 658,661 ---- From theller@users.sourceforge.net Fri Nov 9 16:50:38 2001 From: theller@users.sourceforge.net (Thomas Heller) Date: Fri, 09 Nov 2001 08:50:38 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/tools undoc_symbols.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv26764 Added Files: undoc_symbols.py Log Message: Script to print undocumented symbols found in Python header files. --- NEW FILE: undoc_symbols.py --- # Thomas Heller, 11/2001 """This script prints out a list of undocumented symbols found in Python include files, prefixed by their tag kind. First, a temporary file is written which contains all Python include files, with DL_IMPORT simply removed. This file is passed to ctags, and the output is parsed into a dictionary mapping symbol names to tag kinds. Then, the .tex files from Python docs are read into a giant string. Finally all symbols not found in the docs are written to standard output, prefixed with their tag kind. """ # Which kind of tags do we need? TAG_KINDS = "dpt" # Doc sections to use DOCSECTIONS = ["api", "ext"] # Only print symbols starting with this prefix # to get all symbols, use an empty string PREFIX = "Py" # end of customization section # Tested with EXUBERANT CTAGS # see http://ctags.sourceforge.net # # ctags fields are separated by tabs. # The first field is the name, the last field the type: # d macro definitions (and #undef names) # e enumerators # f function definitions # g enumeration names # m class, struct, or union members # n namespaces # p function prototypes and declarations # s structure names # t typedefs # u union names # v variable definitions # x extern and forward variable declarations import os, glob, re, sys, tempfile def findnames(file, prefix=""): names = {} for line in file.readlines(): if line[0] == '!': continue fields = line.split() name, tag = fields[0], fields[-1] if tag == 'd' and name.endswith('_H'): continue if name.startswith(prefix): names[name] = tag return names def print_undoc_symbols(prefix): incfile = tempfile.mktemp(".h") fp = open(incfile, "w") for file in glob.glob(os.path.join(INCDIR, "*.h")): text = open(file).read() # remove all DL_IMPORT, they will confuse ctags text = re.sub("DL_IMPORT", "", text) fp.write(text) fp.close() docs = [] for sect in DOCSECTIONS: for file in glob.glob(os.path.join(DOCDIR, sect, "*.tex")): docs.append(open(file).read()) docs = "\n".join(docs) fp = os.popen("ctags --c-types=%s -f - %s" % (TAG_KINDS, incfile)) dict = findnames(fp, prefix) names = dict.keys() names.sort() for name in names: if docs.find(name) == -1: print dict[name], name os.remove(incfile) if __name__ == '__main__': global INCDIR global DOCDIR SRCDIR = os.path.dirname(sys.argv[0]) INCDIR = os.path.normpath(os.path.join(SRCDIR, "../../Include")) DOCDIR = os.path.normpath(os.path.join(SRCDIR, "..")) print_undoc_symbols(PREFIX) From bwarsaw@users.sourceforge.net Fri Nov 9 16:59:58 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 09 Nov 2001 08:59:58 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/email Utils.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv29582 Modified Files: Utils.py Log Message: formatdate(): An implementation to replace the one borrowed from rfc822.py. The old rfc822.formatdate() produced date strings using obsolete syntax. The new version produces the preferred RFC 2822 dates. Also, an optional argument `localtime' is added, which if true, produces a date relative to the local timezone, with daylight savings time properly taken into account. Index: Utils.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Utils.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Utils.py 2001/10/04 17:05:11 1.3 --- Utils.py 2001/11/09 16:59:56 1.4 *************** *** 10,14 **** from rfc822 import dump_address_pair from rfc822 import AddrlistClass as _AddrlistClass ! from rfc822 import parsedate_tz, parsedate, mktime_tz, formatdate from quopri import decodestring as _qdecode --- 10,14 ---- from rfc822 import dump_address_pair from rfc822 import AddrlistClass as _AddrlistClass ! from rfc822 import parsedate_tz, parsedate, mktime_tz from quopri import decodestring as _qdecode *************** *** 103,104 **** --- 103,140 ---- raise ValueError, 'Illegal encoding code: ' + encoding return '=?%s?%s?%s?=' % (charset.lower(), encoding.lower(), estr) + + + + def formatdate(timeval=None, localtime=0): + """Returns a formatted time as specified by RFC 2822, e.g.: + + Fri, 09 Nov 2001 01:08:47 -0000 + + Optional timeval if given is a float time as accepted by localtime() or + gmtime(). Optional localtime is a flag that when true, interprets and + returns a time relative to the local timezone instead of UTC. + """ + # Note: we cannot use strftime() because that honors the locale and RFC + # 2822 requires that day and month names be the English abbreviations. + if timeval is None: + timeval = time.time() + if localtime: + now = time.localtime(timeval) + # Calculate timezone offset, based on whether the local zone has + # daylight savings time, and whether DST is in effect. + if time.daylight and now[-1]: + offset = time.altzone + else: + offset = time.timezone + zone = '%+03d%02d' % (offset / -3600, offset % 60) + else: + now = time.gmtime(timeval) + # Timezone offset is always -0000 + zone = '-0000' + return '%s, %02d %s %04d %02d:%02d:%02d %s' % ( + ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'][now[6]], + now[2], + ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', + 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][now[1] - 1], + now[0], now[3], now[4], now[5], + zone) From theller@users.sourceforge.net Fri Nov 9 17:04:45 2001 From: theller@users.sourceforge.net (Thomas Heller) Date: Fri, 09 Nov 2001 09:04:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/tools undoc_symbols.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv31839 Modified Files: undoc_symbols.py Log Message: Remove my name, probably bad style. Index: undoc_symbols.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/undoc_symbols.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** undoc_symbols.py 2001/11/09 16:50:35 1.1 --- undoc_symbols.py 2001/11/09 17:04:43 1.2 *************** *** 1,4 **** - # Thomas Heller, 11/2001 - """This script prints out a list of undocumented symbols found in Python include files, prefixed by their tag kind. --- 1,2 ---- From bwarsaw@users.sourceforge.net Fri Nov 9 17:07:31 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 09 Nov 2001 09:07:31 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/email Utils.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv32605 Modified Files: Utils.py Log Message: formatdate(): A better docstring. Index: Utils.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Utils.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Utils.py 2001/11/09 16:59:56 1.4 --- Utils.py 2001/11/09 17:07:28 1.5 *************** *** 107,117 **** def formatdate(timeval=None, localtime=0): ! """Returns a formatted time as specified by RFC 2822, e.g.: Fri, 09 Nov 2001 01:08:47 -0000 ! Optional timeval if given is a float time as accepted by localtime() or ! gmtime(). Optional localtime is a flag that when true, interprets and ! returns a time relative to the local timezone instead of UTC. """ # Note: we cannot use strftime() because that honors the locale and RFC --- 107,120 ---- def formatdate(timeval=None, localtime=0): ! """Returns a date string as specified by RFC 2822, e.g.: Fri, 09 Nov 2001 01:08:47 -0000 ! Optional timeval if given is a floating point time value as accepted by ! gmtime() and localtime(), otherwise the current time is used. ! ! Optional localtime is a flag that when true, interprets timeval, and ! returns a date relative to the local timezone instead of UTC, properly ! taking daylight savings time into account. """ # Note: we cannot use strftime() because that honors the locale and RFC From bwarsaw@users.sourceforge.net Fri Nov 9 17:08:16 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 09 Nov 2001 09:08:16 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib emailutil.tex,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv546 Modified Files: emailutil.tex Log Message: Updated the documentation for formatdate(). Index: emailutil.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/emailutil.tex,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** emailutil.tex 2001/11/05 01:55:03 1.4 --- emailutil.tex 2001/11/09 17:08:13 1.5 *************** *** 106,113 **** \end{funcdesc} ! \begin{funcdesc}{formatdate}{\optional{timeval}} ! Returns the time formatted as per Internet standards \rfc{2822} ! and updated by \rfc{1123}. If \var{timeval} is provided, then it ! should be a floating point time value as expected by ! \method{time.gmtime()}, otherwise the current time is used. \end{funcdesc} --- 106,122 ---- \end{funcdesc} ! \begin{funcdesc}{formatdate}{\optional{timeval\optional{, localtime}}} ! Returns a date string as per Internet standard \rfc{2822}, e.g.: ! ! \begin{verbatim} ! Fri, 09 Nov 2001 01:08:47 -0000 ! \end{verbatim} ! ! Optional \var{timeval} if given is a floating point time value as ! accepted by \function{time.gmtime()} and \function{time.localtime()}, ! otherwise the current time is used. ! ! Optional \var{localtime} is a flag that when true, interprets ! \var{timeval}, and returns a date relative to the local timezone ! instead of UTC, properly taking daylight savings time into account. \end{funcdesc} From fdrake@acm.org Fri Nov 9 18:12:03 2001 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Fri, 9 Nov 2001 13:12:03 -0500 Subject: [Python-checkins] CVS: python/dist/src/Doc/tools undoc_symbols.py,1.1,1.2 In-Reply-To: References: Message-ID: <15340.7283.136999.512563@grendel.zope.com> Thomas Heller writes: > Remove my name, probably bad style. No, it's not bad style; your choice. We can still track you down from the CVS log. ;-) -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From bwarsaw@users.sourceforge.net Fri Nov 9 17:45:50 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 09 Nov 2001 09:45:50 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/email Utils.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv12830 Modified Files: Utils.py Log Message: Forgot to import time. Index: Utils.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Utils.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Utils.py 2001/11/09 17:07:28 1.5 --- Utils.py 2001/11/09 17:45:48 1.6 *************** *** 5,8 **** --- 5,9 ---- """ + import time import re From bwarsaw@users.sourceforge.net Fri Nov 9 17:46:19 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 09 Nov 2001 09:46:19 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_email.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv13034 Modified Files: test_email.py Log Message: test_formatdate(): A test for email.Utils.formatdate(). Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** test_email.py 2001/10/25 22:43:45 1.14 --- test_email.py 2001/11/09 17:46:17 1.15 *************** *** 920,923 **** --- 920,939 ---- 'message_from_file', 'message_from_string']) + def test_formatdate(self): + now = 1005327232.109884 + gdate = Utils.formatdate(now) + ldate = Utils.formatdate(now, localtime=1) + self.assertEqual(gdate, 'Fri, 09 Nov 2001 17:33:52 -0000') + # It's a little tougher to test for localtime, but we'll try + gtime = time.strptime(gdate.split()[4], '%H:%M:%S') + ltime = time.strptime(ldate.split()[4], '%H:%M:%S') + zone = ldate.split()[5] + offset = int(zone[:3]) * -3600 + int(zone[-2:]) + if time.daylight and time.localtime(now)[-1]: + toff = time.altzone + else: + toff = time.timezone + self.assertEqual(offset, toff) + From loewis@users.sourceforge.net Fri Nov 9 17:50:54 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 09 Nov 2001 09:50:54 -0800 Subject: [Python-checkins] CVS: python/dist/src configure,1.270,1.271 configure.in,1.279,1.280 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv13902 Modified Files: configure configure.in Log Message: Add sys/types.h and stdio.h into getaddrinfo test, based on itojun's message in http://mail.python.org/pipermail/python-dev/2001-November/018473.html Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.270 retrieving revision 1.271 diff -C2 -d -r1.270 -r1.271 *** configure 2001/10/31 12:11:47 1.270 --- configure 2001/11/09 17:50:51 1.271 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.278 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.279 [...1633 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 < *************** *** 7520,7524 **** SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7523: checking for build directories" >&5 for dir in $SRCDIRS; do if test ! -d $dir; then --- 7522,7526 ---- SRCDIRS="Parser Grammar Objects Python Modules" echo $ac_n "checking for build directories""... $ac_c" 1>&6 ! echo "configure:7525: 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.279 retrieving revision 1.280 diff -C2 -d -r1.279 -r1.280 *** configure.in 2001/10/31 12:11:47 1.279 --- configure.in 2001/11/09 17:50:52 1.280 *************** *** 1432,1437 **** --- 1432,1439 ---- AC_MSG_CHECKING(for getaddrinfo) AC_TRY_LINK([ + #include #include #include + #include ],[ getaddrinfo(NULL, NULL, NULL, NULL); From tim_one@users.sourceforge.net Fri Nov 9 19:23:49 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 09 Nov 2001 11:23:49 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects fileobject.c,2.137,2.138 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv15094/python/Objects Modified Files: fileobject.c Log Message: open_the_file(): this routine has a borrowed reference to the file object, so the "Metroworks only" section should not decref it in case of error (the caller is responsible for decref'ing in case of error -- and does). Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.137 retrieving revision 2.138 diff -C2 -d -r2.137 -r2.138 *** fileobject.c 2001/11/09 16:17:24 2.137 --- fileobject.c 2001/11/09 19:23:47 2.138 *************** *** 124,128 **** if (errno == 0) { PyErr_SetString(PyExc_IOError, "Cannot open file"); - Py_DECREF(f); return NULL; } --- 124,127 ---- From bwarsaw@users.sourceforge.net Fri Nov 9 19:31:00 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 09 Nov 2001 11:31:00 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_email.py,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv18732 Modified Files: test_email.py Log Message: test_formatdate(): Don't do the localtime test if we don't have strptime() -- I'm too lazy to code it otherwise. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** test_email.py 2001/11/09 17:46:17 1.15 --- test_email.py 2001/11/09 19:30:58 1.16 *************** *** 925,938 **** ldate = Utils.formatdate(now, localtime=1) self.assertEqual(gdate, 'Fri, 09 Nov 2001 17:33:52 -0000') ! # It's a little tougher to test for localtime, but we'll try ! gtime = time.strptime(gdate.split()[4], '%H:%M:%S') ! ltime = time.strptime(ldate.split()[4], '%H:%M:%S') ! zone = ldate.split()[5] ! offset = int(zone[:3]) * -3600 + int(zone[-2:]) ! if time.daylight and time.localtime(now)[-1]: ! toff = time.altzone ! else: ! toff = time.timezone ! self.assertEqual(offset, toff) --- 925,940 ---- ldate = Utils.formatdate(now, localtime=1) self.assertEqual(gdate, 'Fri, 09 Nov 2001 17:33:52 -0000') ! # It's a little tougher to test for localtime, but we'll try. Skip if ! # we don't have strptime(). ! if hasattr(time, 'striptime'): ! gtime = time.strptime(gdate.split()[4], '%H:%M:%S') ! ltime = time.strptime(ldate.split()[4], '%H:%M:%S') ! zone = ldate.split()[5] ! offset = int(zone[:3]) * -3600 + int(zone[-2:]) ! if time.daylight and time.localtime(now)[-1]: ! toff = time.altzone ! else: ! toff = time.timezone ! self.assertEqual(offset, toff) From bwarsaw@users.sourceforge.net Fri Nov 9 19:31:36 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 09 Nov 2001 11:31:36 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_email.py,1.16,1.17 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv19055 Modified Files: test_email.py Log Message: test_formatdate(): Dang. Typo. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** test_email.py 2001/11/09 19:30:58 1.16 --- test_email.py 2001/11/09 19:31:34 1.17 *************** *** 927,931 **** # It's a little tougher to test for localtime, but we'll try. Skip if # we don't have strptime(). ! if hasattr(time, 'striptime'): gtime = time.strptime(gdate.split()[4], '%H:%M:%S') ltime = time.strptime(ldate.split()[4], '%H:%M:%S') --- 927,931 ---- # It's a little tougher to test for localtime, but we'll try. Skip if # we don't have strptime(). ! if hasattr(time, 'strptime'): gtime = time.strptime(gdate.split()[4], '%H:%M:%S') ltime = time.strptime(ldate.split()[4], '%H:%M:%S') From jhylton@users.sourceforge.net Fri Nov 9 19:34:45 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 09 Nov 2001 11:34:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_file.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv20114 Modified Files: test_file.py Log Message: Fiddle with new test cases -- verify that we get a sensible error message for bad mode argument -- so that it doesn't fail on Windows. It's hack. We know that errno is set to 0 in this case on Windows, so check for that specifically. Index: test_file.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_file.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** test_file.py 2001/11/09 16:17:09 1.4 --- test_file.py 2001/11/09 19:34:43 1.5 *************** *** 47,58 **** f.close() ! # verify that we get a sensible error message for bad made argument bad_mode = "qwerty" try: open(TESTFN, bad_mode) except IOError, msg: ! s = str(msg) ! if s.find(TESTFN) != -1 or s.find(bad_mode) == -1: ! print "bad error message for invalid mode: %s" % s else: print "no error for invalid mode: %s" % bad_mode --- 47,61 ---- f.close() ! # verify that we get a sensible error message for bad mode argument bad_mode = "qwerty" try: open(TESTFN, bad_mode) except IOError, msg: ! if msg[0] != 0: ! s = str(msg) ! if s.find(TESTFN) != -1 or s.find(bad_mode) == -1: ! print "bad error message for invalid mode: %s" % s ! # if msg[0] == 0, we're probably on Windows where there may be ! # no obvious way to discover why open() failed. else: print "no error for invalid mode: %s" % bad_mode From jhylton@users.sourceforge.net Fri Nov 9 19:49:53 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 09 Nov 2001 11:49:53 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_compile.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv24749 Modified Files: test_compile.py Log Message: Fix SF buf #480096: Assign to __debug__ still allowed Easy enough to catch assignment in the compiler. The perverse user can still change the value of __debug__, but that may be the least he can do. Index: test_compile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_compile.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** test_compile.py 2001/08/30 20:51:59 1.8 --- test_compile.py 2001/11/09 19:49:49 1.9 *************** *** 2,5 **** --- 2,16 ---- if verbose: + print "Testing whether compiler catches assignment to __debug__" + + try: + compile('__debug__ = 1', '?', 'single') + except SyntaxError: + pass + + import __builtin__ + setattr(__builtin__, '__debug__', 'sure') + + if verbose: print 'Running tests on argument handling' *************** *** 22,26 **** pass ! print "testing complex args" def comp_args((a, b)): --- 33,38 ---- pass ! if verbose: ! print "testing complex args" def comp_args((a, b)): From jhylton@users.sourceforge.net Fri Nov 9 19:50:10 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 09 Nov 2001 11:50:10 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python compile.c,2.228,2.229 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv24900 Modified Files: compile.c Log Message: Fix SF buf #480096: Assign to __debug__ still allowed Easy enough to catch assignment in the compiler. The perverse user can still change the value of __debug__, but that may be the least he can do. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.228 retrieving revision 2.229 diff -C2 -d -r2.228 -r2.229 *** compile.c 2001/11/04 19:26:58 2.228 --- compile.c 2001/11/09 19:50:08 2.229 *************** *** 5460,5465 **** goto loop; } else if (TYPE(tmp) == NAME) { ! if (strcmp(STR(tmp), "__debug__") == 0) ! symtable_warn(st, ASSIGN_DEBUG); symtable_add_def(st, STR(tmp), DEF_LOCAL | def_flag); } --- 5460,5470 ---- goto loop; } else if (TYPE(tmp) == NAME) { ! if (strcmp(STR(tmp), "__debug__") == 0) { ! PyErr_SetString(PyExc_SyntaxError, ! ASSIGN_DEBUG); ! PyErr_SyntaxLocation(st->st_filename, ! st->st_cur->ste_opt_lineno); ! st->st_errors++; ! } symtable_add_def(st, STR(tmp), DEF_LOCAL | def_flag); } From tim.one@home.com Fri Nov 9 20:04:33 2001 From: tim.one@home.com (Tim Peters) Date: Fri, 9 Nov 2001 15:04:33 -0500 Subject: [Python-checkins] CVS: python/dist/src/Python compile.c,2.228,2.229 In-Reply-To: Message-ID: > Modified Files: > compile.c > Log Message: > Fix SF buf #480096: Assign to __debug__ still allowed > > Easy enough to catch assignment in the compiler. The perverse user > can still change the value of __debug__, but that may be the least he > can do. Jeremy, could you please add a NEWS entry for this? I want it pointed out in the NEWS file that we warned about this change in the 2.1 release. From jhylton@users.sourceforge.net Fri Nov 9 20:37:15 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 09 Nov 2001 12:37:15 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_compile,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv11996 Modified Files: test_compile Log Message: Fix SF buf #480096: Assign to __debug__ still allowed Easy enough to catch assignment in the compiler. The perverse user can still change the value of __debug__, but that may be the least he can do. Index: test_compile =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_compile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_compile 2001/02/19 23:53:42 1.2 --- test_compile 2001/11/09 20:37:13 1.3 *************** *** 1,4 **** test_compile - testing complex args 1 2 1 2 --- 1,3 ---- From bwarsaw@users.sourceforge.net Fri Nov 9 20:37:45 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 09 Nov 2001 12:37:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_socket.py,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv12317 Modified Files: test_socket.py Log Message: getnameinfo() appears to raise socket.error instead of socket.gaierror. :( This allows test_socket to pass on a RH6.1-ish Linux system. Index: test_socket.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_socket.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** test_socket.py 2001/11/02 23:34:52 1.21 --- test_socket.py 2001/11/09 20:37:43 1.22 *************** *** 103,107 **** # On some versions, this crashes the interpreter. socket.getnameinfo(('x', 0, 0, 0), 0) ! except socket.gaierror: pass --- 103,107 ---- # On some versions, this crashes the interpreter. socket.getnameinfo(('x', 0, 0, 0), 0) ! except socket.error: pass From tim_one@users.sourceforge.net Fri Nov 9 20:59:16 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 09 Nov 2001 12:59:16 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects fileobject.c,2.138,2.139 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv19984/python/Objects Modified Files: fileobject.c Log Message: open_the_file(): Explicitly set errno to 0 before calling fopen(). Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.138 retrieving revision 2.139 diff -C2 -d -r2.138 -r2.139 *** fileobject.c 2001/11/09 19:23:47 2.138 --- fileobject.c 2001/11/09 20:59:14 2.139 *************** *** 107,110 **** --- 107,111 ---- return NULL; } + errno = 0; #ifdef HAVE_FOPENRF if (*mode == '*') { From loewis@users.sourceforge.net Fri Nov 9 20:59:41 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Fri, 09 Nov 2001 12:59:41 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python sysmodule.c,2.94,2.95 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv20100 Modified Files: sysmodule.c Log Message: Include sys_getdefaultencoding in #ifdef Py_USING_UNICODE. Fixes #479571. Index: sysmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v retrieving revision 2.94 retrieving revision 2.95 diff -C2 -d -r2.94 -r2.95 *** sysmodule.c 2001/10/24 20:47:48 2.94 --- sysmodule.c 2001/11/09 20:59:39 2.95 *************** *** 165,168 **** --- 165,170 ---- exit status will be one (i.e., failure)."; + #ifdef Py_USING_UNICODE + static PyObject * sys_getdefaultencoding(PyObject *self) *************** *** 176,181 **** Return the current default string encoding used by the Unicode \n\ implementation."; - - #ifdef Py_USING_UNICODE static PyObject * --- 178,181 ---- From jhylton@users.sourceforge.net Fri Nov 9 21:06:26 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 09 Nov 2001 13:06:26 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.310,1.311 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv23805 Modified Files: NEWS Log Message: Add note about assignment to __debug__ being an error. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.310 retrieving revision 1.311 diff -C2 -d -r1.310 -r1.311 *** NEWS 2001/11/07 22:38:08 1.310 --- NEWS 2001/11/09 21:06:24 1.311 *************** *** 28,31 **** --- 28,35 ---- Core and builtins + - Assignment to __debug__ raises SyntaxError at compile-time. This + was promised when 2.1c1 was released as "What's New in Python 2.1c1" + (below) says. + - Clarified the error messages for unsupported operands to an operator (like 1 + ''). From fdrake@users.sourceforge.net Fri Nov 9 21:45:57 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 09 Nov 2001 13:45:57 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libcompilerlike.tex,1.2,NONE Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv6093/Doc/lib Removed Files: libcompilerlike.tex Log Message: No need to have documentation for a module which not accepted in the library. --- libcompilerlike.tex DELETED --- From jhylton@users.sourceforge.net Fri Nov 9 21:59:15 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 09 Nov 2001 13:59:15 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/api abstract.tex,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv11461 Modified Files: abstract.tex Log Message: Add PyObject_CheckReadBuffer(), which returns true if its argument supports the single-segment readable buffer interface. Add documentation for this and other PyObject_XXXBuffer() calls. Index: abstract.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/abstract.tex,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** abstract.tex 2001/10/28 02:37:10 1.4 --- abstract.tex 2001/11/09 21:59:12 1.5 *************** *** 868,870 **** --- 868,909 ---- /* continue doing useful work */ } + + \section{Buffer Protocol \label{buffer}} + + \begin{cfuncdesc}{int}{PyObject_AsCharBuffer}{PyObject *obj, + const char **buffer, + int *buffer_len} + Returns a pointer to a read-only memory location useable as character- + based input. The \var{obj} argument must support the single-segment + character buffer interface. On success, returns \code{1}, sets + \var{buffer} to the memory location and \var{buffer} to the buffer + length. Returns \code{0} and sets a \exception{TypeError} on error. + \end{cfuncdesc} + + \begin{cfuncdesc}{int}{PyObject_AsReadBuffer}{PyObject *obj, + const char **buffer, + int *buffer_len} + Returns a pointer to a read-only memory location containing + arbitrary data. The \var{obj} argument must support the + single-segment readable buffer interface. On success, returns + \code{1}, sets \var{buffer} to the memory location and \var{buffer} + to the buffer length. Returns \code{0} and sets a + \exception{TypeError} on error. + \end{cfuncdesc} + + \begin{cfuncdesc}{int}{PyObject_CheckReadBuffer}{PyObject *o} + Returns \code{1} if \var{o} supports the single-segment readable + buffer interface. Otherwise returns \code{0}. + \enc{cfuncdesc} + + \begin{cfuncdesc}{int}{PyObject_AsWriteBuffer}{PyObject *obj, + const char **buffer, + int *buffer_len} + Returns a pointer to a writeable memory location. The \var{obj} + argument must support the single-segment, character buffer + interface. On success, returns \code{1}, sets \var{buffer} to the + memory location and \var{buffer} to the buffer length. Returns + \code{0} and sets a \exception{TypeError} on error. + \end{cfuncdesc} + \end{verbatim} From jhylton@users.sourceforge.net Fri Nov 9 21:59:29 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 09 Nov 2001 13:59:29 -0800 Subject: [Python-checkins] CVS: python/dist/src/Include abstract.h,2.40,2.41 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv11557 Modified Files: abstract.h Log Message: Add PyObject_CheckReadBuffer(), which returns true if its argument supports the single-segment readable buffer interface. Add documentation for this and other PyObject_XXXBuffer() calls. Index: abstract.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/abstract.h,v retrieving revision 2.40 retrieving revision 2.41 diff -C2 -d -r2.40 -r2.41 *** abstract.h 2001/10/28 02:35:01 2.40 --- abstract.h 2001/11/09 21:59:27 2.41 *************** *** 469,472 **** --- 469,481 ---- */ + DL_IMPORT(int) PyObject_CheckReadBuffer(PyObject *obj); + + /* + Checks whether an arbitrary object supports the (character, + single segment) buffer interface. Returns 1 on success, 0 + on failure. + + */ + DL_IMPORT(int) PyObject_AsReadBuffer(PyObject *obj, const void **buffer, From jhylton@users.sourceforge.net Fri Nov 9 21:59:44 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 09 Nov 2001 13:59:44 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects abstract.c,2.91,2.92 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv11615 Modified Files: abstract.c Log Message: Add PyObject_CheckReadBuffer(), which returns true if its argument supports the single-segment readable buffer interface. Add documentation for this and other PyObject_XXXBuffer() calls. Index: abstract.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v retrieving revision 2.91 retrieving revision 2.92 diff -C2 -d -r2.91 -r2.92 *** abstract.c 2001/11/01 20:26:12 2.91 --- abstract.c 2001/11/09 21:59:42 2.92 *************** *** 183,207 **** } pb = obj->ob_type->tp_as_buffer; ! if ( pb == NULL || pb->bf_getcharbuffer == NULL || ! pb->bf_getsegcount == NULL ) { PyErr_SetString(PyExc_TypeError, "expected a character buffer object"); ! goto onError; } ! if ( (*pb->bf_getsegcount)(obj,NULL) != 1 ) { PyErr_SetString(PyExc_TypeError, "expected a single-segment buffer object"); ! goto onError; } ! len = (*pb->bf_getcharbuffer)(obj,0,&pp); if (len < 0) ! goto onError; *buffer = pp; *buffer_len = len; return 0; ! onError: ! return -1; } --- 183,217 ---- } pb = obj->ob_type->tp_as_buffer; ! if (pb == NULL || pb->bf_getcharbuffer == NULL || ! pb->bf_getsegcount == NULL) { PyErr_SetString(PyExc_TypeError, "expected a character buffer object"); ! return -1; } ! if ((*pb->bf_getsegcount)(obj,NULL) != 1) { PyErr_SetString(PyExc_TypeError, "expected a single-segment buffer object"); ! return -1; } ! len = (*pb->bf_getcharbuffer)(obj, 0, &pp); if (len < 0) ! return -1; *buffer = pp; *buffer_len = len; return 0; + } ! int ! PyObject_CheckReadBuffer(PyObject *obj) ! { ! PyBufferProcs *pb = obj->ob_type->tp_as_buffer; ! ! if (pb == NULL || ! pb->bf_getreadbuffer == NULL || ! pb->bf_getsegcount == NULL || ! (*pb->bf_getsegcount)(obj, NULL) != 1) ! return 0; ! return 1; } *************** *** 219,243 **** } pb = obj->ob_type->tp_as_buffer; ! if ( pb == NULL || pb->bf_getreadbuffer == NULL || ! pb->bf_getsegcount == NULL ) { PyErr_SetString(PyExc_TypeError, "expected a readable buffer object"); ! goto onError; } ! if ( (*pb->bf_getsegcount)(obj,NULL) != 1 ) { PyErr_SetString(PyExc_TypeError, "expected a single-segment buffer object"); ! goto onError; } ! len = (*pb->bf_getreadbuffer)(obj,0,&pp); if (len < 0) ! goto onError; *buffer = pp; *buffer_len = len; return 0; - - onError: - return -1; } --- 229,250 ---- } pb = obj->ob_type->tp_as_buffer; ! if (pb == NULL || pb->bf_getreadbuffer == NULL || ! pb->bf_getsegcount == NULL) { PyErr_SetString(PyExc_TypeError, "expected a readable buffer object"); ! return -1; } ! if ((*pb->bf_getsegcount)(obj, NULL) != 1) { PyErr_SetString(PyExc_TypeError, "expected a single-segment buffer object"); ! return -1; } ! len = (*pb->bf_getreadbuffer)(obj, 0, &pp); if (len < 0) ! return -1; *buffer = pp; *buffer_len = len; return 0; } *************** *** 255,279 **** } pb = obj->ob_type->tp_as_buffer; ! if ( pb == NULL || pb->bf_getwritebuffer == NULL || ! pb->bf_getsegcount == NULL ) { PyErr_SetString(PyExc_TypeError, "expected a writeable buffer object"); ! goto onError; } ! if ( (*pb->bf_getsegcount)(obj,NULL) != 1 ) { PyErr_SetString(PyExc_TypeError, "expected a single-segment buffer object"); ! goto onError; } len = (*pb->bf_getwritebuffer)(obj,0,&pp); if (len < 0) ! goto onError; *buffer = pp; *buffer_len = len; return 0; - - onError: - return -1; } --- 262,283 ---- } pb = obj->ob_type->tp_as_buffer; ! if (pb == NULL || pb->bf_getwritebuffer == NULL || ! pb->bf_getsegcount == NULL) { PyErr_SetString(PyExc_TypeError, "expected a writeable buffer object"); ! return -1; } ! if ((*pb->bf_getsegcount)(obj, NULL) != 1) { PyErr_SetString(PyExc_TypeError, "expected a single-segment buffer object"); ! return -1; } len = (*pb->bf_getwritebuffer)(obj,0,&pp); if (len < 0) ! return -1; *buffer = pp; *buffer_len = len; return 0; } *************** *** 1981,1985 **** if (PySequence_Check(o)) return PySeqIter_New(o); ! PyErr_SetString(PyExc_TypeError, "iteration over non-sequence"); return NULL; } --- 1985,1990 ---- if (PySequence_Check(o)) return PySeqIter_New(o); ! PyErr_SetString(PyExc_TypeError, ! "iteration over non-sequence"); return NULL; } *************** *** 2022,2023 **** --- 2027,2029 ---- return result; } + From jhylton@users.sourceforge.net Fri Nov 9 22:02:29 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 09 Nov 2001 14:02:29 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules newmodule.c,2.35,2.36 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv12479 Modified Files: newmodule.c Log Message: Use PyObject_CheckReadBuffer(). Index: newmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/newmodule.c,v retrieving revision 2.35 retrieving revision 2.36 diff -C2 -d -r2.35 -r2.36 *** newmodule.c 2001/10/21 22:24:14 2.35 --- newmodule.c 2001/11/09 22:02:27 2.36 *************** *** 154,163 **** } ! pb = code->ob_type->tp_as_buffer; ! if (pb == NULL || ! pb->bf_getreadbuffer == NULL || ! pb->bf_getsegcount == NULL || ! (*pb->bf_getsegcount)(code, NULL) != 1) ! { PyErr_SetString(PyExc_TypeError, "bytecode object must be a single-segment read-only buffer"); --- 154,158 ---- } ! if (!PyObject_CheckReadBuffer(code)) { PyErr_SetString(PyExc_TypeError, "bytecode object must be a single-segment read-only buffer"); From jhylton@users.sourceforge.net Fri Nov 9 22:02:50 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Fri, 09 Nov 2001 14:02:50 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python compile.c,2.229,2.230 marshal.c,1.68,1.69 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv12872 Modified Files: compile.c marshal.c Log Message: Use PyObject_CheckReadBuffer(). Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.229 retrieving revision 2.230 diff -C2 -d -r2.229 -r2.230 *** compile.c 2001/11/09 19:50:08 2.229 --- compile.c 2001/11/09 22:02:46 2.230 *************** *** 269,273 **** PyCodeObject *co; int i; - PyBufferProcs *pb; /* Check argument types */ if (argcount < 0 || nlocals < 0 || --- 269,272 ---- *************** *** 280,293 **** name == NULL || !PyString_Check(name) || filename == NULL || !PyString_Check(filename) || ! lnotab == NULL || !PyString_Check(lnotab)) { ! PyErr_BadInternalCall(); ! return NULL; ! } ! pb = code->ob_type->tp_as_buffer; ! if (pb == NULL || ! pb->bf_getreadbuffer == NULL || ! pb->bf_getsegcount == NULL || ! (*pb->bf_getsegcount)(code, NULL) != 1) ! { PyErr_BadInternalCall(); return NULL; --- 279,284 ---- name == NULL || !PyString_Check(name) || filename == NULL || !PyString_Check(filename) || ! lnotab == NULL || !PyString_Check(lnotab) || ! !PyObject_CheckReadBuffer(code)) { PyErr_BadInternalCall(); return NULL; Index: marshal.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/marshal.c,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** marshal.c 2001/10/19 01:46:21 1.68 --- marshal.c 2001/11/09 22:02:48 1.69 *************** *** 109,113 **** { int i, n; - PyBufferProcs *pb; p->depth++; --- 109,112 ---- *************** *** 250,260 **** w_object(co->co_lnotab, p); } ! else if ((pb = v->ob_type->tp_as_buffer) != NULL && ! pb->bf_getsegcount != NULL && ! pb->bf_getreadbuffer != NULL && ! (*pb->bf_getsegcount)(v, NULL) == 1) ! { /* Write unknown buffer-style objects as a string */ char *s; w_byte(TYPE_STRING, p); n = (*pb->bf_getreadbuffer)(v, 0, (void **)&s); --- 249,256 ---- w_object(co->co_lnotab, p); } ! else if (PyObject_CheckReadBuffer(v)) { /* Write unknown buffer-style objects as a string */ char *s; + PyBufferProcs *pb = v->ob_type->tp_as_buffer; w_byte(TYPE_STRING, p); n = (*pb->bf_getreadbuffer)(v, 0, (void **)&s); From fdrake@users.sourceforge.net Fri Nov 9 23:34:28 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 09 Nov 2001 15:34:28 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/api abstract.tex,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv10928/api Modified Files: abstract.tex Log Message: Added version annotations, remove hard tabs. Index: abstract.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/abstract.tex,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** abstract.tex 2001/11/09 21:59:12 1.5 --- abstract.tex 2001/11/09 23:34:26 1.6 *************** *** 869,877 **** } ! \section{Buffer Protocol \label{buffer}} \begin{cfuncdesc}{int}{PyObject_AsCharBuffer}{PyObject *obj, ! const char **buffer, ! int *buffer_len} Returns a pointer to a read-only memory location useable as character- based input. The \var{obj} argument must support the single-segment --- 869,877 ---- } ! \section{Buffer Protocol \label{abstract-buffer}} \begin{cfuncdesc}{int}{PyObject_AsCharBuffer}{PyObject *obj, ! const char **buffer, ! int *buffer_len} Returns a pointer to a read-only memory location useable as character- based input. The \var{obj} argument must support the single-segment *************** *** 879,887 **** \var{buffer} to the memory location and \var{buffer} to the buffer length. Returns \code{0} and sets a \exception{TypeError} on error. \end{cfuncdesc} \begin{cfuncdesc}{int}{PyObject_AsReadBuffer}{PyObject *obj, ! const char **buffer, ! int *buffer_len} Returns a pointer to a read-only memory location containing arbitrary data. The \var{obj} argument must support the --- 879,888 ---- \var{buffer} to the memory location and \var{buffer} to the buffer length. Returns \code{0} and sets a \exception{TypeError} on error. + \versionadded{1.6} \end{cfuncdesc} \begin{cfuncdesc}{int}{PyObject_AsReadBuffer}{PyObject *obj, ! const char **buffer, ! int *buffer_len} Returns a pointer to a read-only memory location containing arbitrary data. The \var{obj} argument must support the *************** *** 890,893 **** --- 891,895 ---- to the buffer length. Returns \code{0} and sets a \exception{TypeError} on error. + \versionadded{1.6} \end{cfuncdesc} *************** *** 895,903 **** Returns \code{1} if \var{o} supports the single-segment readable buffer interface. Otherwise returns \code{0}. \enc{cfuncdesc} \begin{cfuncdesc}{int}{PyObject_AsWriteBuffer}{PyObject *obj, ! const char **buffer, ! int *buffer_len} Returns a pointer to a writeable memory location. The \var{obj} argument must support the single-segment, character buffer --- 897,906 ---- Returns \code{1} if \var{o} supports the single-segment readable buffer interface. Otherwise returns \code{0}. + \versionadded{2.2} \enc{cfuncdesc} \begin{cfuncdesc}{int}{PyObject_AsWriteBuffer}{PyObject *obj, ! const char **buffer, ! int *buffer_len} Returns a pointer to a writeable memory location. The \var{obj} argument must support the single-segment, character buffer *************** *** 905,908 **** --- 908,912 ---- memory location and \var{buffer} to the buffer length. Returns \code{0} and sets a \exception{TypeError} on error. + \versionadded{1.6} \end{cfuncdesc} From jackjansen@users.sourceforge.net Sat Nov 10 00:41:45 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 09 Nov 2001 16:41:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Python macglue.c,1.106,1.107 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv32290/Python/Mac/Python Modified Files: macglue.c Log Message: Fixed various problems with command-dot handling (some very old): - Don't scan for cmd-. unless in the foreground - Scan before switching out to other processes, not after - don't scan if SchedParams.check_interrupt is false (!) - But: do scan if we're blocked on I/O One problem remains: in the last case KeyboardInterrupt is raised too late. Index: macglue.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macglue.c,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** macglue.c 2001/11/01 23:17:35 1.106 --- macglue.c 2001/11/10 00:41:43 1.107 *************** *** 299,308 **** #endif - if (interrupted) return -1; if ( msg == SP_AUTO_SPIN ) maxsleep = 0; ! if ( msg==SP_SLEEP||msg==SP_SELECT ) maxsleep = arg; PyMac_DoYield(maxsleep, 0); /* XXXX or is it safe to call python here? */ --- 299,317 ---- #endif if ( msg == SP_AUTO_SPIN ) maxsleep = 0; ! if ( msg==SP_SLEEP||msg==SP_SELECT ) { maxsleep = arg; + /* + ** We force-scan for interrupts. Not pretty, but otherwise + ** a program may hang in select or sleep forever. + */ + scan_event_queue(1); + } + if (interrupted) { + interrupted = 0; + return -1; + } PyMac_DoYield(maxsleep, 0); /* XXXX or is it safe to call python here? */ *************** *** 454,469 **** } /* ** This routine scans the event queue looking for cmd-. - ** This is the only way to get an interrupt under THINK (since it - ** doesn't do SIGINT handling), but is also used under MW, when - ** the full-fledged event loop is disabled. This way, we can at least - ** interrupt a runaway python program. */ static void ! scan_event_queue(flush) ! int flush; { #if !TARGET_API_MAC_OS8 if ( CheckEventQueueForUserCancel() ) interrupted = 1; --- 463,496 ---- } + /* Check whether we are in the foreground */ + static int + PyMac_InForeground(void) + { + static ProcessSerialNumber ours; + static inited; + ProcessSerialNumber curfg; + Boolean eq; + + if ( inited == 0 ) { + (void)GetCurrentProcess(&ours); + inited = 1; + } + if ( GetFrontProcess(&curfg) < 0 ) + eq = 1; + else if ( SameProcess(&ours, &curfg, &eq) < 0 ) + eq = 1; + return (int)eq; + } + /* ** This routine scans the event queue looking for cmd-. */ static void ! scan_event_queue(force) ! int force; { #if !TARGET_API_MAC_OS8 + if ( interrupted || (!schedparams.check_interrupt && !force) ) + return; if ( CheckEventQueueForUserCancel() ) interrupted = 1; *************** *** 471,474 **** --- 498,503 ---- register EvQElPtr q; + if ( interrupted || (!schedparams.check_interrupt && !force) || !PyMac_InForeground() ) + return; q = (EvQElPtr) LMGetEventQueue()->qHead; *************** *** 489,504 **** PyErr_CheckSignals() { if (schedparams.enabled) { ! if ( (unsigned long)LMGetTicks() > schedparams.next_check ) { ! if ( PyMac_Yield() < 0) ! return -1; ! schedparams.next_check = (unsigned long)LMGetTicks() ! + schedparams.check_interval; if (interrupted) { - scan_event_queue(1); /* Eat events up to cmd-. */ interrupted = 0; PyErr_SetNone(PyExc_KeyboardInterrupt); return -1; } } } --- 518,537 ---- PyErr_CheckSignals() { + int xxx, xxx_old; + if (schedparams.enabled) { ! if ( interrupted || (unsigned long)LMGetTicks() > schedparams.next_check ) { ! scan_event_queue(0); if (interrupted) { interrupted = 0; PyErr_SetNone(PyExc_KeyboardInterrupt); return -1; } + if ( PyMac_Yield() < 0) + return -1; + xxx = LMGetTicks(); + xxx_old = schedparams.next_check; + schedparams.next_check = (unsigned long)LMGetTicks() + + schedparams.check_interval; } } *************** *** 509,534 **** PyOS_InterruptOccurred() { ! scan_event_queue(1); ! return interrupted; ! } ! ! /* Check whether we are in the foreground */ ! static int ! PyMac_InForeground(void) ! { ! static ProcessSerialNumber ours; ! static inited; ! ProcessSerialNumber curfg; ! Boolean eq; ! ! if ( inited == 0 ) { ! (void)GetCurrentProcess(&ours); ! inited = 1; ! } ! if ( GetFrontProcess(&curfg) < 0 ) ! eq = 1; ! else if ( SameProcess(&ours, &curfg, &eq) < 0 ) ! eq = 1; ! return (int)eq; } #endif --- 542,550 ---- PyOS_InterruptOccurred() { ! scan_event_queue(0); ! if ( !interrupted ) ! return 0; ! interrupted = 0; ! return 1; } #endif *************** *** 617,629 **** in_here++; - /* - ** First check for interrupts, if wanted. - ** This sets a flag that will be picked up at an appropriate - ** moment in the mainloop. - */ - if (schedparams.check_interrupt) - scan_event_queue(0); - - /* XXXX Implementing an idle routine goes here */ /* --- 633,636 ---- From loewis@users.sourceforge.net Sat Nov 10 13:57:57 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 10 Nov 2001 05:57:57 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules pyexpat.c,2.52,2.53 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv31810 Modified Files: pyexpat.c Log Message: Merge 1.42 from PyXML: Flag errors resulting from argument conversion problems. Fixes problem with not detecting UTF-8 errors. Index: pyexpat.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pyexpat.c,v retrieving revision 2.52 retrieving revision 2.53 diff -C2 -d -r2.52 -r2.53 *** pyexpat.c 2001/10/21 08:53:52 2.52 --- pyexpat.c 2001/11/10 13:57:55 2.53 *************** *** 476,481 **** && self->handlers[NAME] != Py_None) { \ args = Py_BuildValue PARAM_FORMAT ;\ ! if (!args) \ ! return RETURN; \ self->in_callback = 1; \ rv = call_with_frame(getcode(NAME,#NAME,__LINE__), \ --- 476,480 ---- && self->handlers[NAME] != Py_None) { \ args = Py_BuildValue PARAM_FORMAT ;\ ! if (!args) { flag_error(self); return RETURN;} \ self->in_callback = 1; \ rv = call_with_frame(getcode(NAME,#NAME,__LINE__), \ From loewis@users.sourceforge.net Sat Nov 10 13:59:18 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 10 Nov 2001 05:59:18 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules pyexpat.c,2.53,2.54 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv32204 Modified Files: pyexpat.c Log Message: Patch #473265: UpdatePairedHandlers nonsensical. Index: pyexpat.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pyexpat.c,v retrieving revision 2.53 retrieving revision 2.54 diff -C2 -d -r2.53 -r2.54 *** pyexpat.c 2001/11/10 13:57:55 2.53 --- pyexpat.c 2001/11/10 13:59:16 2.54 *************** *** 1705,1713 **** if (self->handlers[startHandler] ! && self->handlers[endHandler] != Py_None) { start_handler = handler_info[startHandler].handler; } ! if (self->handlers[EndElement] ! && self->handlers[EndElement] != Py_None) { end_handler = handler_info[endHandler].handler; } --- 1705,1713 ---- if (self->handlers[startHandler] ! && self->handlers[startHandler] != Py_None) { start_handler = handler_info[startHandler].handler; } ! if (self->handlers[endHandler] ! && self->handlers[endHandler] != Py_None) { end_handler = handler_info[endHandler].handler; } From jackjansen@users.sourceforge.net Sat Nov 10 23:20:24 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 10 Nov 2001 15:20:24 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/distutils mwerkscompiler.py,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/distutils In directory usw-pr-cvs1:/tmp/cvs-serv10155/Python/Lib/distutils Modified Files: mwerkscompiler.py Log Message: The libraries argument was completely ignored, fixed. Reported by Tom Loredo. Index: mwerkscompiler.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/mwerkscompiler.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** mwerkscompiler.py 2001/06/19 21:23:11 1.4 --- mwerkscompiler.py 2001/11/10 23:20:22 1.5 *************** *** 17,21 **** class MWerksCompiler (CCompiler) : ! """Concrete class that implements an interface to Microsoft Visual C++, as defined by the CCompiler abstract class.""" --- 17,21 ---- class MWerksCompiler (CCompiler) : ! """Concrete class that implements an interface to MetroWerks CodeWarrior, as defined by the CCompiler abstract class.""" *************** *** 151,154 **** --- 151,155 ---- sourcefiledirs.append(dirname) settings['sources'] = sourcefilenames + settings['libraries'] = libraries settings['extrasearchdirs'] = sourcefiledirs + include_dirs + library_dirs if self.dry_run: From jackjansen@users.sourceforge.net Sat Nov 10 23:21:49 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 10 Nov 2001 15:21:49 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/mkcwproject/template-ppc template.prj.xml,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-ppc In directory usw-pr-cvs1:/tmp/cvs-serv11597/Python/Mac/Lib/mkcwproject/template-ppc Modified Files: template.prj.xml Log Message: Add the MSL C library to the set of standard libraries linked against. Most, but not all, of it is included in PythonCore, but extensions may want to use some of the routines not included. Fixes a bug reported by Tom Loredo. Index: template.prj.xml =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-ppc/template.prj.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** template.prj.xml 2001/01/23 22:33:01 1.1 --- template.prj.xml 2001/11/10 23:21:47 1.2 *************** *** 713,716 **** --- 713,723 ---- Name + MSL C.PPC.Lib + MacOS + Library + Debug + + + Name MathLib MacOS *************** *** 746,749 **** --- 753,761 ---- Name + MSL C.PPC.Lib + MacOS + + + Name MathLib MacOS *************** *** 784,787 **** --- 796,805 ---- Name PythonCore + MacOS + + + %(mac_targetname)s + Name + MSL C.PPC.Lib MacOS From jackjansen@users.sourceforge.net Sat Nov 10 23:21:57 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 10 Nov 2001 15:21:57 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/mkcwproject/template-carbon template.prj.xml,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-carbon In directory usw-pr-cvs1:/tmp/cvs-serv11789/Python/Mac/Lib/mkcwproject/template-carbon Modified Files: template.prj.xml Log Message: Add the MSL C library to the set of standard libraries linked against. Most, but not all, of it is included in PythonCore, but extensions may want to use some of the routines not included. Fixes a bug reported by Tom Loredo. Index: template.prj.xml =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-carbon/template.prj.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** template.prj.xml 2001/01/23 23:19:13 1.2 --- template.prj.xml 2001/11/10 23:21:55 1.3 *************** *** 978,981 **** --- 978,988 ---- Name + MSL C.Carbon.Lib + MacOS + Library + + + + Name CarbonLib MacOS *************** *** 1007,1011 **** MacOS ! --- 1014,1023 ---- MacOS ! ! Name ! MSL C.Carbon.Lib ! MacOS ! ! *************** *** 1037,1040 **** --- 1049,1058 ---- Name PythonCoreCarbon + MacOS + + + %(mac_targetname)s + Name + MSL C.Carbon.Lib MacOS From loewis@users.sourceforge.net Sun Nov 11 14:07:39 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sun, 11 Nov 2001 06:07:39 -0800 Subject: [Python-checkins] CVS: python/dist/src/Demo/tix/samples DirList.py,NONE,1.1 DirTree.py,NONE,1.1 SHList1.py,1.1,1.2 SHList2.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/tix/samples In directory usw-pr-cvs1:/tmp/cvs-serv28070/samples Modified Files: SHList1.py SHList2.py Added Files: DirList.py DirTree.py Log Message: Patch #473002: Update Demo/tix tixwidgets.py et al. --- NEW FILE: DirList.py --- # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*- # # $Id: DirList.py,v 1.1 2001/11/11 14:07:37 loewis Exp $ # # Tix Demostration Program # # This sample program is structured in such a way so that it can be # executed from the Tix demo program "widget": it must have a # procedure called "RunSample". It should also have the "if" statment # at the end of this file so that it can be run as a standalone # program using tixwish. # This file demonstrates the use of the tixDirList widget -- you can # use it for the user to select a directory. For example, an installation # program can use the tixDirList widget to ask the user to select the # installation directory for an application. # import Tix, os, copy from Tkconstants import * TCL_DONT_WAIT = 1<<1 TCL_WINDOW_EVENTS = 1<<2 TCL_FILE_EVENTS = 1<<3 TCL_TIMER_EVENTS = 1<<4 TCL_IDLE_EVENTS = 1<<5 TCL_ALL_EVENTS = 0 def RunSample (root): global dirlist dirlist = DemoDirList(root) dirlist.mainloop() dirlist.destroy() class DemoDirList: def __init__(self, w): self.root = w self.exit = -1 z = w.winfo_toplevel() z.wm_title('Tix.DirList Widget Demo') # Create the tixDirList and the tixLabelEntry widgets on the on the top # of the dialog box # bg = root.tk.eval('tix option get bg') # adding bg=bg crashes Windows pythonw tk8.3.3 Python 2.1.0 top = Tix.Frame( w, relief=RAISED, bd=1) # Create the DirList widget. By default it will show the current # directory # # top.dir = Tix.DirList(top) top.dir.hlist['width'] = 40 # When the user presses the ".." button, the selected directory # is "transferred" into the entry widget # top.btn = Tix.Button(top, text = " >> ", pady = 0) # We use a LabelEntry to hold the installation directory. The user # can choose from the DirList widget, or he can type in the directory # manually # top.ent = Tix.LabelEntry(top, label="Installation Directory:", labelside = 'top', options = ''' entry.width 40 label.anchor w ''') font = self.root.tk.eval('tix option get fixed_font') # font = self.root.master.tix_option_get('fixed_font') top.ent.entry['font'] = font self.dlist_dir = copy.copy(os.curdir) # This should work setting the entry's textvariable top.ent.entry['textvariable'] = self.dlist_dir top.btn['command'] = lambda dir=top.dir, ent=top.ent, self=self: \ self.copy_name(dir,ent) # top.ent.entry.insert(0,'tix'+`self`) top.ent.entry.bind('', lambda self=self: self.okcmd () ) top.pack( expand='yes', fill='both', side=TOP) top.dir.pack( expand=1, fill=BOTH, padx=4, pady=4, side=LEFT) top.btn.pack( anchor='s', padx=4, pady=4, side=LEFT) top.ent.pack( expand=1, fill=X, anchor='s', padx=4, pady=4, side=LEFT) # Use a ButtonBox to hold the buttons. # box = Tix.ButtonBox (w, orientation='horizontal') box.add ('ok', text='Ok', underline=0, width=6, command = lambda self=self: self.okcmd () ) box.add ('cancel', text='Cancel', underline=0, width=6, command = lambda self=self: self.quitcmd () ) box.pack( anchor='s', fill='x', side=BOTTOM) z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd()) def copy_name (self, dir, ent): # This should work as it is the entry's textvariable self.dlist_dir = dir.cget('value') # but it isn't so I'll do it manually ent.entry.delete(0,'end') ent.entry.insert(0, self.dlist_dir) def okcmd (self): # tixDemo:Status "You have selected the directory" + $self.dlist_dir self.quitcmd() def quitcmd (self): # self.root.destroy() self.exit = 0 def mainloop(self): while self.exit < 0: self.root.tk.dooneevent(TCL_ALL_EVENTS) # self.root.tk.dooneevent(TCL_DONT_WAIT) def destroy (self): self.root.destroy() # This "if" statement makes it possible to run this script file inside or # outside of the main demo program "widget". # if __name__== '__main__' : import tkMessageBox, traceback try: root=Tix.Tk() RunSample(root) except: t, v, tb = sys.exc_info() text = "Error running the demo script:\n" for line in traceback.format_exception(t,v,tb): text = text + line + '\n' d = tkMessageBox.showerror ( 'Tix Demo Error', text) --- NEW FILE: DirTree.py --- # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*- # # $Id: DirTree.py,v 1.1 2001/11/11 14:07:37 loewis Exp $ # # Tix Demostration Program # # This sample program is structured in such a way so that it can be # executed from the Tix demo program "widget": it must have a # procedure called "RunSample". It should also have the "if" statment # at the end of this file so that it can be run as a standalone # program using tixwish. # This file demonstrates the use of the tixDirTree widget -- you can # use it for the user to select a directory. For example, an installation # program can use the tixDirTree widget to ask the user to select the # installation directory for an application. # import Tix, os, copy from Tkconstants import * def RunSample (w): DemoDirTree(w) class DemoDirTree: def __init__(self, w): self.root = w z = w.winfo_toplevel() z.wm_title('Tix.DirTree Widget Demo') # Create the tixDirTree and the tixLabelEntry widgets on the on the top # of the dialog box # bg = root.tk.eval('tix option get bg') # adding bg=bg crashes Windows pythonw tk8.3.3 Python 2.1.0 top = Tix.Frame( w, relief=RAISED, bd=1) # Create the DirTree widget. By default it will show the current # directory # # top.dir = Tix.DirTree(top) top.dir.hlist['width'] = 40 # When the user presses the ".." button, the selected directory # is "transferred" into the entry widget # top.btn = Tix.Button(top, text = " >> ", pady = 0) # We use a LabelEntry to hold the installation directory. The user # can choose from the DirTree widget, or he can type in the directory # manually # top.ent = Tix.LabelEntry(top, label="Installation Directory:", labelside = 'top', options = ''' entry.width 40 label.anchor w ''') self.dlist_dir = copy.copy(os.curdir) top.ent.entry['textvariable'] = self.dlist_dir top.btn['command'] = lambda dir=top.dir, ent=top.ent, self=self: \ self.copy_name(dir,ent) top.ent.entry.bind('', lambda self=self: self.okcmd () ) top.pack( expand='yes', fill='both', side=TOP) top.dir.pack( expand=1, fill=BOTH, padx=4, pady=4, side=LEFT) top.btn.pack( anchor='s', padx=4, pady=4, side=LEFT) top.ent.pack( expand=1, fill=X, anchor='s', padx=4, pady=4, side=LEFT) # Use a ButtonBox to hold the buttons. # box = Tix.ButtonBox (w, orientation='horizontal') box.add ('ok', text='Ok', underline=0, width=6, command = lambda self=self: self.okcmd () ) box.add ('cancel', text='Cancel', underline=0, width=6, command = lambda self=self: self.quitcmd () ) box.pack( anchor='s', fill='x', side=BOTTOM) def copy_name (self, dir, ent): # This should work as it is the entry's textvariable self.dlist_dir = dir.cget('value') # but it isn't so I'll do it manually ent.entry.delete(0,'end') ent.entry.insert(0, self.dlist_dir) def okcmd (self): # tixDemo:Status "You have selected the directory" + $self.dlist_dir self.quitcmd() def quitcmd (self): self.root.destroy() # This "if" statement makes it possible to run this script file inside or # outside of the main demo program "widget". # if __name__== '__main__' : root=Tix.Tk() RunSample(root) root.mainloop() root.destroy() Index: SHList1.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/tix/samples/SHList1.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SHList1.py 2001/03/21 07:42:07 1.1 --- SHList1.py 2001/11/11 14:07:37 1.2 *************** *** 1,3 **** ! #!/usr/local/bin/python # # $Id$ --- 1,3 ---- ! # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*- # # $Id$ *************** *** 58,62 **** if count : f=Tix.Frame(hlist, name='sep%d' % count, height=2, width=150, ! bd=2, relief=Tix.SUNKEN, bg=hlist['bg'] ) hlist.add_child( itemtype=Tix.WINDOW, --- 58,62 ---- if count : f=Tix.Frame(hlist, name='sep%d' % count, height=2, width=150, ! bd=2, relief=Tix.SUNKEN ) hlist.add_child( itemtype=Tix.WINDOW, *************** *** 90,97 **** box= Tix.ButtonBox(top, orientation=Tix.HORIZONTAL ) box.add( 'ok', text='Ok', underline=0, width=6, ! command = lambda w=w: w.destroy() ) box.add( 'cancel', text='Cancel', underline=0, width=6, ! command = lambda w=w: w.destroy() ) box.pack( side=Tix.BOTTOM, fill=Tix.X) --- 90,97 ---- box= Tix.ButtonBox(top, orientation=Tix.HORIZONTAL ) box.add( 'ok', text='Ok', underline=0, width=6, ! command = lambda w=w: w.quit() ) box.add( 'cancel', text='Cancel', underline=0, width=6, ! command = lambda w=w: w.quit() ) box.pack( side=Tix.BOTTOM, fill=Tix.X) *************** *** 106,107 **** --- 106,108 ---- RunSample(root) root.mainloop() + root.destroy() Index: SHList2.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/tix/samples/SHList2.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SHList2.py 2001/03/21 07:42:07 1.1 --- SHList2.py 2001/11/11 14:07:37 1.2 *************** *** 1,3 **** ! #!/usr/local/bin/python # # $Id$ --- 1,3 ---- ! # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*- # # $Id$ *************** *** 44,48 **** # First some styles for the headers style={} ! style['header'] = Tix.DisplayStyle(Tix.TEXT, fg='black', refwindow=top, anchor=Tix.CENTER, padx=8, pady=2, font = boldfont ) --- 44,48 ---- # First some styles for the headers style={} ! style['header'] = Tix.DisplayStyle(Tix.TEXT, refwindow=top, anchor=Tix.CENTER, padx=8, pady=2, font = boldfont ) *************** *** 79,93 **** ] ! style['mgr_name'] = Tix.DisplayStyle(Tix.TEXT, refwindow=top, ! fg='#202060', selectforeground = '#202060', font = boldfont ) ! style['mgr_posn'] = Tix.DisplayStyle(Tix.TEXT, padx=8, refwindow=top, ! fg='#202060', selectforeground='#202060' ) ! style['empl_name'] = Tix.DisplayStyle(Tix.TEXT, refwindow=top, ! fg='#602020', selectforeground = '#602020', font = boldfont ) ! style['empl_posn'] = Tix.DisplayStyle(Tix.TEXT, padx=8, refwindow=top, ! fg='#602020', selectforeground = '#602020' ) # Let configure the appearance of the HList subwidget --- 79,89 ---- ] ! style['mgr_name'] = Tix.DisplayStyle(Tix.TEXT, refwindow=top) ! style['mgr_posn'] = Tix.DisplayStyle(Tix.TEXT, padx=8, refwindow=top) ! style['empl_name'] = Tix.DisplayStyle(Tix.TEXT, refwindow=top) ! style['empl_posn'] = Tix.DisplayStyle(Tix.TEXT, padx=8, refwindow=top) # Let configure the appearance of the HList subwidget *************** *** 131,138 **** box= Tix.ButtonBox(top, orientation=Tix.HORIZONTAL ) box.add( 'ok', text='Ok', underline=0, width=6, ! command = lambda w=w: w.destroy() ) box.add( 'cancel', text='Cancel', underline=0, width=6, ! command = lambda w=w: w.destroy() ) box.pack( side=Tix.BOTTOM, fill=Tix.X) --- 127,134 ---- box= Tix.ButtonBox(top, orientation=Tix.HORIZONTAL ) box.add( 'ok', text='Ok', underline=0, width=6, ! command = lambda w=w: w.quit() ) box.add( 'cancel', text='Cancel', underline=0, width=6, ! command = lambda w=w: w.quit() ) box.pack( side=Tix.BOTTOM, fill=Tix.X) *************** *** 147,148 **** --- 143,145 ---- RunSample(root) root.mainloop() + root.destroy() From loewis@users.sourceforge.net Sun Nov 11 14:07:39 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sun, 11 Nov 2001 06:07:39 -0800 Subject: [Python-checkins] CVS: python/dist/src/Demo/tix INSTALL.txt,1.1,1.2 README.txt,1.1,1.2 tixwidgets.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/tix In directory usw-pr-cvs1:/tmp/cvs-serv28070 Modified Files: INSTALL.txt README.txt tixwidgets.py Log Message: Patch #473002: Update Demo/tix tixwidgets.py et al. Index: INSTALL.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/tix/INSTALL.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** INSTALL.txt 2001/03/21 07:42:07 1.1 --- INSTALL.txt 2001/11/11 14:07:37 1.2 *************** *** 1,24 **** $Id$ ! Installing PyTix ---------------- ! 0) To use PyTix, you need Tcl/Tk (V8.2+), Tix (V8.1+) and Python (V2.1+). ! PyTix has been written and tested on a Intel Pentium running RH Linux 5.2 and Mandrake Linux 7.0 and Windows with the above mentioned packages. Older versions, e.g. Tix 4.1 and Tk 8.0, might also work. ! There is nothing OS-specific in PyTix itself so it should work on any machine with Tix and Python installed. You can get Tcl and Tk from http://dev.scriptics.com and Tix from http://tix.sourceforge.net. ! 1) Build and install Tcl/Tk 8.2 or 8.3. Build and install Tix 8.1 or better. Ensure that Tix is properly installed by running tixwish and executing the demo programs. Under Unix, use the --enable-shared configure option ! for all three. We recommend tcl8.2.3 for this release of PyTix. ! 2) Modify Modules/Setup.dist and setup.py to change the version of the ! tix library from tix4.1.8.0 to tix8.1.8.2 These modified files can be used for Tkinter with or without Tix. --- 1,32 ---- $Id$ ! Installing Tix.py ---------------- ! 0) To use Tix.py, you need Tcl/Tk (V8.3.3), Tix (V8.1.1) and Python (V2.1.1). ! Tix.py has been written and tested on a Intel Pentium running RH Linux 5.2 and Mandrake Linux 7.0 and Windows with the above mentioned packages. Older versions, e.g. Tix 4.1 and Tk 8.0, might also work. ! There is nothing OS-specific in Tix.py itself so it should work on any machine with Tix and Python installed. You can get Tcl and Tk from http://dev.scriptics.com and Tix from http://tix.sourceforge.net. ! 1) Build and install Tcl/Tk 8.3. Build and install Tix 8.1. Ensure that Tix is properly installed by running tixwish and executing the demo programs. Under Unix, use the --enable-shared configure option ! for all three. We recommend tcl8.3.3 for this release of Tix.py. ! 2a) If you have a distribution like ActiveState with a tcl subdirectory ! of $PYTHONHOME, which contains the directories tcl8.3 and tk8.3, ! make a directory tix8.1 as well. Recursively copy the files from ! /library to $PYTHONHOME/lib/tix8.1, and copy the dynamic library ! (tix8183.dll or libtix8.1.8.3.so) to the same place as the tcl dynamic ! libraries ($PYTHONHOME/Dlls or lib/python-2.1/lib-dynload). In this ! case you are all installed, and you can skip to the end. ! ! 2b) Modify Modules/Setup.dist and setup.py to change the version of the ! tix library from tix4.1.8.0 to tix8.1.8.3 These modified files can be used for Tkinter with or without Tix. *************** *** 45,51 **** # -DWITH_TOGL togl.c \ # *** Uncomment and edit for Tix extension only: ! -DWITH_TIX -ltix8.1.8.2 \ # *** Uncomment and edit to reflect your Tcl/Tk versions: ! -ltk8.2 -ltcl8.2 \ # *** Uncomment and edit to reflect where your X11 libraries are: -L/usr/X11R6/lib \ --- 53,59 ---- # -DWITH_TOGL togl.c \ # *** Uncomment and edit for Tix extension only: ! -DWITH_TIX -ltix8.1.8.3 \ # *** Uncomment and edit to reflect your Tcl/Tk versions: ! -ltk8.3 -ltcl8.3 \ # *** Uncomment and edit to reflect where your X11 libraries are: -L/usr/X11R6/lib \ *************** *** 70,75 **** TCL_LIBRARY, TK_LIBRARY and TIX_LIBRARY environment variables. Try this: ! env TCL_LIBRARY=/usr/local/lib/tcl8.2 \ ! TK_LIBRARY=/usr/local/lib/tk8.2 \ TIX_LIBRARY=/usr/local/lib/tix8.1 \ /usr/local/bin/python Demo/tix/tixwidgets.py --- 78,83 ---- TCL_LIBRARY, TK_LIBRARY and TIX_LIBRARY environment variables. Try this: ! env TCL_LIBRARY=/usr/local/lib/tcl8.3 \ ! TK_LIBRARY=/usr/local/lib/tk8.3 \ TIX_LIBRARY=/usr/local/lib/tix8.1 \ /usr/local/bin/python Demo/tix/tixwidgets.py Index: README.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/tix/README.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** README.txt 2001/03/21 07:42:07 1.1 --- README.txt 2001/11/11 14:07:37 1.2 *************** *** 1,6 **** ! About PyTix ----------- ! PyTix is based on an idea of Jean-Marc Lugrin (lugrin@ms.com) who wrote pytix (another Python-Tix marriage). Tix widgets are an attractive and useful extension to Tk. See http://tix.sourceforge.net --- 1,6 ---- ! About Tix.py ----------- ! Tix.py is based on an idea of Jean-Marc Lugrin (lugrin@ms.com) who wrote pytix (another Python-Tix marriage). Tix widgets are an attractive and useful extension to Tk. See http://tix.sourceforge.net Index: tixwidgets.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/tix/tixwidgets.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tixwidgets.py 2001/05/11 19:44:55 1.2 --- tixwidgets.py 2001/11/11 14:07:37 1.3 *************** *** 1,127 **** ! #! /usr/local/bin/python # # $Id$ # # tixwidgets.py -- # This is a demo program of all Tix widgets available from Python. If # you have installed Python & Tix properly, you can execute this as # ! # % tixwidget.py # import os, sys, Tix class Demo: ! pass ! root = Tix.Tk() ! demo = Demo() ! demo.dir = None # script directory ! demo.balloon = None # balloon widget ! demo.useBalloons = Tix.StringVar() ! demo.useBalloons.set('0') ! demo.statusbar = None # status bar widget ! demo.welmsg = None # Msg widget ! demo.welfont = '' # font name ! demo.welsize = '' # font size ! def main(): ! global demo, root ! progname = sys.argv[0] ! dirname = os.path.dirname(progname) ! if dirname and dirname != os.curdir: ! demo.dir = dirname ! index = -1 ! for i in range(len(sys.path)): ! p = sys.path[i] ! if p in ("", os.curdir): ! index = i ! if index >= 0: ! sys.path[index] = dirname ! else: ! sys.path.insert(0, dirname) ! else: ! demo.dir = os.getcwd() ! sys.path.insert(0, demo.dir+'/samples') ! root.withdraw() ! root = Tix.Toplevel() ! root.title('Tix Widget Demonstration') ! root.geometry('780x570+50+50') ! demo.balloon = Tix.Balloon(root) ! frame1 = MkMainMenu(root) ! frame2 = MkMainNotebook(root) ! frame3 = MkMainStatus(root) ! frame1.pack(side=Tix.TOP, fill=Tix.X) ! frame3.pack(side=Tix.BOTTOM, fill=Tix.X) ! frame2.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=4, pady=4) ! demo.balloon['statusbar'] = demo.statusbar ! root.mainloop() ! def exit_cmd(event=None): ! sys.exit() ! def MkMainMenu(top): ! global demo ! w = Tix.Frame(top, bd=2, relief=Tix.RAISED) ! file = Tix.Menubutton(w, text='File', underline=0, takefocus=0) ! help = Tix.Menubutton(w, text='Help', underline=0, takefocus=0) ! file.pack(side=Tix.LEFT) ! help.pack(side=Tix.RIGHT) ! fm = Tix.Menu(file) ! file['menu'] = fm ! hm = Tix.Menu(help) ! help['menu'] = hm ! fm.add_command(label='Exit', underline=1, accelerator='Ctrl+X', ! command=exit_cmd) ! hm.add_checkbutton(label='BalloonHelp', underline=0, command=ToggleHelp, ! variable=demo.useBalloons) ! # The trace variable option doesn't seem to work, instead I use 'command' ! #apply(w.tk.call, ('trace', 'variable', demo.useBalloons, 'w', ! # ToggleHelp)) ! top.bind_all("", exit_cmd) ! top.bind_all("", exit_cmd) ! return w ! def MkMainNotebook(top): ! top.option_add('*TixNoteBook*tagPadX', 6) ! top.option_add('*TixNoteBook*tagPadY', 4) ! top.option_add('*TixNoteBook*borderWidth', 2) ! top.option_add('*TixNoteBook*font', ! '-*-helvetica-bold-o-normal-*-14-*-*-*-*-*-*-*') ! w = Tix.NoteBook(top, ipadx=5, ipady=5) ! w.add('wel', label='Welcome', underline=0, ! createcmd=lambda w=w, name='wel': MkWelcome(w, name)) ! w.add('cho', label='Choosers', underline=0, ! createcmd=lambda w=w, name='cho': MkChoosers(w, name)) ! w.add('scr', label='Scrolled Widgets', underline=0, ! createcmd=lambda w=w, name='scr': MkScroll(w, name)) ! w.add('mgr', label='Manager Widgets', underline=0, ! createcmd=lambda w=w, name='mgr': MkManager(w, name)) ! w.add('dir', label='Directory List', underline=0, ! createcmd=lambda w=w, name='dir': MkDirList(w, name)) ! w.add('exp', label='Run Sample Programs', underline=0, ! createcmd=lambda w=w, name='exp': MkSample(w, name)) ! return w ! def MkMainStatus(top): ! global demo ! w = Tix.Frame(top, relief=Tix.RAISED, bd=1) ! demo.statusbar = Tix.Label(w, relief=Tix.SUNKEN, bd=1, font='-*-helvetica-medium-r-normal-*-14-*-*-*-*-*-*-*') ! demo.statusbar.form(padx=3, pady=3, left=0, right='%70') ! return w def MkWelcome(nb, name): w = nb.page(name) bar = MkWelcomeBar(w) text = MkWelcomeText(w) ! bar.pack(side=Tix.TOP, fill=Tix.X, padx=2, pady=2) ! text.pack(side=Tix.TOP, fill=Tix.BOTH, expand=1) def MkWelcomeBar(top): --- 1,162 ---- ! # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*- # # $Id$ # # tixwidgets.py -- + # + # For Tix, see http://tix.sourceforge.net + # # This is a demo program of all Tix widgets available from Python. If # you have installed Python & Tix properly, you can execute this as # ! # % python tixwidget.py # import os, sys, Tix + from Tkconstants import * + TCL_DONT_WAIT = 1<<1 + TCL_WINDOW_EVENTS = 1<<2 + TCL_FILE_EVENTS = 1<<3 + TCL_TIMER_EVENTS = 1<<4 + TCL_IDLE_EVENTS = 1<<5 + TCL_ALL_EVENTS = 0 + class Demo: ! def __init__(self, top): ! self.root = top ! self.exit = -1 ! self.dir = None # script directory ! self.balloon = None # balloon widget ! self.useBalloons = Tix.StringVar() ! self.useBalloons.set('0') ! self.statusbar = None # status bar widget ! self.welmsg = None # Msg widget ! self.welfont = '' # font name ! self.welsize = '' # font size ! progname = sys.argv[0] ! dirname = os.path.dirname(progname) ! if dirname and dirname != os.curdir: ! self.dir = dirname ! index = -1 ! for i in range(len(sys.path)): ! p = sys.path[i] ! if p in ("", os.curdir): ! index = i ! if index >= 0: ! sys.path[index] = dirname ! else: ! sys.path.insert(0, dirname) ! else: ! self.dir = os.getcwd() ! sys.path.insert(0, self.dir+'/samples') ! def MkMainMenu(self): ! top = self.root ! w = Tix.Frame(top, bd=2, relief=RAISED) ! file = Tix.Menubutton(w, text='File', underline=0, takefocus=0) ! help = Tix.Menubutton(w, text='Help', underline=0, takefocus=0) ! file.pack(side=LEFT) ! help.pack(side=RIGHT) ! fm = Tix.Menu(file) ! file['menu'] = fm ! hm = Tix.Menu(help) ! help['menu'] = hm ! if w.tk.eval ('info commands console') == "console": ! fm.add_command(label='Console', underline=1, ! command=lambda w=w: w.tk.eval('console show')) ! fm.add_command(label='Exit', underline=1, accelerator='Ctrl+X', ! command = lambda self=self: self.quitcmd () ) ! hm.add_checkbutton(label='BalloonHelp', underline=0, command=ToggleHelp, ! variable=self.useBalloons) ! # The trace variable option doesn't seem to work, instead I use 'command' ! #apply(w.tk.call, ('trace', 'variable', self.useBalloons, 'w', ! # ToggleHelp)) ! return w ! def MkMainNotebook(self): ! top = self.root ! w = Tix.NoteBook(top, ipadx=5, ipady=5, options=""" ! *TixNoteBook*tagPadX 6 ! *TixNoteBook*tagPadY 4 ! *TixNoteBook*borderWidth 2 ! """) ! # This may be required if there is no *Background option ! top['bg'] = w['bg'] ! w.add('wel', label='Welcome', underline=0, ! createcmd=lambda w=w, name='wel': MkWelcome(w, name)) ! w.add('cho', label='Choosers', underline=0, ! createcmd=lambda w=w, name='cho': MkChoosers(w, name)) ! w.add('scr', label='Scrolled Widgets', underline=0, ! createcmd=lambda w=w, name='scr': MkScroll(w, name)) ! w.add('mgr', label='Manager Widgets', underline=0, ! createcmd=lambda w=w, name='mgr': MkManager(w, name)) ! w.add('dir', label='Directory List', underline=0, ! createcmd=lambda w=w, name='dir': MkDirList(w, name)) ! w.add('exp', label='Run Sample Programs', underline=0, ! createcmd=lambda w=w, name='exp': MkSample(w, name)) ! return w ! def MkMainStatus(self): ! global demo ! top = self.root ! w = Tix.Frame(top, relief=Tix.RAISED, bd=1) ! demo.statusbar = Tix.Label(w, relief=Tix.SUNKEN, bd=1) ! demo.statusbar.form(padx=3, pady=3, left=0, right='%70') ! return w ! def build(self): ! root = self.root ! z = root.winfo_toplevel() ! z.wm_title('Tix Widget Demonstration') ! z.geometry('790x590+10+10') ! demo.balloon = Tix.Balloon(root) ! frame1 = self.MkMainMenu() ! frame2 = self.MkMainNotebook() ! frame3 = self.MkMainStatus() ! frame1.pack(side=TOP, fill=X) ! frame3.pack(side=BOTTOM, fill=X) ! frame2.pack(side=TOP, expand=1, fill=BOTH, padx=4, pady=4) ! demo.balloon['statusbar'] = demo.statusbar ! z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd()) ! def quitcmd (self): ! # self.root.destroy() ! self.exit = 0 ! def loop(self): ! while self.exit < 0: ! self.root.tk.dooneevent(TCL_ALL_EVENTS) ! # self.root.tk.dooneevent(TCL_DONT_WAIT) ! ! def destroy (self): ! self.root.destroy() ! ! def RunMain(top): ! global demo, root ! ! demo = Demo(top) ! ! # top.withdraw() ! # root = Tix.Toplevel() ! root = top ! demo.build() ! demo.loop() ! demo.destroy() + # Tabs def MkWelcome(nb, name): w = nb.page(name) bar = MkWelcomeBar(w) text = MkWelcomeText(w) ! bar.pack(side=TOP, fill=X, padx=2, pady=2) ! text.pack(side=TOP, fill=BOTH, expand=1) def MkWelcomeBar(top): *************** *** 168,174 **** win = w.window text = 'Welcome to TIX in Python' ! title = Tix.Label(win, font='-*-times-bold-r-normal-*-18-*-*-*-*-*-*-*', bd=0, width=30, anchor=Tix.N, text=text) ! msg = Tix.Message(win, font='-*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*', bd=0, width=400, anchor=Tix.N, text='Tix is a set of mega-widgets based on TK. This program \ --- 203,209 ---- win = w.window text = 'Welcome to TIX in Python' ! title = Tix.Label(win, bd=0, width=30, anchor=Tix.N, text=text) ! msg = Tix.Message(win, bd=0, width=400, anchor=Tix.N, text='Tix is a set of mega-widgets based on TK. This program \ *************** *** 191,195 **** if font == 'Times Roman': font = 'times' ! fontstr = '-*-%s-bold-r-normal-*-%s-*-*-*-*-*-*-*' % (font, point) demo.welmsg['font'] = fontstr --- 226,230 ---- if font == 'Times Roman': font = 'times' ! fontstr = '%s %s' % (font, point) demo.welmsg['font'] = fontstr *************** *** 361,365 **** def MkFileEnt(w): ! msg = Tix.Message(w, font='-*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*', relief=Tix.FLAT, width=240, anchor=Tix.N, text='Press the "open file" icon button and a TixFileSelectDialog will popup.') --- 396,400 ---- def MkFileEnt(w): ! msg = Tix.Message(w, relief=Tix.FLAT, width=240, anchor=Tix.N, text='Press the "open file" icon button and a TixFileSelectDialog will popup.') *************** *** 369,373 **** def MkFileBox(w): ! msg = Tix.Message(w, font='-*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*', relief=Tix.FLAT, width=240, anchor=Tix.N, text='The TixFileSelectBox is a Motif-style box with various enhancements. For example, you can adjust the size of the two listboxes and your past selections are recorded.') --- 404,408 ---- def MkFileBox(w): ! msg = Tix.Message(w, relief=Tix.FLAT, width=240, anchor=Tix.N, text='The TixFileSelectBox is a Motif-style box with various enhancements. For example, you can adjust the size of the two listboxes and your past selections are recorded.') *************** *** 382,386 **** if not prefix: prefix = '' w.option_add('*' + prefix + '*TixSelect*frame.borderWidth', 1) ! msg = Tix.Message(w, font='-*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*', relief=Tix.FLAT, width=240, anchor=Tix.N, text='The Select widget is also good for arranging buttons in a tool bar.') --- 417,421 ---- if not prefix: prefix = '' w.option_add('*' + prefix + '*TixSelect*frame.borderWidth', 1) ! msg = Tix.Message(w, relief=Tix.FLAT, width=240, anchor=Tix.N, text='The Select widget is also good for arranging buttons in a tool bar.') *************** *** 408,412 **** if not prefix: prefix = '' w.option_add('*' + prefix + '*TixSelect*frame.borderWidth', 1) ! msg = Tix.Message(w, font='-*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*', relief=Tix.FLAT, width=240, anchor=Tix.N, text='There are many types of "chooser" widgets that allow the user to input different types of information') --- 443,447 ---- if not prefix: prefix = '' w.option_add('*' + prefix + '*TixSelect*frame.borderWidth', 1) ! msg = Tix.Message(w, relief=Tix.FLAT, width=240, anchor=Tix.N, text='There are many types of "chooser" widgets that allow the user to input different types of information') *************** *** 435,439 **** top = Tix.Frame(w, width=300, height=330) bot = Tix.Frame(w) ! msg = Tix.Message(top, font='-*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*', relief=Tix.FLAT, width=200, anchor=Tix.N, text='This TixScrolledListBox is configured so that it uses scrollbars only when it is necessary. Use the handles to resize the listbox and watch the scrollbars automatically appear and disappear.') --- 470,474 ---- top = Tix.Frame(w, width=300, height=330) bot = Tix.Frame(w) ! msg = Tix.Message(top, relief=Tix.FLAT, width=200, anchor=Tix.N, text='This TixScrolledListBox is configured so that it uses scrollbars only when it is necessary. Use the handles to resize the listbox and watch the scrollbars automatically appear and disappear.') *************** *** 471,475 **** top = Tix.Frame(w, width=330, height=330) bot = Tix.Frame(w) ! msg = Tix.Message(top, font='-*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*', relief=Tix.FLAT, width=200, anchor=Tix.N, text='The TixScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.') --- 506,510 ---- top = Tix.Frame(w, width=330, height=330) bot = Tix.Frame(w) ! msg = Tix.Message(top, relief=Tix.FLAT, width=200, anchor=Tix.N, text='The TixScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.') *************** *** 501,505 **** top = Tix.Frame(w, width=330, height=330) bot = Tix.Frame(w) ! msg = Tix.Message(top, font='-*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*', relief=Tix.FLAT, width=200, anchor=Tix.N, text='The TixScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.') --- 536,540 ---- top = Tix.Frame(w, width=330, height=330) bot = Tix.Frame(w) ! msg = Tix.Message(top, relief=Tix.FLAT, width=200, anchor=Tix.N, text='The TixScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.') *************** *** 544,548 **** def MkPanedWindow(w): ! msg = Tix.Message(w, font='-*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*', relief=Tix.FLAT, width=240, anchor=Tix.N, text='The PanedWindow widget allows the user to interactively manipulate the sizes of several panes. The panes can be arranged either vertically or horizontally.') --- 579,583 ---- def MkPanedWindow(w): ! msg = Tix.Message(w, relief=Tix.FLAT, width=240, anchor=Tix.N, text='The PanedWindow widget allows the user to interactively manipulate the sizes of several panes. The panes can be arranged either vertically or horizontally.') *************** *** 586,590 **** def MkNoteBook(w): ! msg = Tix.Message(w, font='-*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*', relief=Tix.FLAT, width=240, anchor=Tix.N, text='The NoteBook widget allows you to layout a complex interface into individual pages.') --- 621,625 ---- def MkNoteBook(w): ! msg = Tix.Message(w, relief=Tix.FLAT, width=240, anchor=Tix.N, text='The NoteBook widget allows you to layout a complex interface into individual pages.') *************** *** 655,659 **** def MkDirListWidget(w): ! msg = Tix.Message(w, font='-*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*', relief=Tix.FLAT, width=240, anchor=Tix.N, text='The TixDirList widget gives a graphical representation of the file system directory and makes it easy for the user to choose and access directories.') --- 690,694 ---- def MkDirListWidget(w): ! msg = Tix.Message(w, relief=Tix.FLAT, width=240, anchor=Tix.N, text='The TixDirList widget gives a graphical representation of the file system directory and makes it easy for the user to choose and access directories.') *************** *** 663,667 **** def MkExFileWidget(w): ! msg = Tix.Message(w, font='-*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*', relief=Tix.FLAT, width=240, anchor=Tix.N, text='The TixExFileSelectBox widget is more user friendly than the Motif style FileSelectBox.') --- 698,702 ---- def MkExFileWidget(w): ! msg = Tix.Message(w, relief=Tix.FLAT, width=240, anchor=Tix.N, text='The TixExFileSelectBox widget is more user friendly than the Motif style FileSelectBox.') *************** *** 678,681 **** --- 713,718 ---- 'Combo Box' : 'ComboBox', 'Compound Image' : 'CmpImg', + 'Directory List' : 'DirList', + 'Directory Tree' : 'DirTree', 'Control' : 'Control', 'Notebook' : 'NoteBook', *************** *** 687,692 **** --- 724,821 ---- } + # There are still a lot of demos to be translated: + ## set root { + ## {d "File Selectors" file } + ## {d "Hierachical ListBox" hlist } + ## {d "Tabular ListBox" tlist {c tixTList}} + ## {d "Grid Widget" grid {c tixGrid}} + ## {d "Manager Widgets" manager } + ## {d "Scrolled Widgets" scroll } + ## {d "Miscellaneous Widgets" misc } + ## {d "Image Types" image } + ## } + ## + ## set image { + ## {d "Compound Image" cmpimg } + ## {d "XPM Image" xpm {i pixmap}} + ## } + ## + ## set cmpimg { + ## {f "In Buttons" CmpImg.tcl } + ## {f "In NoteBook" CmpImg2.tcl } + ## {f "Notebook Color Tabs" CmpImg4.tcl } + ## {f "Icons" CmpImg3.tcl } + ## } + ## + ## set xpm { + ## {f "In Button" Xpm.tcl {i pixmap}} + ## {f "In Menu" Xpm1.tcl {i pixmap}} + ## } + ## + ## set file { + ##added {f DirList DirList.tcl } + ##added {f DirTree DirTree.tcl } + ## {f DirSelectDialog DirDlg.tcl } + ## {f ExFileSelectDialog EFileDlg.tcl } + ## {f FileSelectDialog FileDlg.tcl } + ## {f FileEntry FileEnt.tcl } + ## } + ## + ## set hlist { + ## {f HList HList1.tcl } + ## {f CheckList ChkList.tcl {c tixCheckList}} + ##done {f "ScrolledHList (1)" SHList.tcl } + ##done {f "ScrolledHList (2)" SHList2.tcl } + ##done {f Tree Tree.tcl } + ##done {f "Tree (Dynamic)" DynTree.tcl {v win}} + ## } + ## + ## set tlist { + ## {f "ScrolledTList (1)" STList1.tcl {c tixTList}} + ## {f "ScrolledTList (2)" STList2.tcl {c tixTList}} + ## } + ## global tcl_platform + ## # This demo hangs windows + ## if {$tcl_platform(platform) != "windows"} { + ##na lappend tlist {f "TList File Viewer" STList3.tcl {c tixTList}} + ## } + ## + ## set grid { + ##na {f "Simple Grid" SGrid0.tcl {c tixGrid}} + ##na {f "ScrolledGrid" SGrid1.tcl {c tixGrid}} + ##na {f "Editable Grid" EditGrid.tcl {c tixGrid}} + ## } + ## + ## set scroll { + ## {f ScrolledListBox SListBox.tcl } + ## {f ScrolledText SText.tcl } + ## {f ScrolledWindow SWindow.tcl } + ##na {f "Canvas Object View" CObjView.tcl {c tixCObjView}} + ## } + ## + ## set manager { + ##na {f ListNoteBook ListNBK.tcl } + ## {f NoteBook NoteBook.tcl } + ## {f PanedWindow PanedWin.tcl } + ## } + ## + ## set misc { + ##done {f Balloon Balloon.tcl } + ##done {f ButtonBox BtnBox.tcl } + ##done {f ComboBox ComboBox.tcl } + ##done {f Control Control.tcl } + ## {f LabelEntry LabEntry.tcl } + ## {f LabelFrame LabFrame.tcl } + ##na {f Meter Meter.tcl {c tixMeter}} + ##done {f OptionMenu OptMenu.tcl } + ##done {f PopupMenu PopMenu.tcl } + ## {f Select Select.tcl } + ## {f StdButtonBox StdBBox.tcl } + ## } + ## + stypes = {} stypes['widget'] = ['Balloon', 'Button Box', 'Combo Box', 'Control', + 'Directory List', 'Directory Tree', 'Notebook', 'Option Menu', 'Popup Menu', 'ScrolledHList (1)', 'ScrolledHList (2)', 'Tree (dynamic)'] *************** *** 708,712 **** stext = Tix.ScrolledText(w, name='stext') ! stext.text.bind('<1>', stext.text.focus()) stext.text.bind('', lambda w=stext.text: w.yview(scroll='-1 unit')) stext.text.bind('', lambda w=stext.text: w.yview(scroll='1 unit')) --- 837,843 ---- stext = Tix.ScrolledText(w, name='stext') ! font = root.tk.eval('tix option get fixed_font') ! stext.text.config(font=font) ! # stext.text.bind('<1>', stext.text.focus()) stext.text.bind('', lambda w=stext.text: w.yview(scroll='-1 unit')) stext.text.bind('', lambda w=stext.text: w.yview(scroll='1 unit')) *************** *** 727,731 **** stext.text['state'] = 'disabled' stext.text['wrap'] = 'none' - #XXX stext.text['font'] = fixed_font slb.hlist['separator'] = '.' --- 858,861 ---- *************** *** 786,789 **** --- 916,920 ---- def LoadFile(w, fname): + global root b = Tix.Button(w, text='Close', command=w.destroy) t = Tix.ScrolledText(w) *************** *** 793,799 **** b.pack() ! t.text['highlightcolor'] = t['bg'] t.text['bd'] = 2 - t.text['bg'] = t['bg'] t.text['wrap'] = 'none' --- 924,930 ---- b.pack() ! font = root.tk.eval('tix option get fixed_font') ! t.text.config(font=font) t.text['bd'] = 2 t.text['wrap'] = 'none' *************** *** 816,819 **** if __name__ == '__main__': ! main() --- 947,951 ---- if __name__ == '__main__': ! root = Tix.Tk() ! RunMain(root) From loewis@users.sourceforge.net Sun Nov 11 14:24:08 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sun, 11 Nov 2001 06:24:08 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules _cursesmodule.c,2.58,2.59 gdbmmodule.c,2.29,2.30 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv2592 Modified Files: _cursesmodule.c gdbmmodule.c Log Message: Patch in bug report #477700: Fix memory leaks in gdbm & curses. Index: _cursesmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_cursesmodule.c,v retrieving revision 2.58 retrieving revision 2.59 diff -C2 -d -r2.58 -r2.59 *** _cursesmodule.c 2001/10/24 17:10:49 2.58 --- _cursesmodule.c 2001/11/11 14:24:05 2.59 *************** *** 2545,2548 **** --- 2545,2549 ---- c_api_object = PyCObject_FromVoidPtr((void *)PyCurses_API, NULL); PyDict_SetItemString(d, "_C_API", c_api_object); + Py_DECREF(c_api_object); /* For exception curses.error */ Index: gdbmmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gdbmmodule.c,v retrieving revision 2.29 retrieving revision 2.30 diff -C2 -d -r2.29 -r2.30 *** gdbmmodule.c 2001/02/28 16:44:18 2.29 --- gdbmmodule.c 2001/11/11 14:24:05 2.30 *************** *** 506,510 **** DL_EXPORT(void) initgdbm(void) { ! PyObject *m, *d; Dbmtype.ob_type = &PyType_Type; --- 506,510 ---- DL_EXPORT(void) initgdbm(void) { ! PyObject *m, *d, *s; Dbmtype.ob_type = &PyType_Type; *************** *** 516,521 **** if (DbmError != NULL) { PyDict_SetItemString(d, "error", DbmError); ! PyDict_SetItemString(d, "open_flags", ! PyString_FromString(dbmmodule_open_flags)); } } --- 516,522 ---- if (DbmError != NULL) { PyDict_SetItemString(d, "error", DbmError); ! s = PyString_FromString(dbmmodule_open_flags); ! PyDict_SetItemString(d, "open_flags", s); ! Py_DECREF(s); } } From loewis@users.sourceforge.net Sun Nov 11 14:49:17 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sun, 11 Nov 2001 06:49:17 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules _cursesmodule.c,2.59,2.60 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv16928 Modified Files: _cursesmodule.c Log Message: Limit string size on one-character-strings. Fixes #480384. Index: _cursesmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_cursesmodule.c,v retrieving revision 2.59 retrieving revision 2.60 diff -C2 -d -r2.59 -r2.60 *** _cursesmodule.c 2001/11/11 14:24:05 2.59 --- _cursesmodule.c 2001/11/11 14:49:15 2.60 *************** *** 1655,1659 **** ch = erasechar(); ! return PyString_FromString(&ch); } --- 1655,1659 ---- ch = erasechar(); ! return PyString_FromStringAndSize(&ch, 1); } *************** *** 2013,2017 **** ch = killchar(); ! return PyString_FromString(&ch); } --- 2013,2017 ---- ch = killchar(); ! return PyString_FromStringAndSize(&ch, 1); } From bwarsaw@users.sourceforge.net Mon Nov 12 05:56:00 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Sun, 11 Nov 2001 21:56:00 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.145,1.146 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv21412 Modified Files: pep-0000.txt Log Message: Added PEP 275, Switching on Multiple Values, Lemburg Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.145 retrieving revision 1.146 diff -C2 -d -r1.145 -r1.146 *** pep-0000.txt 2001/11/02 22:48:21 1.145 --- pep-0000.txt 2001/11/12 05:55:58 1.146 *************** *** 86,89 **** --- 86,90 ---- S 273 Import Modules from Zip Archives Ahlstrom S 274 Dict Comprehensions Warsaw + S 275 Switching on Multiple Values Lemburg Finished PEPs (done, implemented in CVS) *************** *** 229,232 **** --- 230,234 ---- S 273 Import Modules from Zip Archives Ahlstrom S 274 Dict Comprehensions Warsaw + S 275 Switching on Multiple Values Lemburg From theller@users.sourceforge.net Mon Nov 12 07:46:33 2001 From: theller@users.sourceforge.net (Thomas Heller) Date: Sun, 11 Nov 2001 23:46:33 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/api abstract.tex,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv20402 Modified Files: abstract.tex Log Message: Fix obvious typos. Index: abstract.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/abstract.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** abstract.tex 2001/11/09 23:34:26 1.6 --- abstract.tex 2001/11/12 07:46:31 1.7 *************** *** 877,881 **** based input. The \var{obj} argument must support the single-segment character buffer interface. On success, returns \code{1}, sets ! \var{buffer} to the memory location and \var{buffer} to the buffer length. Returns \code{0} and sets a \exception{TypeError} on error. \versionadded{1.6} --- 877,881 ---- based input. The \var{obj} argument must support the single-segment character buffer interface. On success, returns \code{1}, sets ! \var{buffer} to the memory location and \var{buffer_len} to the buffer length. Returns \code{0} and sets a \exception{TypeError} on error. \versionadded{1.6} *************** *** 888,892 **** arbitrary data. The \var{obj} argument must support the single-segment readable buffer interface. On success, returns ! \code{1}, sets \var{buffer} to the memory location and \var{buffer} to the buffer length. Returns \code{0} and sets a \exception{TypeError} on error. --- 888,892 ---- arbitrary data. The \var{obj} argument must support the single-segment readable buffer interface. On success, returns ! \code{1}, sets \var{buffer} to the memory location and \var{buffer_len} to the buffer length. Returns \code{0} and sets a \exception{TypeError} on error. *************** *** 906,910 **** argument must support the single-segment, character buffer interface. On success, returns \code{1}, sets \var{buffer} to the ! memory location and \var{buffer} to the buffer length. Returns \code{0} and sets a \exception{TypeError} on error. \versionadded{1.6} --- 906,910 ---- argument must support the single-segment, character buffer interface. On success, returns \code{1}, sets \var{buffer} to the ! memory location and \var{buffer_len} to the buffer length. Returns \code{0} and sets a \exception{TypeError} on error. \versionadded{1.6} From lemburg@users.sourceforge.net Mon Nov 12 09:11:39 2001 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Mon, 12 Nov 2001 01:11:39 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0275.txt,NONE,1.1 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv30397 Added Files: pep-0275.txt Log Message: Initial draft of the PEP. --- NEW FILE: pep-0275.txt --- PEP: 0275 Title: Switching on Multiple Values Version: $Revision: 1.1 $ Author: mal@lemburg.com (Marc-Andre Lemburg) Status: Draft Type: Standards Track Python-Version: 2.3 Created: 10-Nov-2001 Post-History: Abstract This PEP proposes strategies to enhance Python's performance with respect to handling switching on a single variable having one of multiple possible values. Problem Up to Python 2.2, the typical way of writing multi-value switches has been to use long switch constructs of the following type: if x == 'first state': ... elif x == 'second state': ... elif x == 'third state': ... elif x == 'fourth state': ... else: # default handling ... This works fine for short switch constructs, since the overhead of repeated loading of a local (the variable x in this case) and comparing it to some constant is low (it has a complexity of O(n) on average). However, when using such a construct to write a state machine such as is needed for writing parsers the number of possible states can easily reach 10 or more cases. The current solution to this problem lies in using a dispatch table to find the case implementing method to execute depending on the value of the switch variable (this can be tuned to have a complexity of O(1) on average, e.g. by using perfect hash tables). This works well for state machines which require complex and lengthy processing in the different case methods. It does not perform well for ones which only process one or two instructions per case, e.g. def handle_data(self, data): self.stack.append(data) A nice example of this is the state machine implemented in pickle.py which is used to serialize Python objects. Other prominent cases include XML SAX parsers and Internet protocol handlers. Proposed Solutions This PEP proposes two different but not necessarily conflicting solutions: 1. Adding an optimization to the Python compiler and VM which detects the above if-elif-else construct and generates special opcodes for it which use an read-only dictionary for storing jump offsets. 2. Adding new syntax to Python which mimics the C style switch statement. The first solution has the benefit of not relying on adding new keywords to the language, while the second looks cleaner. Both involve some run-time overhead to assure that the switching variable is immutable and hashable. Solution 1: Optimizing if-elif-else XXX This section currently only sketches the design. Issues: The new optimization should not change the current Python semantics (by reducing the number of __cmp__ calls and adding __hash__ calls in if-elif-else constructs which are affected by the optimiztation). To assure this, switching can only safely be implemented either if a "from __future__" style flag is used, or the switching variable is one of the builtin immutable types: int, float, string, unicode, etc. (not subtypes, since it's not clear whether these are still immutable or not) To prevent post-modifications of the jump-table dictionary (which could be used to reach protected code), the jump-table will have to be a read-only type (e.g. a read-only dictionary). The optimization should only be used for if-elif-else constructs which have a minimum number of n cases (where n is a number which has yet to be defined depending on performance tests). Implementation: It should be possible for the compiler to detect an if-elif-else construct which has the following signature: if x == 'first':... elif x == 'second':... else:... i.e. the left hand side always references the same variable, the right hand side a hashable immutable builtin type. The right hand sides need not be all of the same type, but they should be comparable to the type of the left hand switch variable. The compiler could then setup a read-only (perfect) hash table, store it in the constants and add an opcode SWITCH in front of the standard if-elif-else byte code stream which triggers the following run-time behaviour: At runtime, SWITCH would check x for being one of the well-known immutable types (strings, unicode, numbers) and use the hash table for finding the right opcode snippet. If this condition is not met, the interpreter should revert to the standard if-elif-else processing by simply skipping the SWITCH opcode and procedding with the usual if-elif-else byte code stream. Solutions 2: Adding a switch statement to Python XXX This section currently only sketches the design. Syntax: switch EXPR: case CONSTANT: SUITE case CONSTANT: SUITE ... else: SUITE (modulo indentation variations) The "else" part is optional. If no else part is given and none of the defined cases matches, a ValueError is raised. Implementation: The compiler would have to compile this into byte code similar to this: def whatis(x): switch(x): case 'one': print '1' case 'two': print '2' case 'three': print '3' else: print "D'oh!" into (ommitting POP_TOP's and SET_LINENO's): 6 LOAD_FAST 0 (x) 9 LOAD_CONST 1 (switch-table-1) 12 SWITCH 26 (to 38) 14 LOAD_CONST 2 ('1') 17 PRINT_ITEM 18 PRINT_NEWLINE 19 JUMP 43 22 LOAD_CONST 3 ('2') 25 PRINT_ITEM 26 PRINT_NEWLINE 27 JUMP 43 30 LOAD_CONST 4 ('3') 33 PRINT_ITEM 34 PRINT_NEWLINE 35 JUMP 43 38 LOAD_CONST 5 ("D'oh!") 41 PRINT_ITEM 42 PRINT_NEWLINE >>43 LOAD_CONST 0 (None) 46 RETURN_VALUE Where the 'SWITCH' opcode would jump to 14, 22, 30 or 38 depending on 'x'. Issues: The switch statement should not implement fall-through behaviour (as does the switch statement in C). Each case defines a complete and independent suite; much like in a if-elif-else statement. This also enables using break in switch statments inside loops. If the interpreter finds that the switch variable x is not hashable, it should raise a TypeError at run-time pointing out the problem. There have been other proposals for the syntax which reuse existing keywords and avoid adding two new ones ("switch" and "case"). Others have argued that the keywords should use new terms to avoid confusion with the C keywords of the same name but slightly different semantics (e.g. fall-through without break). Some of the proposed variants: case EXPR: of CONSTANT: SUITE of CONSTANT: SUITE else: SUITE case EXPR: if CONSTANT: SUITE if CONSTANT: SUITE else: SUITE when EXPR: in CONSTANT_TUPLE: SUITE in CONSTANT_TUPLE: SUITE ... else: SUITE The switch statement could be extended to allow tuples of values for one section (e.g. case 'a', 'b', 'c': ...). Another proposed extension would allow ranges of values (e.g. case 10..14: ...). These should probably be post-poned, but already kept in mind when designing and implementing a first version. Examples: switch EXPR: switch x: case CONSTANT: case "first": SUITE print x case CONSTANT: case "second": SUITE x = x**2 ... print x else: else: SUITE print "whoops!" case EXPR: case x: of CONSTANT: of "first": SUITE print x of CONSTANT: of "second": SUITE print x**2 else: else: SUITE print "whoops!" case EXPR: case state: if CONSTANT: if "first": SUITE state = "second" if CONSTANT: if "second": SUITE state = "third" else: else: SUITE state = "first" when EXPR: when state: in CONSTANT_TUPLE: in ("first", "second"): SUITE print state in CONSTANT_TUPLE: state = next_state(state) SUITE in ("seventh",): ... print "done" else: break # out of loop! SUITE else: print "middle state" state = next_state(state) Scope XXX Explain "from __future__ import switch" Credits Martin von Löwis (issues with the optimization idea) Thomas Wouters (switch statement + byte code compiler example) Skip Montanaro (dispatching ideas, examples) Donald Beaudry (switch syntax) Greg Ewing (switch syntax) Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil End: From theller@users.sourceforge.net Mon Nov 12 12:52:03 2001 From: theller@users.sourceforge.net (Thomas Heller) Date: Mon, 12 Nov 2001 04:52:03 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/tools undoc_symbols.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv1214 Modified Files: undoc_symbols.py Log Message: No need to preprocess the header files - use ctags -I flag instead to remove DL_IMPORT. Index: undoc_symbols.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/undoc_symbols.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** undoc_symbols.py 2001/11/09 17:04:43 1.2 --- undoc_symbols.py 2001/11/12 12:52:01 1.3 *************** *** 2,9 **** Python include files, prefixed by their tag kind. ! First, a temporary file is written which contains all Python include ! files, with DL_IMPORT simply removed. This file is passed to ctags, ! and the output is parsed into a dictionary mapping symbol names to tag ! kinds. Then, the .tex files from Python docs are read into a giant string. --- 2,7 ---- Python include files, prefixed by their tag kind. ! Pass Python's include files to ctags, parse the output into a ! dictionary mapping symbol names to tag kinds. Then, the .tex files from Python docs are read into a giant string. *************** *** 17,26 **** # Doc sections to use ! DOCSECTIONS = ["api", "ext"] ! # Only print symbols starting with this prefix # to get all symbols, use an empty string PREFIX = "Py" # end of customization section --- 15,26 ---- # Doc sections to use ! DOCSECTIONS = ["api"]# ["api", "ext"] ! # Only print symbols starting with this prefix, # to get all symbols, use an empty string PREFIX = "Py" + INCLUDEPATTERN = "*.h" + # end of customization section *************** *** 58,83 **** names[name] = tag return names - - def print_undoc_symbols(prefix): - incfile = tempfile.mktemp(".h") - - fp = open(incfile, "w") - - for file in glob.glob(os.path.join(INCDIR, "*.h")): - text = open(file).read() - # remove all DL_IMPORT, they will confuse ctags - text = re.sub("DL_IMPORT", "", text) - fp.write(text) - fp.close() docs = [] for sect in DOCSECTIONS: ! for file in glob.glob(os.path.join(DOCDIR, sect, "*.tex")): docs.append(open(file).read()) docs = "\n".join(docs) ! fp = os.popen("ctags --c-types=%s -f - %s" % (TAG_KINDS, incfile)) dict = findnames(fp, prefix) names = dict.keys() --- 58,74 ---- names[name] = tag return names + def print_undoc_symbols(prefix, docdir, incdir): docs = [] for sect in DOCSECTIONS: ! for file in glob.glob(os.path.join(docdir, sect, "*.tex")): docs.append(open(file).read()) docs = "\n".join(docs) ! incfiles = os.path.join(incdir, INCLUDEPATTERN) ! ! fp = os.popen("ctags -IDL_IMPORT --c-types=%s -f - %s" % (TAG_KINDS, incfiles)) dict = findnames(fp, prefix) names = dict.keys() *************** *** 86,97 **** if docs.find(name) == -1: print dict[name], name - os.remove(incfile) if __name__ == '__main__': ! global INCDIR ! global DOCDIR ! SRCDIR = os.path.dirname(sys.argv[0]) ! INCDIR = os.path.normpath(os.path.join(SRCDIR, "../../Include")) ! DOCDIR = os.path.normpath(os.path.join(SRCDIR, "..")) ! print_undoc_symbols(PREFIX) --- 77,85 ---- if docs.find(name) == -1: print dict[name], name if __name__ == '__main__': ! srcdir = os.path.dirname(sys.argv[0]) ! incdir = os.path.normpath(os.path.join(srcdir, "../../Include")) ! docdir = os.path.normpath(os.path.join(srcdir, "..")) ! print_undoc_symbols(PREFIX, docdir, incdir) From jackjansen@users.sourceforge.net Mon Nov 12 14:11:15 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 12 Nov 2001 06:11:15 -0800 Subject: [Python-checkins] CVS: python/dist/src README,1.129,1.130 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv23997 Modified Files: README Log Message: OSX notes: - Added a note about the limit stack command - Revoved the note about largefile - Added a note about /usr/local not existing by default. Index: README =================================================================== RCS file: /cvsroot/python/python/dist/src/README,v retrieving revision 1.129 retrieving revision 1.130 diff -C2 -d -r1.129 -r1.130 *** README 2001/10/08 13:21:15 1.129 --- README 2001/11/12 14:11:13 1.130 *************** *** 396,403 **** '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 "--disable-toolbox-glue" to disable the glue code for the Carbon --- 396,402 ---- '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, if you do ! "limit stacksize 2048" before "make test" it should work. ! On naked Darwin you may have to add the configure option "--disable-toolbox-glue" to disable the glue code for the Carbon *************** *** 405,411 **** 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: --- 404,416 ---- by default as they are experimental, on real OSX you can enable them in setup.py). + + On a clean OSX /usr/local does not exist. Do a "sudo mkdir -m 775 /usr/local" + before you do a make install, this is better than "sudo make install" + which installs everything as superuser. + 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). You may ! also want to check out ./Mac/OSX for building a Python.app. Cygwin: Cygwin Python builds OOTB when configured as follows: From bwarsaw@users.sourceforge.net Mon Nov 12 14:57:20 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 12 Nov 2001 06:57:20 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0001.txt,1.27,1.28 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv4659 Modified Files: pep-0001.txt Log Message: Add a bit of information to descript the pep2html.py process. Index: pep-0001.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0001.txt,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** pep-0001.txt 2001/08/14 23:58:09 1.27 --- pep-0001.txt 2001/11/12 14:57:18 1.28 *************** *** 307,310 **** --- 307,323 ---- with the PEP author and/or PEP editor. + PEP authors who are also SF committers, can update the PEPs + themselves by using "cvs commit" to commit their changes. + Remember to also push the formatted PEP text out to the web by + doing the following: + + % python pep2html.py -i NUM + + where NUM is the number of the PEP you want to push out. See + + % python pep2html.py --help + + for details. + References and Footnotes From bwarsaw@users.sourceforge.net Mon Nov 12 14:58:09 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 12 Nov 2001 06:58:09 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep2html.py,1.28,1.29 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv4788 Modified Files: pep2html.py Log Message: Slight rewording of docstring. Index: pep2html.py =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep2html.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** pep2html.py 2001/08/14 21:42:39 1.28 --- pep2html.py 2001/11/12 14:58:07 1.29 *************** *** 5,12 **** Usage: %(PROGRAM)s [options] [peps] - Notes: - - The optional argument peps can be either pep numbers or .txt files. - Options: --- 5,8 ---- *************** *** 25,28 **** --- 21,26 ---- -h/--help Print this help message and exit. + + The optional argument `peps' is a list of either pep numbers or .txt files. """ From tim_one@users.sourceforge.net Mon Nov 12 22:26:12 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Mon, 12 Nov 2001 14:26:12 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules cPickle.c,2.68,2.69 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv27392/python/Modules Modified Files: cPickle.c Log Message: load_string(): Force use of unsigned compare in a context that was clearly (but incorrectly) assuming it. Index: cPickle.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cPickle.c,v retrieving revision 2.68 retrieving revision 2.69 diff -C2 -d -r2.68 -r2.69 *** cPickle.c 2001/11/09 10:06:23 2.68 --- cPickle.c 2001/11/12 22:26:10 2.69 *************** *** 2822,2831 **** if (*p=='\\') nslash++; else nslash=0; ! } ! if (*p==q) ! { ! for (p++; *p; p++) if (*p > ' ') goto insecure; ! } ! else goto insecure; /********************************************/ --- 2822,2833 ---- if (*p=='\\') nslash++; else nslash=0; ! } ! if (*p == q) { ! for (p++; *p; p++) ! if (*(unsigned char *)p > ' ') ! goto insecure; ! } ! else ! goto insecure; /********************************************/ From bwarsaw@users.sourceforge.net Tue Nov 13 18:00:42 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 13 Nov 2001 10:00:42 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib rfc822.py,1.63,1.64 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv9389/Lib Modified Files: rfc822.py Log Message: parsedate_tz(): If data is false, return None. Fixes bug #478115, IndexError when a Date: field exists with an empty value. Index: rfc822.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/rfc822.py,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** rfc822.py 2001/09/04 19:14:14 1.63 --- rfc822.py 2001/11/13 18:00:40 1.64 *************** *** 859,862 **** --- 859,864 ---- Accounts for military timezones. """ + if not data: + return None data = data.split() if data[0][-1] in (',', '.') or data[0].lower() in _daynames: From bwarsaw@users.sourceforge.net Tue Nov 13 18:01:39 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 13 Nov 2001 10:01:39 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_email.py,1.17,1.18 test_rfc822.py,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv9739/Lib/test Modified Files: test_email.py test_rfc822.py Log Message: Add tests for bug #478115, parsedate_tz() IndexError when a Date: field exists with an empty value. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** test_email.py 2001/11/09 19:31:34 1.17 --- test_email.py 2001/11/13 18:01:37 1.18 *************** *** 938,941 **** --- 938,944 ---- self.assertEqual(offset, toff) + def test_parsedate(self): + self.assertEqual(Utils.parsedate(''), None) + Index: test_rfc822.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_rfc822.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** test_rfc822.py 2001/09/20 21:33:42 1.13 --- test_rfc822.py 2001/11/13 18:01:37 1.14 *************** *** 119,122 **** --- 119,130 ---- self.check( + 'To: Some One \n' + 'From: Anudder Persin \n' + 'Date:\n' + '\n' + 'test', + [('Some One', 'someone@dom.ain')]) + + self.check( 'To: person@dom.ain (User J. Person)\n\n', [('User J. Person', 'person@dom.ain')]) From bwarsaw@users.sourceforge.net Tue Nov 13 19:12:05 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 13 Nov 2001 11:12:05 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0009.txt,1.5,1.6 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv28628 Modified Files: pep-0009.txt Log Message: Added a note that the plain text version of the file should be used as the template, not the HTML version. Index: pep-0009.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0009.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pep-0009.txt 2001/09/07 22:45:52 1.5 --- pep-0009.txt 2001/11/13 19:12:03 1.6 *************** *** 16,19 **** --- 16,26 ---- own PEPs to the style outlined in PEP 1, PEP Guidelines[1]. + Note: if you are reading this PEP via the web, you should first + grab the plain text version in order to complete the steps below. + DO NOT USE THE HTML FILE AS YOUR TEMPLATE! + + To get the plain text version of this file, look at the top of the + page and click on the link titled "PEP Source". + Rationale From tim_one@users.sourceforge.net Tue Nov 13 20:11:57 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 13 Nov 2001 12:11:57 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules newmodule.c,2.36,2.37 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv13279/python/Modules Modified Files: newmodule.c Log Message: new_code(): The last patch to this left behind an unreferenced local; deleted its declaration. Index: newmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/newmodule.c,v retrieving revision 2.36 retrieving revision 2.37 diff -C2 -d -r2.36 -r2.37 *** newmodule.c 2001/11/09 22:02:27 2.36 --- newmodule.c 2001/11/13 20:11:55 2.37 *************** *** 125,129 **** int firstlineno; PyObject* lnotab; - PyBufferProcs *pb; if (!PyArg_ParseTuple(args, "iiiiSO!O!O!SSiS|O!O!:code", --- 125,128 ---- From bwarsaw@users.sourceforge.net Tue Nov 13 20:16:55 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 13 Nov 2001 12:16:55 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_dumbdbm.py,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv14888 Modified Files: test_dumbdbm.py Log Message: Committing the second part of patch #480902, an improved test suite for dumbdbm.py, by Skip Montanaro. The first half of Skip's patch has been postponed until Py2.3 since it adds new features. Index: test_dumbdbm.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_dumbdbm.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_dumbdbm.py 2001/01/19 21:06:50 1.2 --- test_dumbdbm.py 2001/11/13 20:16:52 1.3 *************** *** 4,37 **** """ ! # XXX This test is a disgrace. It doesn't test that it works. ! import dumbdbm as dbm ! from dumbdbm import error ! from test_support import verbose, TESTFN as filename ! d = dbm.open(filename, 'c') ! d['a'] = 'b' ! d['12345678910'] = '019237410982340912840198242' ! d.keys() ! if d.has_key('a'): ! if verbose: ! print 'Test dbm keys: ', d.keys() ! d.close() ! d = dbm.open(filename, 'r') ! d.close() ! d = dbm.open(filename, 'w') ! d.close() ! d = dbm.open(filename, 'n') ! d.close() ! import os ! def rm(fn): ! try: ! os.unlink(fn) ! except os.error: ! pass ! rm(filename + '.dir') ! rm(filename + '.dat') ! rm(filename + '.bak') --- 4,72 ---- """ ! import os ! import test_support ! import unittest ! import dumbdbm ! import tempfile ! class DumbDBMTestCase(unittest.TestCase): ! _fname = tempfile.mktemp() ! _dict = {'0': '', ! 'a': 'Python:', ! 'b': 'Programming', ! 'c': 'the', ! 'd': 'way', ! 'f': 'Guido', ! 'g': 'intended' ! } ! def __init__(self, *args): ! unittest.TestCase.__init__(self, *args) ! self._dkeys = self._dict.keys() ! self._dkeys.sort() ! ! def test_dumbdbm_creation(self): ! for ext in [".dir", ".dat", ".bak"]: ! try: os.unlink(self._fname+ext) ! except OSError: pass ! f = dumbdbm.open(self._fname, 'c') ! self.assertEqual(f.keys(), []) ! for key in self._dict: ! f[key] = self._dict[key] ! self.read_helper(f) ! f.close() ! def test_dumbdbm_modification(self): ! f = dumbdbm.open(self._fname, 'w') ! self._dict['g'] = f['g'] = "indented" ! self.read_helper(f) ! f.close() ! def test_dumbdbm_read(self): ! f = dumbdbm.open(self._fname, 'r') ! self.read_helper(f) ! f.close() ! ! def test_dumbdbm_keys(self): ! f = dumbdbm.open(self._fname) ! keys = self.keys_helper(f) ! f.close() ! ! def read_helper(self, f): ! keys = self.keys_helper(f) ! for key in self._dict: ! self.assertEqual(self._dict[key], f[key]) ! ! def keys_helper(self, f): ! keys = f.keys() ! keys.sort() ! self.assertEqual(keys, self._dkeys) ! return keys ! ! def test_main(): ! test_support.run_unittest(DumbDBMTestCase) ! ! ! if __name__ == "__main__": ! test_main() From bwarsaw@users.sourceforge.net Tue Nov 13 20:25:45 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 13 Nov 2001 12:25:45 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0273.txt,1.5,1.6 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv17128 Modified Files: pep-0273.txt Log Message: Jim's latest revision. Index: pep-0273.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0273.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pep-0273.txt 2001/11/02 20:44:57 1.5 --- pep-0273.txt 2001/11/13 20:25:43 1.6 *************** *** 13,17 **** Abstract This PEP adds the ability to import Python modules ! *.py, *.py[co] and packages from zip archives. --- 13,19 ---- Abstract This PEP adds the ability to import Python modules ! *.py, *.py[co] and packages from zip archives. The ! same code is used to speed up normal directory imports ! provided os.listdir is available. *************** *** 35,43 **** import all Python library files from an archive. - Reading compressed zip archives requires the zlib module. An - import of zlib will be attempted prior to any other imports. If - zlib is not available at that time, only uncompressed archives - will be readable, even if zlib subsequently becomes available. - Subdirectory Equivalence --- 37,40 ---- *************** *** 45,51 **** The zip archive must be treated exactly as a subdirectory tree so we can support package imports based on current and future rules. ! Zip archive files must be created with relative path names. That ! is, archive file names are of the form: file1, file2, dir1/file3, ! dir2/dir3/file4. Suppose sys.path contains "/A/B/SubDir" and "/C/D/E/Archive.zip", --- 42,47 ---- The zip archive must be treated exactly as a subdirectory tree so we can support package imports based on current and future rules. ! All zip data is taked from the Central Directory, the data must be ! correct, and brain dead zip files are not accommodated. Suppose sys.path contains "/A/B/SubDir" and "/C/D/E/Archive.zip", *************** *** 94,120 **** easy. zlib Compressed zip archives require zlib for decompression. Prior to ! any other imports, we attempt an import of zlib, and set a flag if ! it is available. All compressed files are invisible unless this ! flag is true. ! ! It could happen that zlib was available later. For example, the ! import of site.py might add the correct directory to sys.path so a ! dynamic load succeeds. But compressed files will still be ! invisible. It is unknown if it can happen that importing site.py ! can cause zlib to appear, so maybe we're worrying about nothing. ! On Windows and Linux, the early import of zlib succeeds without ! site.py. ! ! The problem here is the confusion caused by the reverse. Either a ! zip file satisfies imports or it doesn't. It is silly to say that ! site.py needs to be uncompressed, and that maybe imports will ! succeed later. If you don't like this, create uncompressed zip ! archives or make sure zlib is available, for example, as a ! built-in module. Or we can write special search logic during zip ! initialization. --- 90,103 ---- easy. + This same mechanism is used to speed up directory (non-zip) imports. + See below. + zlib Compressed zip archives require zlib for decompression. Prior to ! any other imports, we attempt an import of zlib. Import of ! compressed files will fail with a message "missing zlib" unless ! zlib is available. *************** *** 134,146 **** Python versions on the same machine. ! I propose that there is one name added to sys.path, and the ! file name is "python%s%s.zip" % (sys.version[0], sys.version[2]). ! For example, python22.zip. This is the same on all platforms. ! On Unix, the directory is sys.prefix + "/lib". So for prefix ! /usr/local, the path /usr/local/lib/python2.2/ is already on ! sys.path, and /usr/local/lib/python22.zip would be added. ! On Windows, the directory is the directory of sys.executable. ! The zip archive name is always inserted as the second item ! in sys.path. The first is the directory of the main.py (thanks Tim). Implementation --- 117,179 ---- Python versions on the same machine. ! We add one name to sys.path. On Unix, the directory is ! sys.prefix + "/lib", and the file name is ! "python%s%s.zip" % (sys.version[0], sys.version[2]). ! So for Python 2.2 and prefix /usr/local, the path ! /usr/local/lib/python2.2/ is already on sys.path, and ! /usr/local/lib/python22.zip would be added. ! On Windows, the file is the full path to python22.dll, with ! "dll" replaced by "zip". The zip archive name is always inserted ! as the second item in sys.path. The first is the directory of the ! main.py (thanks Tim). ! ! ! Directory Imports ! ! The static Python dictionary used to speed up zip imports can be ! used to speed up normal directory imports too. For each item in ! sys.path that is not a zip archive, we call os.listdir, and add ! the directory contents to the dictionary. Then instead of calling ! fopen() in a double loop, we just check the dictionary. This ! greatly speeds up imports. If os.listdir doesn't exist, the ! dictionary is not used. ! ! ! Benchmarks ! ! Case Original 2.2a3 Using os.listdir Zip Uncomp Zip Compr ! ---- ----------------- ----------------- ---------- ---------- ! 1 3.2 2.5 3.2->1.02 2.3 2.5 2.3->0.87 1.66->0.93 1.5->1.07 ! 2 2.8 3.9 3.0->1.32 Same as Case 1. ! 3 5.7 5.7 5.7->5.7 2.1 2.1 2.1->1.8 1.25->0.99 1.19->1.13 ! 4 9.4 9.4 9.3->9.35 Same as Case 3. ! ! Case 1: Local drive C:, sys.path has its default value. ! Case 2: Local drive C:, directory with files is at the end of sys.path. ! Case 3: Network drive, sys.path has its default value. ! Case 4: Network drive, directory with files is at the end of sys.path. ! ! Benchmarks were performed on a Pentium 4 clone, 1.4 GHz, 256 Meg. ! The machine was running Windows 2000 with a Linux/Samba network server. ! Times are in seconds, and are the time to import about 100 Lib modules. ! Case 2 and 4 have the "correct" directory moved to the end of sys.path. ! "Uncomp" means uncompressed zip archive, "Compr" means compressed. ! ! Initial times are after a re-boot of the system; the time after ! "->" is the time after repeated runs. Times to import from C: ! after a re-boot are rather highly variable for the "Original" case, ! but are more realistic. ! ! ! Custom Imports ! ! The logic demonstrates the ability to import using default searching ! until a needed Python module (in this case, os) becomes available. ! This can be used to bootstrap custom importers. For example, if ! "importer()" in __init__.py exists, then it could be used for imports. ! The "importer()" can freely import os and other modules, and these ! will be satisfied from the default mechanism. This PEP does not ! define any custom importers, and this note is for information only. ! Implementation From bwarsaw@users.sourceforge.net Tue Nov 13 20:52:22 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 13 Nov 2001 12:52:22 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0000.txt,1.146,1.147 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv24561 Modified Files: pep-0000.txt Log Message: PEP 276, Simple Iterator for ints, Jim Althoff Index: pep-0000.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0000.txt,v retrieving revision 1.146 retrieving revision 1.147 diff -C2 -d -r1.146 -r1.147 *** pep-0000.txt 2001/11/12 05:55:58 1.146 --- pep-0000.txt 2001/11/13 20:52:20 1.147 *************** *** 87,90 **** --- 87,91 ---- S 274 Dict Comprehensions Warsaw S 275 Switching on Multiple Values Lemburg + S 276 Simple Iterator for ints Althoff Finished PEPs (done, implemented in CVS) *************** *** 231,234 **** --- 232,236 ---- S 274 Dict Comprehensions Warsaw S 275 Switching on Multiple Values Lemburg + S 276 Simple Iterator for ints Althoff *************** *** 247,252 **** name email address ---------------- ------------- - Ahlstrom, James C. jim@interet.com Aahz aahz@pobox.com Ascher, David davida@activestate.com Barrett, Paul barrett@stsci.edu --- 249,255 ---- name email address ---------------- ------------- Aahz aahz@pobox.com + Ahlstrom, James C. jim@interet.com + Althoff, Jim james_althoff@i2.com Ascher, David davida@activestate.com Barrett, Paul barrett@stsci.edu From bwarsaw@users.sourceforge.net Tue Nov 13 20:52:39 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 13 Nov 2001 12:52:39 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0276.txt,NONE,1.1 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv24640 Added Files: pep-0276.txt Log Message: PEP 276, Simple Iterator for ints, Jim Althoff --- NEW FILE: pep-0276.txt --- PEP: 276 Title: Simple Iterator for ints Version: $Revision: 1.1 $ Last-Modified: $Date: 2001/11/13 20:52:37 $ Author: james_althoff@i2.com (Jim Althoff) Status: Draft Type: Standards Track Created: 12-Nov-2001 Python-Version: 2.3 Post-History: Abstract Python 2.1 added new functionality to support iterators[1]. Iterators have proven to be useful and convenient in many coding situations. It is noted that the implementation of Python's for-loop control structure uses the iterator protocol as of release 2.1. It is also noted that Python provides iterators for the following builtin types: lists, tuples, dictionaries, strings, and files. This PEP proposes the addition of an iterator for the builtin type int (types.IntType). Such an iterator would simplify the coding of certain for-loops in Python. Specification Define an iterator for types.intType (i.e., the builtin type "int") that is returned from the builtin function "iter" when called with an instance of types.intType as the argument. The returned iterator has the following behavior: - Assume that object i is an instance of types.intType (the builtin type int) and that i > 0 - iter(i) returns an iterator object - said iterator object iterates through the sequence of ints 0,1,2,...,i-1 Example: iter(5) returns an iterator object that iterates through the sequence of ints 0,1,2,3,4 - if i <= 0, iter(i) returns an "empty" iterator, i.e., one that throws StopIteration upon the first call of its "next" method In other words, the conditions and semantics of said iterator is consistent with the conditions and semantics of the range() and xrange() functions. Note that the sequence 0,1,2,...,i-1 associated with the int i is considered "natural" in the context of Python programming because it is consistent with the builtin indexing protocol of sequences in Python. Python lists and tuples, for example, are indexed starting at 0 and ending at len(object)-1 (when using positive indices). In other words, such objects are indexed with the sequence 0,1,2,...,len(object)-1 Rationale A common programming idiom is to take a collection of objects and apply some operation to each item in the collection in some established sequential order. Python provides the "for in" looping control structure for handling this common idiom. Cases arise, however, where it is necessary (or more convenient) to access each item in an "indexed" collection by iterating through each index and accessing each item in the collection using the corresponding index. For example, one might have a two-dimensional "table" object where one requires the application of some operation to the first column of each row in the table. Depending on the implementation of the table it might not be possible to access first each row and then each column as individual objects. It might, rather, be possible to access a cell in the table using a row index and a column index. In such a case it is necessary to use an idiom where one iterates through a sequence of indices (indexes) in order to access the desired items in the table. (Note that the commonly used DefaultTableModel class in Java-Swing-Jython has this very protocol). Another common example is where one needs to process two or more collections in parallel. Another example is where one needs to access, say, every second item in a collection. There are many other examples where access to items in a collection is facilitated by a computation on an index thus necessitating access to the indices rather than direct access to the items themselves. Let's call this idiom the "indexed for-loop" idiom. Some programming languages provide builtin syntax for handling this idiom. In Python the common convention for implementing the indexed for-loop idiom is to use the builtin range() or xrange() function to generate a sequence of indices as in, for example: for rowcount in range(table.getRowCount()): print table.getValueAt(rowcount, 0) or for rowcount in xrange(table.getRowCount()): print table.getValueAt(rowcount, 0) From time to time there are discussions in the Python community about the indexed for-loop idiom. It is sometimes argued that the need for using the range() or xrange() function for this design idiom is: - Not obvious (to new-to-Python programmers), - Error prone (easy to forget, even for experienced Python programmers) - Confusing and distracting for those who feel compelled to understand the differences and recommended usage of xrange() vis-a-vis range() - Unwieldy, especially when combined with the len() function, i.e., xrange(len(sequence)) - Not as convenient as equivalent mechanisms in other languages, - Annoying, a "wart", etc. And from time to time proposals are put forth for ways in which Python could provide a better mechanism for this idiom. Recent examples include PEP 204, "Range Literals", and PEP 212, "Loop Counter Iteration". Most often, such proposal include changes to Python's syntax and other "heavyweight" changes. Part of the difficulty here is that advocating new syntax implies a comprehensive solution for "general indexing" that has to include aspects like: - starting index value - ending index value - step value - open intervals versus closed intervals versus half opened intervals Finding a new syntax that is comprehensive, simple, general, Pythonic, appealing to many, easy to implement, not in conflict with existing structures, not excessively overloading of existing structures, etc. has proven to be more difficult than one might anticipate. The proposal outlined in this PEP tries to address the problem by suggesting a simple "lightweight" solution that helps the most common case by using a proven mechanism that is already available (as of Python 2.1): namely, iterators. Because for-loops already use "iterator" protocol as of Python 2.1, adding an iterator for types.IntType as proposed in this PEP would enable by default the following shortcut for the indexed for-loop idiom: for rowcount in table.getRowCount(): print table.getValueAt(rowcount, 0) The following benefits for this approach vis-a-vis the current mechanism of using the range() or xrange() functions are claimed to be: - Simpler, - Less cluttered, - Focuses on the problem at hand without the need to resort to secondary implementation-oriented functions (range() and xrange()) And compared to other proposals for change: - Requires no new syntax - Requires no new keywords - Takes advantage of the new and well-established iterator mechanism And generally: - Is consistent with iterator-based "convenience" changes already included (as of Python 2.1) for other builtin types such as: lists, tuples, dictionaries, strings, and files. Preliminary discussion on the Python interest mailing list suggests a reasonable amount of initial support for this PEP (along with some dissents/issues noted below). Backwards Compatibility The proposed mechanism is generally backwards compatible as it calls for neither new syntax nor new keywords. All existing, valid Python programs should continue to work unmodified. However, this proposal is not perfectly backwards compatible in the sense that certain statements that are currently invalid would, under the current proposal, become valid. Tim Peters has pointed out two such examples: 1) The common case where one forgets to include range() or xrange(), for example: for rowcount in table.getRowCount(): print table.getValueAt(rowcount, 0) in Python 2.2 raises a TypeError exception. Under the current proposal, the above statement would be valid and would work as (presumably) intended. Presumably, this is a good thing. As noted by Tim, this is the common case of the "forgotten range" mistake (which one currently corrects by adding a call to range() or xrange()). 2) The (hopefully) very uncommon case where one makes a typing mistake when using tuple unpacking. For example: x, = 1 in Python 2.2 raises a TypeError exception. Under the current proposal, the above statement would be valid and would set x to 0. The PEP author has no data as to how common this typing error is nor how difficult it would be to catch such an error under the current proposal. He imagines that it does not occur frequently and that it would be relatively easy to correct should it happen. Issues: Based on some preliminary discussion on the Python interest mailing list, the following concerns have been voiced: - Is it obvious that iter(5) maps to the sequence 0,1,2,3,4? Response: Given, as noted above, that Python has a strong convention for indexing sequences starting at 0 and stopping at (inclusively) the index whose value is one less than the length of the sequence, it is argued that the proposed sequence is reasonably intuitive to a Python programmer while being useful and practical. - "in" (as in "for i in x") does not match standard English usage in this case. "up to" or something similar might be better. Response: Not everyone felt that matching standard English perfectly is a requirement. It is noted that "for:else:" doesn't match standard English very well either. And few are excited about adding a new keyword, especially just to get a somewhat better match to standard English usage. - Possible ambiguity for i in 10: print i might be mistaken for for i in (10,): print i Response: The predicted ambiguity was not readily apparent to several of the posters. - It would be better to add special new syntax such as: for i in 0..10: print i Response: There are other PEPs that take this approach[2][3]. - It would be better to reuse the ellipsis literal syntax (...) Response: Shares disadvantages of other proposals that require changes to the syntax. Needs more design to determine how it would handle the general case of start,stop,step, open/closed/half-closed intervals, etc. Needs a PEP. - It would be better to reuse the slicing literal syntax attached to the int class, e.g., int[0:10] Response: Same as previous response. In addition, design consideration needs to be given to what it would mean if one uses slicing syntax after some arbitrary class other than class int. Needs a PEP. - Might dissuade newbies from using the indexed for-loop idiom when the standard "for item in collection:" idiom is clearly better. Response: The standard idiom is so nice when "it fits" that it needs neither extra "carrot" nor "stick". On the other hand, one does notice cases of overuse/misuse of the standard idiom (due, most likely, to the awkwardness of the indexed for-loop idiom), as in: for item in sequence: print sequence.index(item) - Doesn't handle the general case of start,stop,step Response: use the existing range() or xrange() mechanisms. Or, see below. Extension If one wants to handle general indexing (start,stop,step) without having to resort to using the range() or xrange() functions then the following could be incorporated into the current proposal. Add an "iter" method (or use some other preferred name) to types.IntType with the following signature: def iter(start=0, step=1): This method would have the (hopefully) obvious semantics. Then one could do, for example: x = 100 for i in x.iter(start=1, step=2): print i Under this extension (for x bound to an int), for i in x: would be equivalent to for i in x.iter(): and to for i in x.iter(start=0, step=1): This extension is consistent with the generalization provided by the current mechanism for dictionaries whereby one can use: for k in d.iterkeys(): for v in d.itervalues(): for k,v in d.iteritems(): depending on one's needs, given that for i in d: has a meaning aimed at the most common and useful case (d.iterkeys()). Implementation An implementation is not available at this time and although the author is not qualified to comment on such he will, nonetheless, speculate that this might be straightforward and, hopefully, might consist of little more than setting the tp_iter slot in types.IntType to point to a simple iterator function that would be similar to -- or perhaps even a wrapper around -- the xrange() function. References [1] PEP 234, Iterators http://python.sourceforge.net/peps/pep-0234.html [2] PEP 204, Range Literals http://python.sourceforge.net/peps/pep-0204.html [3] PEP 212, Loop Counter Iteration http://python.sourceforge.net/peps/pep-0212.html Copyright This document has been placed in the public domain. Local Variables: mode: indented-text indent-tabs-mode: nil fill-column: 70 End: From bwarsaw@users.sourceforge.net Tue Nov 13 21:30:39 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 13 Nov 2001 13:30:39 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib rfc822.py,1.64,1.65 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv3192 Modified Files: rfc822.py Log Message: Fix for bug #481221, getaddrlist() failing on long addresses. Index: rfc822.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/rfc822.py,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** rfc822.py 2001/11/13 18:00:40 1.64 --- rfc822.py 2001/11/13 21:30:37 1.65 *************** *** 547,554 **** Returns a list containing all of the addresses. """ ! ad = self.getaddress() ! if ad: ! return ad + self.getaddrlist() ! else: return [] def getaddress(self): --- 547,558 ---- Returns a list containing all of the addresses. """ ! result = [] ! while 1: ! ad = self.getaddress() ! if ad: ! result += ad ! else: ! break ! return result def getaddress(self): From bwarsaw@users.sourceforge.net Tue Nov 13 21:33:54 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 13 Nov 2001 13:33:54 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_rfc822.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv3892 Modified Files: test_rfc822.py Log Message: A specific test for bug #481221, getaddrlist() failing on long addresses. Commented out because it still takes too long to run. Index: test_rfc822.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_rfc822.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** test_rfc822.py 2001/11/13 18:01:37 1.14 --- test_rfc822.py 2001/11/13 21:33:52 1.15 *************** *** 186,189 **** --- 186,197 ---- [('User J. Person', 'person@dom.ain')]) + # This takes to long to add to the test suite + ## def test_an_excrutiatingly_long_address_field(self): + ## OBSCENELY_LONG_HEADER_MULTIPLIER = 10000 + ## oneaddr = ('Person' * 10) + '@' + ('.'.join(['dom']*10)) + '.com' + ## addr = ', '.join([oneaddr] * OBSCENELY_LONG_HEADER_MULTIPLIER) + ## lst = rfc822.AddrlistClass(addr).getaddrlist() + ## self.assertEqual(len(lst), OBSCENELY_LONG_HEADER_MULTIPLIER) + def test_main(): From tim_one@users.sourceforge.net Tue Nov 13 21:51:28 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 13 Nov 2001 13:51:28 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib hmac.py,1.3,1.4 pprint.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv8531/python/Lib Modified Files: hmac.py pprint.py Log Message: Whitespace normalization. Index: hmac.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/hmac.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** hmac.py 2001/11/02 21:49:20 1.3 --- hmac.py 2001/11/13 21:51:26 1.4 *************** *** 36,40 **** self.inner = digestmod.new() self.digest_size = digestmod.digest_size ! blocksize = 64 ipad = "\x36" * blocksize --- 36,40 ---- self.inner = digestmod.new() self.digest_size = digestmod.digest_size ! blocksize = 64 ipad = "\x36" * blocksize *************** *** 98,100 **** """ return HMAC(key, msg, digestmod) - --- 98,99 ---- Index: pprint.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pprint.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** pprint.py 2001/11/01 17:50:38 1.17 --- pprint.py 2001/11/13 21:51:26 1.18 *************** *** 284,288 **** del context[objid] return format % _commajoin(components), readable, recursive ! rep = `object` return rep, (rep and not rep.startswith('<')), 0 --- 284,288 ---- del context[objid] return format % _commajoin(components), readable, recursive ! rep = `object` return rep, (rep and not rep.startswith('<')), 0 From tim_one@users.sourceforge.net Tue Nov 13 21:51:28 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 13 Nov 2001 13:51:28 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_dumbdbm.py,1.3,1.4 test_hmac.py,1.2,1.3 test_pep247.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv8531/python/Lib/test Modified Files: test_dumbdbm.py test_hmac.py test_pep247.py Log Message: Whitespace normalization. Index: test_dumbdbm.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_dumbdbm.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** test_dumbdbm.py 2001/11/13 20:16:52 1.3 --- test_dumbdbm.py 2001/11/13 21:51:26 1.4 *************** *** 25,29 **** self._dkeys = self._dict.keys() self._dkeys.sort() ! def test_dumbdbm_creation(self): for ext in [".dir", ".dat", ".bak"]: --- 25,29 ---- self._dkeys = self._dict.keys() self._dkeys.sort() ! def test_dumbdbm_creation(self): for ext in [".dir", ".dat", ".bak"]: *************** *** 58,62 **** for key in self._dict: self.assertEqual(self._dict[key], f[key]) ! def keys_helper(self, f): keys = f.keys() --- 58,62 ---- for key in self._dict: self.assertEqual(self._dict[key], f[key]) ! def keys_helper(self, f): keys = f.keys() Index: test_hmac.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_hmac.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** test_hmac.py 2001/11/02 21:49:59 1.2 --- test_hmac.py 2001/11/13 21:51:26 1.3 *************** *** 46,50 **** except: self.fail("Constructor call with sha module raised exception.") ! class SanityTestCase(unittest.TestCase): def test_default_is_md5(self): --- 46,50 ---- except: self.fail("Constructor call with sha module raised exception.") ! class SanityTestCase(unittest.TestCase): def test_default_is_md5(self): *************** *** 107,109 **** if __name__ == "__main__": test_main() - --- 107,108 ---- Index: test_pep247.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pep247.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_pep247.py 2001/11/02 21:46:17 1.1 --- test_pep247.py 2001/11/13 21:51:26 1.2 *************** *** 1,5 **** # # Test suite to check compliance with PEP 247, the standard API for ! # hashing algorithms. # --- 1,5 ---- # # Test suite to check compliance with PEP 247, the standard API for ! # hashing algorithms. # From jhylton@users.sourceforge.net Tue Nov 13 22:03:22 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Tue, 13 Nov 2001 14:03:22 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_compile.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv12427/Lib/test Modified Files: test_compile.py Log Message: Don't munge __debug__ and leave it that way. Index: test_compile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_compile.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** test_compile.py 2001/11/09 19:49:49 1.9 --- test_compile.py 2001/11/13 22:03:20 1.10 *************** *** 10,14 **** --- 10,16 ---- import __builtin__ + prev = __builtin__.__debug__ setattr(__builtin__, '__debug__', 'sure') + setattr(__builtin__, '__debug__', prev) if verbose: From bwarsaw@users.sourceforge.net Tue Nov 13 23:08:28 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 13 Nov 2001 15:08:28 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python pythonrun.c,2.149,2.150 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv31738 Modified Files: pythonrun.c Log Message: PyOS_getsig(), PyOS_setsig(): The minimal amount of work to avoid the uninitialized memory reads reported in bug #478001. Note that this doesn't address the following larger issues: - Error conditions are not documented for PyOS_*sig() in the C API. - Nothing that actually calls PyOS_*sig() in the core interpreter and extension modules actually /checks/ the return value of the call. Fixing those is left as an exercise for a later day. Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.149 retrieving revision 2.150 diff -C2 -d -r2.149 -r2.150 *** pythonrun.c 2001/10/12 22:14:26 2.149 --- pythonrun.c 2001/11/13 23:08:26 2.150 *************** *** 1438,1441 **** --- 1438,1447 ---- #ifdef HAVE_SIGACTION struct sigaction context; + /* Initialize context.sa_handler to SIG_ERR which makes about as + * much sense as anything else. It should get overwritten if + * sigaction actually succeeds and otherwise we avoid an + * uninitialized memory read. + */ + context.sa_handler = SIG_ERR; sigaction(sig, NULL, &context); return context.sa_handler; *************** *** 1454,1457 **** --- 1460,1469 ---- struct sigaction context; PyOS_sighandler_t oldhandler; + /* Initialize context.sa_handler to SIG_ERR which makes about as + * much sense as anything else. It should get overwritten if + * sigaction actually succeeds and otherwise we avoid an + * uninitialized memory read. + */ + context.sa_handler = SIG_ERR; sigaction(sig, NULL, &context); oldhandler = context.sa_handler; From tim_one@users.sourceforge.net Tue Nov 13 23:11:21 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 13 Nov 2001 15:11:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_mmap,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv31339/python/Lib/test/output Modified Files: test_mmap Log Message: CVS patch #477161: New "access" keyword for mmap, from Jay T Miller. This gives mmap() on Windows the ability to create read-only, write- through and copy-on-write mmaps. A new keyword argument is introduced because the mmap() signatures diverged between Windows and Unix, so while they (now) both support this functionality, there wasn't a way to spell it in a common way without introducing a new spelling gimmick. The old spellings are still accepted, so there isn't a backward- compatibility issue here. Index: test_mmap =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_mmap,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_mmap 2001/01/24 21:48:20 1.6 --- test_mmap 2001/11/13 23:11:19 1.7 *************** *** 18,20 **** --- 18,33 ---- Try to seek to negative position... Attempting resize() + Creating 10 byte test data file. + Opening mmap with access=ACCESS_READ + Ensuring that readonly mmap can't be slice assigned. + Ensuring that readonly mmap can't be item assigned. + Ensuring that readonly mmap can't be write() to. + Ensuring that readonly mmap can't be write_byte() to. + Ensuring that readonly mmap can't be resized. + Opening mmap with access=ACCESS_WRITE + Modifying write-through memory map. + Opening mmap with access=ACCESS_COPY + Modifying copy-on-write memory map. + Ensuring copy-on-write maps cannot be resized. + Ensuring invalid access parameter raises exception. Test passed From tim_one@users.sourceforge.net Tue Nov 13 23:11:21 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 13 Nov 2001 15:11:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.311,1.312 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv31339/python/Misc Modified Files: NEWS Log Message: CVS patch #477161: New "access" keyword for mmap, from Jay T Miller. This gives mmap() on Windows the ability to create read-only, write- through and copy-on-write mmaps. A new keyword argument is introduced because the mmap() signatures diverged between Windows and Unix, so while they (now) both support this functionality, there wasn't a way to spell it in a common way without introducing a new spelling gimmick. The old spellings are still accepted, so there isn't a backward- compatibility issue here. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.311 retrieving revision 1.312 diff -C2 -d -r1.311 -r1.312 *** NEWS 2001/11/09 21:06:24 1.311 --- NEWS 2001/11/13 23:11:19 1.312 *************** *** 37,40 **** --- 37,47 ---- Extension modules + - mmap has a new keyword argument, "access", allowing a uniform way for + both Windows and Unix users to create read-only, write-through and + copy-on-write memory mappings. This was previously possible only on + Unix. A new keyword argument was required to support this in a + uniform way because the mmap() signuatures had diverged across + platforms. Thanks to Jay T Miller for repairing this! + - By default, the gc.garbage list now contains only those instances in unreachable cycles that have __del__ methods; in 2.1 it contained all *************** *** 56,60 **** Library ! - tkFileDialog exposes a Directory class and askdirectory convenience function. --- 63,67 ---- Library ! - tkFileDialog exposes a Directory class and askdirectory convenience function. From tim_one@users.sourceforge.net Tue Nov 13 23:11:21 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 13 Nov 2001 15:11:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_mmap.py,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv31339/python/Lib/test Modified Files: test_mmap.py Log Message: CVS patch #477161: New "access" keyword for mmap, from Jay T Miller. This gives mmap() on Windows the ability to create read-only, write- through and copy-on-write mmaps. A new keyword argument is introduced because the mmap() signatures diverged between Windows and Unix, so while they (now) both support this functionality, there wasn't a way to spell it in a common way without introducing a new spelling gimmick. The old spellings are still accepted, so there isn't a backward- compatibility issue here. Index: test_mmap.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_mmap.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** test_mmap.py 2001/05/11 14:29:21 1.17 --- test_mmap.py 2001/11/13 23:11:19 1.18 *************** *** 1,3 **** ! from test_support import verify, TESTFN import mmap import os, re --- 1,3 ---- ! from test_support import verify, vereq, TESTFN import mmap import os, re *************** *** 26,38 **** print type(m) # SF bug 128713: segfaulted on Linux print ' Position of foo:', m.find('foo') / float(PAGESIZE), 'pages' ! verify(m.find('foo') == PAGESIZE) print ' Length of file:', len(m) / float(PAGESIZE), 'pages' ! verify(len(m) == 2*PAGESIZE) print ' Contents of byte 0:', repr(m[0]) ! verify(m[0] == '\0') print ' Contents of first 3 bytes:', repr(m[0:3]) ! verify(m[0:3] == '\0\0\0') # Modify the file's content --- 26,38 ---- print type(m) # SF bug 128713: segfaulted on Linux print ' Position of foo:', m.find('foo') / float(PAGESIZE), 'pages' ! vereq(m.find('foo'), PAGESIZE) print ' Length of file:', len(m) / float(PAGESIZE), 'pages' ! vereq(len(m), 2*PAGESIZE) print ' Contents of byte 0:', repr(m[0]) ! vereq(m[0], '\0') print ' Contents of first 3 bytes:', repr(m[0:3]) ! vereq(m[0:3], '\0\0\0') # Modify the file's content *************** *** 43,51 **** # Check that the modification worked print ' Contents of byte 0:', repr(m[0]) ! verify(m[0] == '3') print ' Contents of first 3 bytes:', repr(m[0:3]) ! verify(m[0:3] == '3\0\0') print ' Contents of second page:', repr(m[PAGESIZE-1 : PAGESIZE + 7]) ! verify(m[PAGESIZE-1 : PAGESIZE + 7] == '\0foobar\0') m.flush() --- 43,51 ---- # Check that the modification worked print ' Contents of byte 0:', repr(m[0]) ! vereq(m[0], '3') print ' Contents of first 3 bytes:', repr(m[0:3]) ! vereq(m[0:3], '3\0\0') print ' Contents of second page:', repr(m[PAGESIZE-1 : PAGESIZE + 7]) ! vereq(m[PAGESIZE-1 : PAGESIZE + 7], '\0foobar\0') m.flush() *************** *** 62,78 **** print start / float(PAGESIZE), length ! verify(start == PAGESIZE) ! verify(end == PAGESIZE + 6) # test seeking around (try to overflow the seek implementation) m.seek(0,0) print ' Seek to zeroth byte' ! verify(m.tell() == 0) m.seek(42,1) print ' Seek to 42nd byte' ! verify(m.tell() == 42) m.seek(0,2) print ' Seek to last byte' ! verify(m.tell() == len(m)) print ' Try to seek to negative position...' --- 62,78 ---- print start / float(PAGESIZE), length ! vereq(start, PAGESIZE) ! vereq(end, PAGESIZE + 6) # test seeking around (try to overflow the seek implementation) m.seek(0,0) print ' Seek to zeroth byte' ! vereq(m.tell(), 0) m.seek(42,1) print ' Seek to 42nd byte' ! vereq(m.tell(), 42) m.seek(0,2) print ' Seek to last byte' ! vereq(m.tell(), len(m)) print ' Try to seek to negative position...' *************** *** 128,131 **** --- 128,243 ---- except OSError: pass + try: + os.unlink(TESTFN) + except OSError: + pass + + # Test for "access" keyword parameter + try: + mapsize = 10 + print " Creating", mapsize, "byte test data file." + open(TESTFN, "wb").write("a"*mapsize) + print " Opening mmap with access=ACCESS_READ" + f = open(TESTFN, "rb") + m = mmap.mmap(f.fileno(), mapsize, access=mmap.ACCESS_READ) + verify(m[:] == 'a'*mapsize, "Readonly memory map data incorrect.") + + print " Ensuring that readonly mmap can't be slice assigned." + try: + m[:] = 'b'*mapsize + except TypeError: + pass + else: + verify(0, "Able to write to readonly memory map") + + print " Ensuring that readonly mmap can't be item assigned." + try: + m[0] = 'b' + except TypeError: + pass + else: + verify(0, "Able to write to readonly memory map") + + print " Ensuring that readonly mmap can't be write() to." + try: + m.seek(0,0) + m.write('abc') + except TypeError: + pass + else: + verify(0, "Able to write to readonly memory map") + + print " Ensuring that readonly mmap can't be write_byte() to." + try: + m.seek(0,0) + m.write_byte('d') + except TypeError: + pass + else: + verify(0, "Able to write to readonly memory map") + + print " Ensuring that readonly mmap can't be resized." + try: + m.resize(2*mapsize) + except SystemError: # resize is not universally supported + pass + except TypeError: + pass + else: + verify(0, "Able to resize readonly memory map") + del m, f + verify(open(TESTFN, "rb").read() == 'a'*mapsize, + "Readonly memory map data file was modified") + + print " Opening mmap with access=ACCESS_WRITE" + f = open(TESTFN, "r+b") + m = mmap.mmap(f.fileno(), mapsize, access=mmap.ACCESS_WRITE) + print " Modifying write-through memory map." + m[:] = 'c'*mapsize + verify(m[:] == 'c'*mapsize, + "Write-through memory map memory not updated properly.") + m.flush() + del m, f + verify(open(TESTFN).read() == 'c'*mapsize, + "Write-through memory map data file not updated properly.") + + print " Opening mmap with access=ACCESS_COPY" + f = open(TESTFN, "r+b") + m = mmap.mmap(f.fileno(), mapsize, access=mmap.ACCESS_COPY) + print " Modifying copy-on-write memory map." + m[:] = 'd'*mapsize + verify(m[:] == 'd' * mapsize, + "Copy-on-write memory map data not written correctly.") + m.flush() + verify(open(TESTFN, "rb").read() == 'c'*mapsize, + "Copy-on-write test data file should not be modified.") + try: + print " Ensuring copy-on-write maps cannot be resized." + m.resize(2*mapsize) + except TypeError: + pass + else: + verify(0, "Copy-on-write mmap resize did not raise exception.") + del m, f + try: + print " Ensuring invalid access parameter raises exception." + f = open(TESTFN, "r+b") + m = mmap.mmap(f.fileno(), mapsize, access=4) + except ValueError: + pass + else: + verify(0, "Invalid access code should have raised exception.") + + if os.name == "posix": + print " Trying incompatible flags, prot and access parameters." + f=open(TESTFN, "r+b") + try: + m = mmap.mmap(f.fileno(), mapsize, flags=mmap.MAP_PRIVATE, + prot=mmap.PROT_READ, access=mmap.ACCESS_WRITE) + except ValueError: + pass + else: + verify(0, "Incompatible parameters should raise ValueError.") + finally: try: os.unlink(TESTFN) From tim_one@users.sourceforge.net Tue Nov 13 23:11:21 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 13 Nov 2001 15:11:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libmmap.tex,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv31339/python/Doc/lib Modified Files: libmmap.tex Log Message: CVS patch #477161: New "access" keyword for mmap, from Jay T Miller. This gives mmap() on Windows the ability to create read-only, write- through and copy-on-write mmaps. A new keyword argument is introduced because the mmap() signatures diverged between Windows and Unix, so while they (now) both support this functionality, there wasn't a way to spell it in a common way without introducing a new spelling gimmick. The old spellings are still accepted, so there isn't a backward- compatibility issue here. Index: libmmap.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmmap.tex,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** libmmap.tex 2001/09/25 19:00:08 1.5 --- libmmap.tex 2001/11/13 23:11:19 1.6 *************** *** 1,4 **** \section{\module{mmap} --- ! Memory-mapped file support} \declaremodule{builtin}{mmap} --- 1,4 ---- \section{\module{mmap} --- ! Memory-mapped file support} \declaremodule{builtin}{mmap} *************** *** 24,57 **** directly (the file still needs to be closed when done). ! \begin{funcdesc}{mmap}{fileno, length\optional{, tagname}} ! \strong{(Windows version)} Maps \var{length} bytes from the file ! specified by the file handle \var{fileno}, and returns a mmap object. ! If \var{length} is \code{0}, the maximum length of the map will be the ! current size of the file when \function{mmap()} is called. ! ! \var{tagname}, if specified and not \code{None}, is a string giving a ! tag name for the mapping. Windows allows you to have many different ! mappings against the same file. If you specify the name of an ! existing tag, that tag is opened, otherwise a new tag of this name is ! created. If this parameter is omitted or \code{None}, the mapping is ! created without a name. Avoiding the use of the tag parameter will ! assist in keeping your code portable between \UNIX{} and Windows. \end{funcdesc} - - \begin{funcdesc}{mmap}{fileno, length\optional{, flags\optional{, prot}}} - \strong{(\UNIX{} version)} Maps \var{length} bytes from the file - specified by the file descriptor \var{fileno}, and returns a mmap object. - - \var{flags} specifies the nature of the mapping. - \constant{MAP_PRIVATE} creates a private copy-on-write mapping, so - changes to the contents of the mmap object will be private to this - process, and \constant{MAP_SHARED} creates a mapping that's shared - with all other processes mapping the same areas of the file. - The default value is \constant{MAP_SHARED}. ! \var{prot}, if specified, gives the desired memory protection; the two ! most useful values are \constant{PROT_READ} and \constant{PROT_WRITE}, ! to specify that the pages may be read or written. ! \var{prot} defaults to \constant{PROT_READ | PROT_WRITE}. \end{funcdesc} --- 24,88 ---- directly (the file still needs to be closed when done). ! \begin{funcdesc}{mmap}{fileno, length\optional{, tagname\optional{, access}}} ! \strong{(Windows version)} Maps \var{length} bytes from the file ! specified by the file handle \var{fileno}, and returns a mmap ! object. If \var{length} is \code{0}, the maximum length of the map ! will be the current size of the file when \function{mmap()} is ! called. ! ! \var{tagname}, if specified and not \code{None}, is a string giving ! a tag name for the mapping. Windows allows you to have many ! different mappings against the same file. If you specify the name ! of an existing tag, that tag is opened, otherwise a new tag of this ! name is created. If this parameter is omitted or \code{None}, the ! mapping is created without a name. Avoiding the use of the tag ! parameter will assist in keeping your code portable between \UNIX{} ! and Windows. ! ! \var{access} may be specified as an optional keyword parameter. ! \var{access} accepts one of three values: \constant{ACCESS_READ}, ! \constant{ACCESS_WRITE}, or \constant{ACCESS_COPY} to specify ! readonly, write-through or copy-on-write memory respectively. ! \var{access} can be used on both \UNIX{} and Windows. If ! \var{access} is not specified, Windows mmap returns a write-through ! mapping. The initial memory values for all three access types are ! taken from the specified file. Assignment to an ! \constant{ACCESS_READ} memory map raises a \exception{TypeError} ! exception. Assignment to an \constant{ACCESS_WRITE} memory map ! affects both memory and the underlying file. Assigment to an ! \constant{ACCESS_COPY} memory map affects memory but does not update ! the underlying file. \end{funcdesc} ! \begin{funcdesc}{mmap}{fileno, length\optional{, flags\optional{, prot\optional{, access}}}} ! \strong{(\UNIX{} version)} Maps \var{length} bytes from the file ! specified by the file descriptor \var{fileno}, and returns a mmap ! object. ! ! \var{flags} specifies the nature of the mapping. ! \constant{MAP_PRIVATE} creates a private copy-on-write mapping, so ! changes to the contents of the mmap object will be private to this ! process, and \constant{MAP_SHARED} creates a mapping that's shared ! with all other processes mapping the same areas of the file. The ! default value is \constant{MAP_SHARED}. ! ! \var{prot}, if specified, gives the desired memory protection; the ! two most useful values are \constant{PROT_READ} and ! \constant{PROT_WRITE}, to specify that the pages may be read or ! written. \var{prot} defaults to \constant{PROT_READ | PROT_WRITE}. ! ! \var{access} may be specified in lieu of \var{flags} and \var{prot} ! as an optional keyword parameter. \var{access} accepts one of three ! values: \constant{ACCESS_READ}, \constant{ACCESS_WRITE}, or ! \constant{ACCESS_COPY} to specify readonly, write-through, or ! copy-on-write memory respectively. \var{access} can be used on both ! \UNIX{} and Windows. It is an error to specify both \var{flags}, ! \var{prot} and \var{access}. The initial memory values for all ! three access types are taken from the specified file. Assignment to ! an \constant{ACCESS_READ} memory map raises a \exception{TypeError} ! exception. Assignment to an \constant{ACCESS_WRITE} memory map ! affects both memory and the underlying file. Assigment to an ! \constant{ACCESS_COPY} memory map affects memory but does not update ! the underlying file. \end{funcdesc} *************** *** 61,132 **** \begin{methoddesc}{close}{} ! Close the file. Subsequent calls to other methods of the object ! will result in an exception being raised. \end{methoddesc} \begin{methoddesc}{find}{string\optional{, start}} ! Returns the lowest index in the object where the substring ! \var{string} is found. Returns \code{-1} on failure. \var{start} is ! the index at which the search begins, and defaults to zero. \end{methoddesc} \begin{methoddesc}{flush}{\optional{offset, size}} ! Flushes changes made to the in-memory copy of a file back to disk. ! Without use of this call there is no guarantee that changes are ! written back before the object is destroyed. If \var{offset} and ! \var{size} are specified, only changes to the given range of bytes ! will be flushed to disk; otherwise, the whole extent of the mapping is ! flushed. \end{methoddesc} \begin{methoddesc}{move}{\var{dest}, \var{src}, \var{count}} ! Copy the \var{count} bytes starting at offset \var{src} ! to the destination index \var{dest}. \end{methoddesc} \begin{methoddesc}{read}{\var{num}} ! Return a string containing up to \var{num} bytes starting from the ! current file position; the file position is updated to point after the ! bytes that were returned. \end{methoddesc} \begin{methoddesc}{read_byte}{} ! Returns a string of length 1 containing the character at the current ! file position, and advances the file position by 1. \end{methoddesc} \begin{methoddesc}{readline}{} ! Returns a single line, starting at the current file position and up to ! the next newline. \end{methoddesc} \begin{methoddesc}{resize}{\var{newsize}} \end{methoddesc} \begin{methoddesc}{seek}{pos\optional{, whence}} ! Set the file's current position. ! \var{whence} argument is optional and defaults to \code{0} (absolute ! file positioning); other values are \code{1} (seek relative to the ! current position) and \code{2} (seek relative to the file's end). \end{methoddesc} \begin{methoddesc}{size}{} ! Return the length of the file, which can be larger than the size ! of the memory-mapped area. \end{methoddesc} \begin{methoddesc}{tell}{} ! Returns the current position of the file pointer. \end{methoddesc} \begin{methoddesc}{write}{\var{string}} ! Write the bytes in \var{string} into memory at the current position of ! the file pointer; the file position is updated to point after the ! bytes that were written. \end{methoddesc} \begin{methoddesc}{write_byte}{\var{byte}} ! Write the single-character string \var{byte} into memory at the ! current position of the file pointer; the file position is advanced by ! \code{1}. \end{methoddesc} --- 92,170 ---- \begin{methoddesc}{close}{} ! Close the file. Subsequent calls to other methods of the object ! will result in an exception being raised. \end{methoddesc} \begin{methoddesc}{find}{string\optional{, start}} ! Returns the lowest index in the object where the substring ! \var{string} is found. Returns \code{-1} on failure. \var{start} ! is the index at which the search begins, and defaults to zero. \end{methoddesc} \begin{methoddesc}{flush}{\optional{offset, size}} ! Flushes changes made to the in-memory copy of a file back to disk. ! Without use of this call there is no guarantee that changes are ! written back before the object is destroyed. If \var{offset} and ! \var{size} are specified, only changes to the given range of bytes ! will be flushed to disk; otherwise, the whole extent of the mapping ! is flushed. \end{methoddesc} \begin{methoddesc}{move}{\var{dest}, \var{src}, \var{count}} ! Copy the \var{count} bytes starting at offset \var{src} to the ! destination index \var{dest}. If the mmap was created with ! \constant{ACCESS_READ}, then calls to move will throw a ! \exception{TypeError} exception. \end{methoddesc} \begin{methoddesc}{read}{\var{num}} ! Return a string containing up to \var{num} bytes starting from the ! current file position; the file position is updated to point after the ! bytes that were returned. \end{methoddesc} \begin{methoddesc}{read_byte}{} ! Returns a string of length 1 containing the character at the current ! file position, and advances the file position by 1. \end{methoddesc} \begin{methoddesc}{readline}{} ! Returns a single line, starting at the current file position and up to ! the next newline. \end{methoddesc} \begin{methoddesc}{resize}{\var{newsize}} + If the mmap was created with \constant{ACCESS_READ} or + \constant{ACCESS_COPY}, resizing the map will throw a \exception{TypeError} exception. \end{methoddesc} \begin{methoddesc}{seek}{pos\optional{, whence}} ! Set the file's current position. \var{whence} argument is optional ! and defaults to \code{0} (absolute file positioning); other values ! are \code{1} (seek relative to the current position) and \code{2} ! (seek relative to the file's end). \end{methoddesc} \begin{methoddesc}{size}{} ! Return the length of the file, which can be larger than the size of ! the memory-mapped area. \end{methoddesc} \begin{methoddesc}{tell}{} ! Returns the current position of the file pointer. \end{methoddesc} \begin{methoddesc}{write}{\var{string}} ! Write the bytes in \var{string} into memory at the current position ! of the file pointer; the file position is updated to point after the ! bytes that were written. If the mmap was created with ! \constant{ACCESS_READ}, then writing to it will throw a ! \exception{TypeError} exception. \end{methoddesc} \begin{methoddesc}{write_byte}{\var{byte}} ! Write the single-character string \var{byte} into memory at the ! current position of the file pointer; the file position is advanced ! by \code{1}.If the mmap was created with \constant{ACCESS_READ}, ! then writing to it will throw a \exception{TypeError} exception. \end{methoddesc} From tim_one@users.sourceforge.net Tue Nov 13 23:11:21 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 13 Nov 2001 15:11:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules mmapmodule.c,2.33,2.34 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv31339/python/Modules Modified Files: mmapmodule.c Log Message: CVS patch #477161: New "access" keyword for mmap, from Jay T Miller. This gives mmap() on Windows the ability to create read-only, write- through and copy-on-write mmaps. A new keyword argument is introduced because the mmap() signatures diverged between Windows and Unix, so while they (now) both support this functionality, there wasn't a way to spell it in a common way without introducing a new spelling gimmick. The old spellings are still accepted, so there isn't a backward- compatibility issue here. Index: mmapmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/mmapmodule.c,v retrieving revision 2.33 retrieving revision 2.34 diff -C2 -d -r2.33 -r2.34 *** mmapmodule.c 2001/11/05 21:22:41 2.33 --- mmapmodule.c 2001/11/13 23:11:19 2.34 *************** *** 30,36 **** my_getpagesize(void) { ! SYSTEM_INFO si; ! GetSystemInfo(&si); ! return si.dwPageSize; } #endif --- 30,36 ---- my_getpagesize(void) { ! SYSTEM_INFO si; ! GetSystemInfo(&si); ! return si.dwPageSize; } #endif *************** *** 50,54 **** my_getpagesize(void) { ! return sysconf(_SC_PAGESIZE); } #else --- 50,54 ---- my_getpagesize(void) { ! return sysconf(_SC_PAGESIZE); } #else *************** *** 63,66 **** --- 63,74 ---- static PyObject *mmap_module_error; + typedef enum + { + ACCESS_DEFAULT, + ACCESS_READ, + ACCESS_WRITE, + ACCESS_COPY + } access_mode; + typedef struct { PyObject_HEAD *************** *** 78,83 **** --- 86,94 ---- int fd; #endif + + access_mode access; } mmap_object; + static void mmap_object_dealloc(mmap_object *m_obj) *************** *** 179,183 **** static PyObject * mmap_read_line_method(mmap_object *self, ! PyObject *args) { char *start = self->data+self->pos; --- 190,194 ---- static PyObject * mmap_read_line_method(mmap_object *self, ! PyObject *args) { char *start = self->data+self->pos; *************** *** 237,245 **** if (start < 0) ! start += self->size; if (start < 0) ! start = 0; else if ((size_t)start > self->size) ! start = self->size; p = self->data + start; --- 248,256 ---- if (start < 0) ! start += self->size; if (start < 0) ! start = 0; else if ((size_t)start > self->size) ! start = self->size; p = self->data + start; *************** *** 261,264 **** --- 272,295 ---- } + static int + is_writeable(mmap_object *self) + { + if (self->access != ACCESS_READ) + return 1; + PyErr_Format(PyExc_TypeError, "mmap can't modify a readonly memory map."); + return 0; + } + + static int + is_resizeable(mmap_object *self) + { + if ((self->access == ACCESS_WRITE) || (self->access == ACCESS_DEFAULT)) + return 1; + PyErr_Format(PyExc_TypeError, + "mmap can't resize a readonly or copy-on-write memory map."); + return 0; + } + + static PyObject * mmap_write_method(mmap_object *self, *************** *** 272,275 **** --- 303,309 ---- return(NULL); + if (!is_writeable(self)) + return NULL; + if ((self->pos + length) > self->size) { PyErr_SetString (PyExc_ValueError, "data out of range"); *************** *** 292,295 **** --- 326,331 ---- return(NULL); + if (!is_writeable(self)) + return NULL; *(self->data+self->pos) = value; self->pos += 1; *************** *** 297,301 **** return (Py_None); } ! static PyObject * mmap_size_method(mmap_object *self, --- 333,337 ---- return (Py_None); } ! static PyObject * mmap_size_method(mmap_object *self, *************** *** 343,347 **** unsigned long new_size; CHECK_VALID(NULL); ! if (!PyArg_ParseTuple (args, "l:resize", &new_size)) { return NULL; #ifdef MS_WIN32 --- 379,384 ---- unsigned long new_size; CHECK_VALID(NULL); ! if (!PyArg_ParseTuple (args, "l:resize", &new_size) || ! !is_resizeable(self)) { return NULL; #ifdef MS_WIN32 *************** *** 387,415 **** #ifdef UNIX #ifndef HAVE_MREMAP ! } else { ! PyErr_SetString(PyExc_SystemError, ! "mmap: resizing not available--no mremap()"); ! return NULL; #else ! } else { ! void *newmap; #ifdef MREMAP_MAYMOVE ! newmap = mremap(self->data, self->size, new_size, MREMAP_MAYMOVE); #else ! newmap = mremap(self->data, self->size, new_size, 0); #endif ! if (newmap == (void *)-1) ! { ! PyErr_SetFromErrno(mmap_module_error); ! return NULL; ! } ! self->data = newmap; ! self->size = new_size; ! Py_INCREF(Py_None); ! return Py_None; #endif /* HAVE_MREMAP */ #endif /* UNIX */ ! } } --- 424,452 ---- #ifdef UNIX #ifndef HAVE_MREMAP ! } else { ! PyErr_SetString(PyExc_SystemError, ! "mmap: resizing not available--no mremap()"); ! return NULL; #else ! } else { ! void *newmap; #ifdef MREMAP_MAYMOVE ! newmap = mremap(self->data, self->size, new_size, MREMAP_MAYMOVE); #else ! newmap = mremap(self->data, self->size, new_size, 0); #endif ! if (newmap == (void *)-1) ! { ! PyErr_SetFromErrno(mmap_module_error); ! return NULL; ! } ! self->data = newmap; ! self->size = new_size; ! Py_INCREF(Py_None); ! return Py_None; #endif /* HAVE_MREMAP */ #endif /* UNIX */ ! } } *************** *** 492,496 **** } ! onoutofrange: PyErr_SetString (PyExc_ValueError, "seek out of range"); return NULL; --- 529,533 ---- } ! onoutofrange: PyErr_SetString (PyExc_ValueError, "seek out of range"); return NULL; *************** *** 502,506 **** unsigned long dest, src, count; CHECK_VALID(NULL); ! if (!PyArg_ParseTuple (args, "iii:move", &dest, &src, &count)) { return NULL; } else { --- 539,544 ---- unsigned long dest, src, count; CHECK_VALID(NULL); ! if (!PyArg_ParseTuple (args, "iii:move", &dest, &src, &count) || ! !is_writeable(self)) { return NULL; } else { *************** *** 562,565 **** --- 600,605 ---- return -1; } + if (!is_writeable(self)) + return -1; *ptr = self->data; return self->size; *************** *** 666,670 **** if (v == NULL) { PyErr_SetString(PyExc_TypeError, ! "mmap object doesn't support slice deletion"); return -1; } --- 706,710 ---- if (v == NULL) { PyErr_SetString(PyExc_TypeError, ! "mmap object doesn't support slice deletion"); return -1; } *************** *** 679,682 **** --- 719,724 ---- return -1; } + if (!is_writeable(self)) + return -1; buf = PyString_AsString(v); memcpy(self->data + ilow, buf, ihigh-ilow); *************** *** 696,707 **** if (v == NULL) { PyErr_SetString(PyExc_TypeError, ! "mmap object doesn't support item deletion"); return -1; } if (! (PyString_Check(v) && PyString_Size(v)==1) ) { PyErr_SetString(PyExc_IndexError, ! "mmap assignment must be single-character string"); return -1; } buf = PyString_AsString(v); self->data[i] = buf[0]; --- 738,751 ---- if (v == NULL) { PyErr_SetString(PyExc_TypeError, ! "mmap object doesn't support item deletion"); return -1; } if (! (PyString_Check(v) && PyString_Size(v)==1) ) { PyErr_SetString(PyExc_IndexError, ! "mmap assignment must be single-character string"); return -1; } + if (!is_writeable(self)) + return -1; buf = PyString_AsString(v); self->data[i] = buf[0]; *************** *** 793,808 **** else { PyErr_SetString(PyExc_TypeError, ! "map size must be an integral value"); return -1; } ! onnegoverflow: PyErr_SetString(PyExc_OverflowError, ! "memory mapped size must be positive"); return -1; ! onposoverflow: PyErr_SetString(PyExc_OverflowError, ! "memory mapped size is too large (limited by C int)"); return -1; } --- 837,852 ---- else { PyErr_SetString(PyExc_TypeError, ! "map size must be an integral value"); return -1; } ! onnegoverflow: PyErr_SetString(PyExc_OverflowError, ! "memory mapped size must be positive"); return -1; ! onposoverflow: PyErr_SetString(PyExc_OverflowError, ! "memory mapped size is too large (limited by C int)"); return -1; } *************** *** 816,829 **** int map_size; int fd, flags = MAP_SHARED, prot = PROT_WRITE | PROT_READ; ! char *keywords[] = {"file", "size", "flags", "prot", NULL}; ! if (!PyArg_ParseTupleAndKeywords(args, kwdict, ! "iO|ii", keywords, ! &fd, &map_size_obj, &flags, &prot) ! ) return NULL; map_size = _GetMapSize(map_size_obj); if (map_size < 0) return NULL; m_obj = PyObject_New (mmap_object, &mmap_object_type); --- 860,899 ---- int map_size; int fd, flags = MAP_SHARED, prot = PROT_WRITE | PROT_READ; ! access_mode access = ACCESS_DEFAULT; ! char *keywords[] = {"fileno", "length", ! "flags", "prot", ! "access", NULL}; ! if (!PyArg_ParseTupleAndKeywords(args, kwdict, "iO|iii", keywords, ! &fd, &map_size_obj, &flags, &prot, &access)) return NULL; map_size = _GetMapSize(map_size_obj); if (map_size < 0) return NULL; + + if ((access != ACCESS_DEFAULT) && + ((flags != MAP_SHARED) || ( prot != (PROT_WRITE | PROT_READ)))) + return PyErr_Format(PyExc_ValueError, + "mmap can't specify both access and flags, prot."); + switch(access) { + case ACCESS_READ: + flags = MAP_SHARED; + prot = PROT_READ; + break; + case ACCESS_WRITE: + flags = MAP_SHARED; + prot = PROT_READ | PROT_WRITE; + break; + case ACCESS_COPY: + flags = MAP_PRIVATE; + prot = PROT_READ | PROT_WRITE; + break; + case ACCESS_DEFAULT: + /* use the specified or default values of flags and prot */ + break; + default: + return PyErr_Format(PyExc_ValueError, + "mmap invalid access parameter."); + } m_obj = PyObject_New (mmap_object, &mmap_object_type); *************** *** 835,844 **** prot, flags, fd, 0); ! if (m_obj->data == (char *)-1) ! { Py_DECREF(m_obj); PyErr_SetFromErrno(mmap_module_error); return NULL; } return (PyObject *)m_obj; } --- 905,914 ---- prot, flags, fd, 0); ! if (m_obj->data == (char *)-1) { Py_DECREF(m_obj); PyErr_SetFromErrno(mmap_module_error); return NULL; } + m_obj->access = access; return (PyObject *)m_obj; } *************** *** 847,851 **** #ifdef MS_WIN32 static PyObject * ! new_mmap_object(PyObject *self, PyObject *args) { mmap_object *m_obj; --- 917,921 ---- #ifdef MS_WIN32 static PyObject * ! new_mmap_object(PyObject *self, PyObject *args, PyObject *kwdict) { mmap_object *m_obj; *************** *** 853,869 **** int map_size; char *tagname = ""; - DWORD dwErr = 0; int fileno; HANDLE fh = 0; ! if (!PyArg_ParseTuple(args, ! "iO|z", ! &fileno, ! &map_size_obj, ! &tagname) ! ) return NULL; ! map_size = _GetMapSize(map_size_obj); if (map_size < 0) --- 923,959 ---- int map_size; char *tagname = ""; DWORD dwErr = 0; int fileno; HANDLE fh = 0; + access_mode access = ACCESS_DEFAULT; + DWORD flProtect, dwDesiredAccess; + char *keywords[] = { "fileno", "length", + "tagname", + "access", NULL }; ! if (!PyArg_ParseTupleAndKeywords(args, kwdict, "iO|zi", keywords, ! &fileno, &map_size_obj, ! &tagname, &access)) { return NULL; ! } ! ! switch(access) { ! case ACCESS_READ: ! flProtect = PAGE_READONLY; ! dwDesiredAccess = FILE_MAP_READ; ! break; ! case ACCESS_DEFAULT: case ACCESS_WRITE: ! flProtect = PAGE_READWRITE; ! dwDesiredAccess = FILE_MAP_WRITE; ! break; ! case ACCESS_COPY: ! flProtect = PAGE_WRITECOPY; ! dwDesiredAccess = FILE_MAP_COPY; ! break; ! default: ! return PyErr_Format(PyExc_ValueError, ! "mmap invalid access parameter."); ! } ! map_size = _GetMapSize(map_size_obj); if (map_size < 0) *************** *** 874,879 **** fh = (HANDLE)_get_osfhandle(fileno); if (fh==(HANDLE)-1) { ! PyErr_SetFromErrno(mmap_module_error); ! return NULL; } /* Win9x appears to need us seeked to zero */ --- 964,969 ---- fh = (HANDLE)_get_osfhandle(fileno); if (fh==(HANDLE)-1) { ! PyErr_SetFromErrno(mmap_module_error); ! return NULL; } /* Win9x appears to need us seeked to zero */ *************** *** 895,905 **** Python code can close it on us */ if (!DuplicateHandle( ! GetCurrentProcess(), /* source process handle */ ! fh, /* handle to be duplicated */ ! GetCurrentProcess(), /* target proc handle */ ! (LPHANDLE)&m_obj->file_handle, /* result */ ! 0, /* access - ignored due to options value */ ! FALSE, /* inherited by child processes? */ ! DUPLICATE_SAME_ACCESS)) { /* options */ dwErr = GetLastError(); Py_DECREF(m_obj); --- 985,995 ---- Python code can close it on us */ if (!DuplicateHandle( ! GetCurrentProcess(), /* source process handle */ ! fh, /* handle to be duplicated */ ! GetCurrentProcess(), /* target proc handle */ ! (LPHANDLE)&m_obj->file_handle, /* result */ ! 0, /* access - ignored due to options value */ ! FALSE, /* inherited by child processes? */ ! DUPLICATE_SAME_ACCESS)) { /* options */ dwErr = GetLastError(); Py_DECREF(m_obj); *************** *** 933,939 **** m_obj->tagname = NULL; m_obj->map_handle = CreateFileMapping (m_obj->file_handle, NULL, ! PAGE_READWRITE, 0, m_obj->size, --- 1023,1030 ---- m_obj->tagname = NULL; + m_obj->access = access; m_obj->map_handle = CreateFileMapping (m_obj->file_handle, NULL, ! flProtect, 0, m_obj->size, *************** *** 941,945 **** if (m_obj->map_handle != NULL) { m_obj->data = (char *) MapViewOfFile (m_obj->map_handle, ! FILE_MAP_WRITE, 0, 0, --- 1032,1036 ---- if (m_obj->map_handle != NULL) { m_obj->data = (char *) MapViewOfFile (m_obj->map_handle, ! dwDesiredAccess, 0, 0, *************** *** 948,952 **** return ((PyObject *) m_obj); } else { ! dwErr = GetLastError(); } } else { --- 1039,1043 ---- return ((PyObject *) m_obj); } else { ! dwErr = GetLastError(); } } else { *************** *** 967,971 **** DL_EXPORT(void) ! initmmap(void) { PyObject *dict, *module; --- 1058,1062 ---- DL_EXPORT(void) ! initmmap(void) { PyObject *dict, *module; *************** *** 1012,1015 **** PyDict_SetItemString (dict, "PAGESIZE", PyInt_FromLong( (long)my_getpagesize() ) ); - } --- 1103,1112 ---- PyDict_SetItemString (dict, "PAGESIZE", PyInt_FromLong( (long)my_getpagesize() ) ); + PyDict_SetItemString (dict, "ACCESS_READ", + PyInt_FromLong(ACCESS_READ)); + PyDict_SetItemString (dict, "ACCESS_WRITE", + PyInt_FromLong(ACCESS_WRITE)); + PyDict_SetItemString (dict, "ACCESS_COPY", + PyInt_FromLong(ACCESS_COPY)); + } From tim_one@users.sourceforge.net Tue Nov 13 23:39:50 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 13 Nov 2001 15:39:50 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_mmap.py,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv7196/python/Lib/test Modified Files: test_mmap.py Log Message: Removed print that executes only on Unix boxes; that made it impossible to have single "expected output" file. Index: test_mmap.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_mmap.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** test_mmap.py 2001/11/13 23:11:19 1.18 --- test_mmap.py 2001/11/13 23:39:47 1.19 *************** *** 230,235 **** if os.name == "posix": ! print " Trying incompatible flags, prot and access parameters." ! f=open(TESTFN, "r+b") try: m = mmap.mmap(f.fileno(), mapsize, flags=mmap.MAP_PRIVATE, --- 230,235 ---- if os.name == "posix": ! # Try incompatible flags, prot and access parameters. ! f = open(TESTFN, "r+b") try: m = mmap.mmap(f.fileno(), mapsize, flags=mmap.MAP_PRIVATE, From tim_one@users.sourceforge.net Wed Nov 14 05:57:37 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 13 Nov 2001 21:57:37 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0042.txt,1.56,1.57 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv10904 Modified Files: pep-0042.txt Log Message: Added "Hang using files named prn.txt, etc" -- Windows specific. Index: pep-0042.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0042.txt,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** pep-0042.txt 2001/10/19 14:06:33 1.56 --- pep-0042.txt 2001/11/14 05:57:34 1.57 *************** *** 62,65 **** --- 62,73 ---- http://sf.net/tracker/index.php?func=detail&aid=445484&group_id=5470&atid=355470 + - Windows: Trying to create (or even access) files with certain magic + names can hang or crash Windows systems. This is really a bug in the + OSes, but some apps try to shield users from it. When it happens, + the symptoms are very confusing. + + Hang using files named prn.txt, etc + http://sf.net/tracker/index.php?func=detail&aid=481171&group_id=5470&atid=355470 + Standard Library From jackjansen@users.sourceforge.net Wed Nov 14 11:00:00 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 14 Nov 2001 03:00:00 -0800 Subject: [Python-checkins] CVS: python/dist/src configure.in,1.280,1.281 configure,1.271,1.272 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv20934 Modified Files: configure.in configure Log Message: OSX tests used specific version numbers to test for new features and used the default Darwin/* for the old code. Reversed those tests so that compatibility code is in a switch leg with a specific version and newer systems take the default leg. This should allow Python to build on OSX 10.1.1 (which jumps from Darwin/1.4 to Darwin/5.1 due to a new numbering scheme). Index: configure.in =================================================================== RCS file: /cvsroot/python/python/dist/src/configure.in,v retrieving revision 1.280 retrieving revision 1.281 diff -C2 -d -r1.280 -r1.281 *** configure.in 2001/11/09 17:50:52 1.280 --- configure.in 2001/11/14 10:59:57 1.281 *************** *** 671,684 **** AC_SUBST(LIBTOOL_CRUFT) case $ac_sys_system/$ac_sys_release in ! Darwin/1.4*) ns_undef_sym='_environ' ! LIBTOOL_CRUFT="-lcc_dynamic -arch_only ppc -flat_namespace -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)';; 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)';; --- 671,684 ---- AC_SUBST(LIBTOOL_CRUFT) case $ac_sys_system/$ac_sys_release in ! Darwin/1.3*) 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)';; Darwin/*) ns_undef_sym='_environ' ! LIBTOOL_CRUFT="-lcc_dynamic -arch_only ppc -flat_namespace -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)';; *************** *** 695,700 **** case $ac_sys_system/$ac_sys_release in ! Darwin/1.4*)LDFLAGS="$LDFLAGS -Wl,-F. -Wl,-flat_namespace,-U,$ns_undef_sym";; ! Darwin/*)LDFLAGS="$LDFLAGS -Wl,-F. -Wl,-U,$ns_undef_sym";; esac AC_DEFINE(WITH_NEXT_FRAMEWORK) --- 695,700 ---- case $ac_sys_system/$ac_sys_release in ! Darwin/1.3*)LDFLAGS="$LDFLAGS -Wl,-F. -Wl,-U,$ns_undef_sym";; ! Darwin/*)LDFLAGS="$LDFLAGS -Wl,-F. -Wl,-flat_namespace,-U,$ns_undef_sym";; esac AC_DEFINE(WITH_NEXT_FRAMEWORK) *************** *** 760,764 **** OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";; DYNIX/ptx*) LDSHARED="ld -G";; ! Darwin/1.4*) LDSHARED='$(CC) $(LDFLAGS) -bundle' if test "$enable_framework" ; then --- 760,764 ---- OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";; DYNIX/ptx*) LDSHARED="ld -G";; ! Darwin/1.3*) LDSHARED='$(CC) $(LDFLAGS) -bundle' if test "$enable_framework" ; then *************** *** 767,771 **** else # No framework. Ignore undefined symbols, assuming they come from Python ! LDSHARED="$LDSHARED -flat_namespace -undefined suppress" fi ;; Darwin/*) --- 767,771 ---- else # No framework. Ignore undefined symbols, assuming they come from Python ! LDSHARED="$LDSHARED -undefined suppress" fi ;; Darwin/*) *************** *** 776,780 **** else # No framework. Ignore undefined symbols, assuming they come from Python ! LDSHARED="$LDSHARED -undefined suppress" fi ;; Linux*) LDSHARED="gcc -shared";; --- 776,780 ---- else # No framework. Ignore undefined symbols, assuming they come from Python ! LDSHARED="$LDSHARED -flat_namespace -undefined suppress" fi ;; Linux*) LDSHARED="gcc -shared";; Index: configure =================================================================== RCS file: /cvsroot/python/python/dist/src/configure,v retrieving revision 1.271 retrieving revision 1.272 diff -C2 -d -r1.271 -r1.272 *** configure 2001/11/09 17:50:51 1.271 --- configure 2001/11/14 10:59:57 1.272 *************** *** 1,5 **** #! /bin/sh ! # From configure.in Revision: 1.279 # Guess values for system-dependent variables and create Makefiles. --- 1,5 ---- #! /bin/sh ! # From configure.in Revision: 1.280 # Guess values for system-dependent variables and create Makefiles. *************** *** 3046,3059 **** case $ac_sys_system/$ac_sys_release in ! Darwin/1.4*) ns_undef_sym='_environ' ! LIBTOOL_CRUFT="-lcc_dynamic -arch_only ppc -flat_namespace -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)';; 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)';; --- 3046,3059 ---- case $ac_sys_system/$ac_sys_release in ! Darwin/1.3*) 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)';; Darwin/*) ns_undef_sym='_environ' ! LIBTOOL_CRUFT="-lcc_dynamic -arch_only ppc -flat_namespace -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)';; *************** *** 3071,3076 **** case $ac_sys_system/$ac_sys_release in ! Darwin/1.4*)LDFLAGS="$LDFLAGS -Wl,-F. -Wl,-flat_namespace,-U,$ns_undef_sym";; ! Darwin/*)LDFLAGS="$LDFLAGS -Wl,-F. -Wl,-U,$ns_undef_sym";; esac cat >> confdefs.h <<\EOF --- 3071,3076 ---- case $ac_sys_system/$ac_sys_release in ! Darwin/1.3*)LDFLAGS="$LDFLAGS -Wl,-F. -Wl,-U,$ns_undef_sym";; ! Darwin/*)LDFLAGS="$LDFLAGS -Wl,-F. -Wl,-flat_namespace,-U,$ns_undef_sym";; esac cat >> confdefs.h <<\EOF *************** *** 3145,3149 **** OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";; DYNIX/ptx*) LDSHARED="ld -G";; ! Darwin/1.4*) LDSHARED='$(CC) $(LDFLAGS) -bundle' if test "$enable_framework" ; then --- 3145,3149 ---- OSF*) LDSHARED="ld -shared -expect_unresolved \"*\"";; DYNIX/ptx*) LDSHARED="ld -G";; ! Darwin/1.3*) LDSHARED='$(CC) $(LDFLAGS) -bundle' if test "$enable_framework" ; then *************** *** 3152,3156 **** else # No framework. Ignore undefined symbols, assuming they come from Python ! LDSHARED="$LDSHARED -flat_namespace -undefined suppress" fi ;; Darwin/*) --- 3152,3156 ---- else # No framework. Ignore undefined symbols, assuming they come from Python ! LDSHARED="$LDSHARED -undefined suppress" fi ;; Darwin/*) *************** *** 3161,3165 **** else # No framework. Ignore undefined symbols, assuming they come from Python ! LDSHARED="$LDSHARED -undefined suppress" fi ;; Linux*) LDSHARED="gcc -shared";; --- 3161,3165 ---- else # No framework. Ignore undefined symbols, assuming they come from Python ! LDSHARED="$LDSHARED -flat_namespace -undefined suppress" fi ;; Linux*) LDSHARED="gcc -shared";; From jackjansen@users.sourceforge.net Wed Nov 14 15:48:15 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Wed, 14 Nov 2001 07:48:15 -0800 Subject: [Python-checkins] CVS: python/dist/src/Tools/bgen/bgen bgenObjectDefinition.py,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/bgen/bgen In directory usw-pr-cvs1:/tmp/cvs-serv30459 Modified Files: bgenObjectDefinition.py Log Message: Don't initialize tp_type statically, it won't work on Windows. Spotted by Thomas Heller (patch 459442). Index: bgenObjectDefinition.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/bgenObjectDefinition.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** bgenObjectDefinition.py 2001/09/04 22:16:33 1.13 --- bgenObjectDefinition.py 2001/11/14 15:48:13 1.14 *************** *** 165,169 **** Output("%sPyTypeObject %s = {", sf, self.typename) IndentLevel() ! Output("PyObject_HEAD_INIT(&PyType_Type)") Output("0, /*ob_size*/") Output("\"%s\", /*tp_name*/", self.name) --- 165,169 ---- Output("%sPyTypeObject %s = {", sf, self.typename) IndentLevel() ! Output("PyObject_HEAD_INIT(NULL)") Output("0, /*ob_size*/") Output("\"%s\", /*tp_name*/", self.name) From jhylton@users.sourceforge.net Wed Nov 14 21:32:29 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 14 Nov 2001 13:32:29 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/ref refa1.tex,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv8582 Modified Files: refa1.tex Log Message: typo Index: refa1.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/refa1.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** refa1.tex 2001/10/18 15:22:23 1.7 --- refa1.tex 2001/11/14 21:32:27 1.8 *************** *** 90,94 **** \section{\module{__future__} --- ! Future statement definitions} \declaremodule[future]{standard}{__future__} --- 90,94 ---- \section{\module{__future__} --- ! Future statement definitions} \declaremodule[future]{standard}{__future__} *************** *** 173,177 **** containing the use. ! A \dfn{block} is a pice of Python program text that can is executed as a unit. The following are blocks: a module, a function body, and a class defintion. --- 173,177 ---- containing the use. ! A \dfn{block} is a piece of Python program text that can is executed as a unit. The following are blocks: a module, a function body, and a class defintion. From jhylton@users.sourceforge.net Wed Nov 14 21:38:16 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 14 Nov 2001 13:38:16 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/ref refa1.tex,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv10619 Modified Files: refa1.tex Log Message: Fred observes that the typo was not the only problem with this sentence. Index: refa1.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/refa1.tex,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** refa1.tex 2001/11/14 21:32:27 1.8 --- refa1.tex 2001/11/14 21:38:13 1.9 *************** *** 173,177 **** containing the use. ! A \dfn{block} is a piece of Python program text that can is executed as a unit. The following are blocks: a module, a function body, and a class defintion. --- 173,177 ---- containing the use. ! A \dfn{block} is a piece of Python program text that is executed as a unit. The following are blocks: a module, a function body, and a class defintion. From fdrake@users.sourceforge.net Wed Nov 14 22:28:28 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 14 Nov 2001 14:28:28 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/texinputs boilerplate.tex,1.67,1.68 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory usw-pr-cvs1:/tmp/cvs-serv25152/texinputs Modified Files: boilerplate.tex Log Message: Bump release number & date. Index: boilerplate.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/boilerplate.tex,v retrieving revision 1.67 retrieving revision 1.68 diff -C2 -d -r1.67 -r1.68 *** boilerplate.tex 2001/10/18 18:41:12 1.67 --- boilerplate.tex 2001/11/14 22:28:26 1.68 *************** *** 6,11 **** } ! \date{October 19, 2001} % XXX update before release! \release{2.2} % software release, not documentation ! \setreleaseinfo{b1} % empty for final release \setshortversion{2.2} % major.minor only for software --- 6,11 ---- } ! \date{November 16, 2001} % XXX update before release! \release{2.2} % software release, not documentation ! \setreleaseinfo{b2} % empty for final release \setshortversion{2.2} % major.minor only for software From fdrake@users.sourceforge.net Wed Nov 14 22:28:28 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 14 Nov 2001 14:28:28 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc Makefile,1.231,1.232 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv25152 Modified Files: Makefile Log Message: Bump release number & date. Index: Makefile =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile,v retrieving revision 1.231 retrieving revision 1.232 diff -C2 -d -r1.231 -r1.232 *** Makefile 2001/10/30 16:28:46 1.231 --- Makefile 2001/11/14 22:28:26 1.232 *************** *** 67,71 **** # This is the *documentation* release, and is used to construct the file # names of the downloadable tarballs. ! RELEASE=2.2b1 PYTHON= python --- 67,71 ---- # This is the *documentation* release, and is used to construct the file # names of the downloadable tarballs. ! RELEASE=2.2b2 PYTHON= python From fdrake@users.sourceforge.net Wed Nov 14 22:36:01 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 14 Nov 2001 14:36:01 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/html style.css,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/html In directory usw-pr-cvs1:/tmp/cvs-serv27076/html Modified Files: style.css Log Message: Finally commit the font changes that have been live on the development site for a month or more. Index: style.css =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/html/style.css,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** style.css 2001/09/26 18:46:36 1.17 --- style.css 2001/11/14 22:35:59 1.18 *************** *** 48,56 **** h2 { font-size: 150%; } h3, h4 { font-size: 120%; } ! code, tt { font-family: monospace; } var { font-family: times, serif; font-style: italic; font-weight: normal; } .navigation td { background-color: #99ccff; font-weight: bold; --- 48,59 ---- h2 { font-size: 150%; } h3, h4 { font-size: 120%; } ! code, tt { font-family: lucida typewriter, lucidatypewriter, ! monospace; } var { font-family: times, serif; font-style: italic; font-weight: normal; } + .typelabel { font-family: lucida, sans serif; } + .navigation td { background-color: #99ccff; font-weight: bold; *************** *** 62,66 **** .titlegraphic { vertical-align: top; } ! .verbatim { color: #00008b; } .grammar { background-color: #99ccff; --- 65,71 ---- .titlegraphic { vertical-align: top; } ! .verbatim { color: #00008b; ! font-family: lucida typewriter, lucidatypewriter, ! monospace; } .grammar { background-color: #99ccff; From tim_one@users.sourceforge.net Wed Nov 14 23:32:35 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 14 Nov 2001 15:32:35 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.102,1.103 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv8578/python/Lib/test Modified Files: test_descr.py Log Message: Changing diapers reminded Guido that he wanted to allow for some measure of multiple inheritance from a mix of new- and classic-style classes. This is his patch, plus a start at some test cases from me. Will check in more, plus a NEWS blurb, later tonight. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.102 retrieving revision 1.103 diff -C2 -d -r1.102 -r1.103 *** test_descr.py 2001/10/30 23:20:46 1.102 --- test_descr.py 2001/11/14 23:32:33 1.103 *************** *** 830,833 **** --- 830,880 ---- vereq(int(Frag()), 42) + # MI mixing classic and new-style classes. + class C: + def cmethod(self): + return "C a" + def all_method(self): + return "C b" + + class M1(C, object): + def m1method(self): + return "M1 a" + def all_method(self): + return "M1 b" + + vereq(M1.__mro__, (M1, C, object)) + m = M1() + vereq(m.cmethod(), "C a") + vereq(m.m1method(), "M1 a") + vereq(m.all_method(), "M1 b") + + class D(C): + def dmethod(self): + return "D a" + def all_method(self): + return "D b" + + class M2(object, D): + def m2method(self): + return "M2 a" + def all_method(self): + return "M2 b" + + vereq(M2.__mro__, (M2, object, D, C)) + m = M2() + vereq(m.cmethod(), "C a") + vereq(m.dmethod(), "D a") + vereq(m.m2method(), "M2 a") + vereq(m.all_method(), "M2 b") + + class M3(M1, object, M2): + def m3method(self): + return "M3 a" + def all_method(self): + return "M3 b" + # XXX Expected this (the commented-out result): + # vereq(M3.__mro__, (M3, M1, M2, object, D, C)) + vereq(M3.__mro__, (M3, M1, M2, D, C, object)) # XXX ? + def diamond(): if verbose: print "Testing multiple inheritance special cases..." *************** *** 1016,1027 **** class Classic: pass - - try: - class C(object, Classic): - pass - except TypeError: - pass - else: - verify(0, "inheritance from object and Classic should be illegal") try: --- 1063,1066 ---- From tim_one@users.sourceforge.net Wed Nov 14 23:32:35 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 14 Nov 2001 15:32:35 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects typeobject.c,2.117,2.118 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv8578/python/Objects Modified Files: typeobject.c Log Message: Changing diapers reminded Guido that he wanted to allow for some measure of multiple inheritance from a mix of new- and classic-style classes. This is his patch, plus a start at some test cases from me. Will check in more, plus a NEWS blurb, later tonight. Index: typeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/typeobject.c,v retrieving revision 2.117 retrieving revision 2.118 diff -C2 -d -r2.117 -r2.118 *** typeobject.c 2001/10/29 22:25:44 2.117 --- typeobject.c 2001/11/14 23:32:33 2.118 *************** *** 578,582 **** --- 578,623 ---- } + static int + fill_classic_mro(PyObject *mro, PyObject *cls) + { + PyObject *bases, *base; + int i, n; + + assert(PyList_Check(mro)); + assert(PyClass_Check(cls)); + i = PySequence_Contains(mro, cls); + if (i < 0) + return -1; + if (!i) { + if (PyList_Append(mro, cls) < 0) + return -1; + } + bases = ((PyClassObject *)cls)->cl_bases; + assert(bases && PyTuple_Check(bases)); + n = PyTuple_GET_SIZE(bases); + for (i = 0; i < n; i++) { + base = PyTuple_GET_ITEM(bases, i); + if (fill_classic_mro(mro, base) < 0) + return -1; + } + return 0; + } + static PyObject * + classic_mro(PyObject *cls) + { + PyObject *mro; + + assert(PyClass_Check(cls)); + mro = PyList_New(0); + if (mro != NULL) { + if (fill_classic_mro(mro, cls) == 0) + return mro; + Py_DECREF(mro); + } + return NULL; + } + + static PyObject * mro_implementation(PyTypeObject *type) { *************** *** 590,596 **** return NULL; for (i = 0; i < n; i++) { ! PyTypeObject *base = ! (PyTypeObject *) PyTuple_GET_ITEM(bases, i); ! PyObject *parentMRO = PySequence_List(base->tp_mro); if (parentMRO == NULL) { Py_DECREF(result); --- 631,641 ---- return NULL; for (i = 0; i < n; i++) { ! PyObject *base = PyTuple_GET_ITEM(bases, i); ! PyObject *parentMRO; ! if (PyType_Check(base)) ! parentMRO = PySequence_List( ! ((PyTypeObject*)base)->tp_mro); ! else ! parentMRO = classic_mro(base); if (parentMRO == NULL) { Py_DECREF(result); *************** *** 652,664 **** int i, n; PyTypeObject *base, *winner, *candidate, *base_i; assert(PyTuple_Check(bases)); n = PyTuple_GET_SIZE(bases); assert(n > 0); ! base = (PyTypeObject *)PyTuple_GET_ITEM(bases, 0); ! winner = &PyBaseObject_Type; for (i = 0; i < n; i++) { ! base_i = (PyTypeObject *)PyTuple_GET_ITEM(bases, i); ! if (!PyType_Check((PyObject *)base_i)) { PyErr_SetString( PyExc_TypeError, --- 697,712 ---- int i, n; PyTypeObject *base, *winner, *candidate, *base_i; + PyObject *base_proto; assert(PyTuple_Check(bases)); n = PyTuple_GET_SIZE(bases); assert(n > 0); ! base = NULL; ! winner = NULL; for (i = 0; i < n; i++) { ! base_proto = PyTuple_GET_ITEM(bases, i); ! if (PyClass_Check(base_proto)) ! continue; ! if (!PyType_Check(base_proto)) { PyErr_SetString( PyExc_TypeError, *************** *** 666,669 **** --- 714,718 ---- return NULL; } + base_i = (PyTypeObject *)base_proto; if (base_i->tp_dict == NULL) { if (PyType_Ready(base_i) < 0) *************** *** 671,675 **** } candidate = solid_base(base_i); ! if (PyType_IsSubtype(winner, candidate)) ; else if (PyType_IsSubtype(candidate, winner)) { --- 720,728 ---- } candidate = solid_base(base_i); ! if (winner == NULL) { ! winner = candidate; ! base = base_i; ! } ! else if (PyType_IsSubtype(winner, candidate)) ; else if (PyType_IsSubtype(candidate, winner)) { *************** *** 828,831 **** --- 881,886 ---- tmp = PyTuple_GET_ITEM(bases, i); tmptype = tmp->ob_type; + if (tmptype == &PyClass_Type) + continue; /* Special case classic classes */ if (PyType_IsSubtype(winner, tmptype)) continue; *************** *** 1080,1084 **** { int i, n; ! PyObject *mro, *res, *dict; /* Look in tp_dict of types in MRO */ --- 1135,1139 ---- { int i, n; ! PyObject *mro, *res, *base, *dict; /* Look in tp_dict of types in MRO */ *************** *** 1087,1093 **** n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { ! type = (PyTypeObject *) PyTuple_GET_ITEM(mro, i); ! assert(PyType_Check(type)); ! dict = type->tp_dict; assert(dict && PyDict_Check(dict)); res = PyDict_GetItem(dict, name); --- 1142,1152 ---- n = PyTuple_GET_SIZE(mro); for (i = 0; i < n; i++) { ! base = PyTuple_GET_ITEM(mro, i); ! if (PyClass_Check(base)) ! dict = ((PyClassObject *)base)->cl_dict; ! else { ! assert(PyType_Check(base)); ! dict = ((PyTypeObject *)base)->tp_dict; ! } assert(dict && PyDict_Check(dict)); res = PyDict_GetItem(dict, name); *************** *** 1921,1927 **** n = PyTuple_GET_SIZE(bases); for (i = 1; i < n; i++) { ! base = (PyTypeObject *)PyTuple_GET_ITEM(bases, i); ! assert(PyType_Check(base)); ! inherit_slots(type, base); } --- 1980,1986 ---- n = PyTuple_GET_SIZE(bases); for (i = 1; i < n; i++) { ! PyObject *b = PyTuple_GET_ITEM(bases, i); ! if (PyType_Check(b)) ! inherit_slots(type, (PyTypeObject *)b); } *************** *** 1941,1946 **** n = PyTuple_GET_SIZE(bases); for (i = 0; i < n; i++) { ! base = (PyTypeObject *) PyTuple_GET_ITEM(bases, i); ! if (add_subclass((PyTypeObject *)base, type) < 0) goto error; } --- 2000,2006 ---- n = PyTuple_GET_SIZE(bases); for (i = 0; i < n; i++) { ! PyObject *b = PyTuple_GET_ITEM(bases, i); ! if (PyType_Check(b) && ! add_subclass((PyTypeObject *)b, type) < 0) goto error; } *************** *** 3666,3670 **** slotdef *p; PyObject *mro, *descr; - PyTypeObject *base; PyWrapperDescrObject *d; int i, n, offset; --- 3726,3729 ---- *************** *** 3691,3701 **** descr = NULL; for (i = 0; i < n; i++) { ! base = (PyTypeObject *) ! PyTuple_GET_ITEM(mro, i); ! assert(PyType_Check(base)); ! descr = PyDict_GetItem( ! base->tp_dict, p->name_strobj); ! if (descr != NULL) ! break; } if (descr == NULL) --- 3750,3765 ---- descr = NULL; for (i = 0; i < n; i++) { ! PyObject *b = PyTuple_GET_ITEM(mro, i); ! PyObject *dict = NULL; ! if (PyType_Check(b)) ! dict = ((PyTypeObject *)b)->tp_dict; ! else if (PyClass_Check(b)) ! dict = ((PyClassObject *)b)->cl_dict; ! if (dict != NULL) { ! descr = PyDict_GetItem( ! dict, p->name_strobj); ! if (descr != NULL) ! break; ! } } if (descr == NULL) *************** *** 3826,3830 **** if (su->obj != NULL) { ! PyObject *mro, *res, *tmp; descrgetfunc f; int i, n; --- 3890,3894 ---- if (su->obj != NULL) { ! PyObject *mro, *res, *tmp, *dict; descrgetfunc f; int i, n; *************** *** 3859,3865 **** for (; i < n; i++) { tmp = PyTuple_GET_ITEM(mro, i); ! assert(PyType_Check(tmp)); ! res = PyDict_GetItem( ! ((PyTypeObject *)tmp)->tp_dict, name); if (res != NULL) { Py_INCREF(res); --- 3923,3933 ---- for (; i < n; i++) { tmp = PyTuple_GET_ITEM(mro, i); ! if (PyType_Check(tmp)) ! dict = ((PyTypeObject *)tmp)->tp_dict; ! else if (PyClass_Check(tmp)) ! dict = ((PyClassObject *)tmp)->cl_dict; ! else ! continue; ! res = PyDict_GetItem(dict, name); if (res != NULL) { Py_INCREF(res); From tim_one@users.sourceforge.net Wed Nov 14 23:56:47 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 14 Nov 2001 15:56:47 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.103,1.104 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv14191/python/Lib/test Modified Files: test_descr.py Log Message: More simple test cases for mixed classic+new multiple inheritance. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** test_descr.py 2001/11/14 23:32:33 1.103 --- test_descr.py 2001/11/14 23:56:45 1.104 *************** *** 831,834 **** --- 831,862 ---- # MI mixing classic and new-style classes. + + class A: + x = 1 + + class B(A): + pass + + class C(A): + x = 2 + + class D(B, C): + pass + vereq(D.x, 1) + + # Classic MRO is preserved for a classic base class. + class E(D, object): + pass + vereq(E.__mro__, (E, D, B, A, C, object)) + vereq(E.x, 1) + + # But with a mix of classic bases, their MROs are combined using + # new-style MRO. + class F(B, C, object): + pass + vereq(F.__mro__, (F, B, C, A, object)) + vereq(F.x, 2) + + # Try something else. class C: def cmethod(self): *************** *** 876,879 **** --- 904,914 ---- # vereq(M3.__mro__, (M3, M1, M2, object, D, C)) vereq(M3.__mro__, (M3, M1, M2, D, C, object)) # XXX ? + m = M3() + vereq(m.cmethod(), "C a") + vereq(m.dmethod(), "D a") + vereq(m.m1method(), "M1 a") + vereq(m.m2method(), "M2 a") + vereq(m.m3method(), "M3 a") + vereq(m.all_method(), "M3 b") def diamond(): From fdrake@users.sourceforge.net Thu Nov 15 17:22:06 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 15 Nov 2001 09:22:06 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib tkinter.tex,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv31150/lib Added Files: tkinter.tex Log Message: Tkinter chapter, contributed by Mike Clarkson. Based in part on the "Tkinter Life Preserver" by Matt Conway. --- NEW FILE: tkinter.tex --- \chapter{Graphical User Interface Modules \label{gui}} \index{GUI} \index{Graphical User Interface} \index{Tkinter} \index{Tk} Tk/Tcl has long been an integral part of Python. It provides a robust and platform independent windowing toolkit, that is available to Python programmers using the \refmodule{Tkinter} module, and its extension, the \refmodule{Tix} module. \refmodule{Tkinter} is a thin object--oriented layer on top of Tcl/Tk. To use \refmodule{Tkinter}, you don't need to write Tcl code, but you will need to consult the Tk documentation, and occasionally the Tcl documentation. \refmodule{Tkinter} is a set of wrappers that implement the Tk widgets as Python classes. In addition, the internal module \module{\_tkinter} provides a threadsafe mechanism which allows Python and Tcl to interact. [...1635 lines suppressed...] If there are arguments: \begin{enumerate} \item If \programopt{-e} is used, arguments are files opened for editing and \code{sys.argv} reflects the arguments passed to IDLE itself. \item Otherwise, if \programopt{-c} is used, all arguments are placed in \code{sys.argv[1:...]}, with \code{sys.argv[0]} set to \code{'-c'}. \item Otherwise, if neither \programopt{-e} nor \programopt{-c} is used, the first argument is a script which is executed with the remaining arguments in \code{sys.argv[1:...]} and \code{sys.argv[0]} set to the script name. If the script name is '-', no script is executed but an interactive Python session is started; the arguments are still available in \code{sys.argv}. \end{enumerate} From fdrake@users.sourceforge.net Thu Nov 15 17:25:31 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 15 Nov 2001 09:25:31 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib lib.tex,1.195,1.196 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv32004/lib Modified Files: lib.tex Log Message: Add entries for the new Tkinter chapter. Index: lib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/lib.tex,v retrieving revision 1.195 retrieving revision 1.196 diff -C2 -d -r1.195 -r1.196 *** lib.tex 2001/11/05 01:55:43 1.195 --- lib.tex 2001/11/15 17:25:29 1.196 *************** *** 270,273 **** --- 270,276 ---- \input{librotor} + \input{tkinter} + \input{libturtle} + \input{librestricted} % Restricted Execution \input{librexec} From fdrake@users.sourceforge.net Thu Nov 15 17:25:31 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 15 Nov 2001 09:25:31 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc Makefile.deps,1.78,1.79 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv32004 Modified Files: Makefile.deps Log Message: Add entries for the new Tkinter chapter. Index: Makefile.deps =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile.deps,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** Makefile.deps 2001/10/29 17:40:40 1.78 --- Makefile.deps 2001/11/15 17:25:29 1.79 *************** *** 309,312 **** --- 309,314 ---- lib/libatexit.tex \ lib/libmmap.tex \ + lib/tkinter.tex \ + lib/libturtle.tex \ lib/libcfgparser.tex From fdrake@users.sourceforge.net Thu Nov 15 17:26:12 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 15 Nov 2001 09:26:12 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc ACKS,1.28,1.29 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv32158 Modified Files: ACKS Log Message: Thanks for the Tkinter chapter, Mike! Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ACKS,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** ACKS 2001/11/07 06:23:27 1.28 --- ACKS 2001/11/15 17:26:10 1.29 *************** *** 38,41 **** --- 38,42 ---- Mauro Cicognini Gilles Civario + Mike Clarkson Steve Clift Matthew Cowles From tim_one@users.sourceforge.net Thu Nov 15 19:50:53 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 15 Nov 2001 11:50:53 -0800 Subject: [Python-checkins] CVS: python/dist/src/PCbuild BUILDno.txt,1.23,1.24 pythoncore.dsp,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv5964/python/PCbuild Modified Files: BUILDno.txt pythoncore.dsp Log Message: Bump Windows buildno for 2.2b2. Index: BUILDno.txt =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/BUILDno.txt,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** BUILDno.txt 2001/10/18 15:19:38 1.23 --- BUILDno.txt 2001/11/15 19:50:51 1.24 *************** *** 34,37 **** --- 34,39 ---- Windows Python BUILD numbers ---------------------------- + 26 2.2b2 + 16-Nov-2001 25 2.2b1 19-Oct-2001 Index: pythoncore.dsp =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/pythoncore.dsp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** pythoncore.dsp 2001/10/18 20:51:32 1.27 --- pythoncore.dsp 2001/11/15 19:50:51 1.28 *************** *** 740,748 **** !IF "$(CFG)" == "pythoncore - Win32 Release" ! # ADD CPP /D BUILD=25 !ELSEIF "$(CFG)" == "pythoncore - Win32 Debug" ! # ADD CPP /D BUILD=25 !ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Debug" --- 740,748 ---- !IF "$(CFG)" == "pythoncore - Win32 Release" ! # ADD CPP /D BUILD=26 !ELSEIF "$(CFG)" == "pythoncore - Win32 Debug" ! # ADD CPP /D BUILD=26 !ELSEIF "$(CFG)" == "pythoncore - Win32 Alpha Debug" From tim_one@users.sourceforge.net Thu Nov 15 20:02:24 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 15 Nov 2001 12:02:24 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.312,1.313 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv9141/python/Misc Modified Files: NEWS Log Message: News about mixing classic and new-style classes in MI. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.312 retrieving revision 1.313 diff -C2 -d -r1.312 -r1.313 *** NEWS 2001/11/13 23:11:19 1.312 --- NEWS 2001/11/15 20:02:21 1.313 *************** *** 1,7 **** What's New in Python 2.2b2? ! XXX Planned XXX Release date: 14-Nov-2001 =========================== Type/class unification and new-style classes - The new builtin dictionary() constructor, and dictionary type, have --- 1,20 ---- What's New in Python 2.2b2? ! Release date: 16-Nov-2001 =========================== Type/class unification and new-style classes + + - Restrictions on multiple inheritance from classes with different + metatypes have been relaxed. The only builtin metatypes are one for + classic classes a second for new-style classes, so the primary + visible effect is that this works now: + + class Classic: pass + class Mixed(Classic, object): now + + The MRO (method resolution order) for each base class is respected + according to its kind, but the MRO for the derived class is computed + using new-style MRO rules if any base clase is a new-style class. + This needs to be documented. - The new builtin dictionary() constructor, and dictionary type, have From gvanrossum@users.sourceforge.net Thu Nov 15 20:27:56 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 15 Nov 2001 12:27:56 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.313,1.314 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv16968 Modified Files: NEWS Log Message: Correct the description of mixed multiple inheritance: the code special-cases classic classes, it doesn't do anything about other cases where different metaclasses are involved (except for the trivial case where one metaclass is a subclass of the others). Also note that it's metaclass, not metatype. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.313 retrieving revision 1.314 diff -C2 -d -r1.313 -r1.314 *** NEWS 2001/11/15 20:02:21 1.313 --- NEWS 2001/11/15 20:27:54 1.314 *************** *** 5,15 **** Type/class unification and new-style classes ! - Restrictions on multiple inheritance from classes with different ! metatypes have been relaxed. The only builtin metatypes are one for ! classic classes a second for new-style classes, so the primary ! visible effect is that this works now: class Classic: pass ! class Mixed(Classic, object): now The MRO (method resolution order) for each base class is respected --- 5,13 ---- Type/class unification and new-style classes ! - Multiple inheritance mixing new-style and classic classes in the ! list of base classes is now allowed, so this works now: class Classic: pass ! class Mixed(Classic, object): pass The MRO (method resolution order) for each base class is respected From gvanrossum@users.sourceforge.net Thu Nov 15 20:33:13 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Thu, 15 Nov 2001 12:33:13 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.314,1.315 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv18437 Modified Files: NEWS Log Message: Group dict[ionary] news together; and use dict() instead of dictionary(). Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.314 retrieving revision 1.315 diff -C2 -d -r1.314 -r1.315 *** NEWS 2001/11/15 20:27:54 1.314 --- NEWS 2001/11/15 20:33:10 1.315 *************** *** 19,22 **** --- 19,26 ---- been renamed to dict. This reflects a decade of common usage. + - dict() now accepts an iterable object producing 2-sequences. For + example, dict(d.items()) == d for any dictionary d. The argument, + and the elements of the argument, can be any iterable objects. + - New-style classes can now have a __del__ method, which is called when the instance is deleted (just like for classic classes). *************** *** 25,33 **** instances of new-style classes that have a __dict__ (unless the base class forbids it). - - - dictionary() now accepts an iterable object producing 2-sequences. - For example, dictionary(d.items()) == d for any dictionary d. The - argument, and the elements of the argument, can be any iterable - objects. - Methods of built-in types now properly check for keyword arguments --- 29,32 ---- From fdrake@users.sourceforge.net Thu Nov 15 20:41:05 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 15 Nov 2001 12:41:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libturtle.tex,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv21063/lib Modified Files: libturtle.tex Log Message: Clean up the descriptions of multi-signature functions so we do the right thing in the index. Index: libturtle.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libturtle.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** libturtle.tex 2000/12/01 15:25:23 1.3 --- libturtle.tex 2001/11/15 20:41:03 1.4 *************** *** 74,86 **** \begin{funcdesc}{color}{s} ! Set the color by giving a Tk color string. ! \end{funcdesc} ! ! \begin{funcdesc}{color}{(r, g, b)} ! Set the color by giving a RGB tuple, each between 0 and 1. ! \end{funcdesc} ! ! \begin{funcdesc}{color}{r, g, b} ! Set the color by giving the RGB components, each between 0 and 1. \end{funcdesc} --- 74,84 ---- \begin{funcdesc}{color}{s} ! \funclineni{color}{(r, g, b)} ! \funclineni{color}{r, g, b} ! Set the pen color. In the first form, the color is specified as a ! Tk color specification as a string. The second form specifies the ! color as a tuple of the RGB values, each in the range [0..1]. For the ! third form, the color is specified giving the RGB values as three ! separate parameters (each in the range [0..1]). \end{funcdesc} *************** *** 110,119 **** \begin{funcdesc}{goto}{x, y} ! Go to co-ordinates (\var{x}, \var{y}). ! \end{funcdesc} ! ! \begin{funcdesc}{goto}{(x, y)} ! Go to co-ordinates (\var{x}, \var{y}) (specified as a tuple instead of ! individually). \end{funcdesc} --- 108,114 ---- \begin{funcdesc}{goto}{x, y} ! \funclineni{goto}{(x, y)} ! Go to co-ordinates \var{x}, \var{y}. The co-ordinates may be ! specified either as two separate arguments or as a 2-tuple. \end{funcdesc} From fdrake@users.sourceforge.net Thu Nov 15 22:10:49 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 15 Nov 2001 14:10:49 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib lib.tex,1.196,1.197 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv16211/lib Modified Files: lib.tex Log Message: The turtle docs will be moving to another location in the Tkinter chapter. Index: lib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/lib.tex,v retrieving revision 1.196 retrieving revision 1.197 diff -C2 -d -r1.196 -r1.197 *** lib.tex 2001/11/15 17:25:29 1.196 --- lib.tex 2001/11/15 22:10:46 1.197 *************** *** 271,275 **** \input{tkinter} - \input{libturtle} \input{librestricted} % Restricted Execution --- 271,274 ---- From bwarsaw@users.sourceforge.net Thu Nov 15 23:37:28 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 15 Nov 2001 15:37:28 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libcopyreg.tex,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv10936/Doc/lib Modified Files: libcopyreg.tex Log Message: Minor updates to add more pointers to the pickle documentation, and to clarify some of the interface. Index: libcopyreg.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcopyreg.tex,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** libcopyreg.tex 2000/10/11 22:27:51 1.9 --- libcopyreg.tex 2001/11/15 23:37:26 1.10 *************** *** 25,32 **** function for objects of type \var{type}; \var{type} should not a class object. \var{function} should return either a string or a ! tuple. The optional \var{constructor} parameter, if provided, is a callable object which can be used to reconstruct the object when called with the tuple of arguments returned by \var{function} at pickling time. \exception{TypeError} will be raised if \var{object} is a class or \var{constructor} is not callable. \end{funcdesc} --- 25,38 ---- function for objects of type \var{type}; \var{type} should not a class object. \var{function} should return either a string or a ! tuple containing two or three elements. ! ! The optional \var{constructor} parameter, if provided, is a callable object which can be used to reconstruct the object when called with the tuple of arguments returned by \var{function} at pickling time. \exception{TypeError} will be raised if \var{object} is a class or \var{constructor} is not callable. + + See the \refmodule{pickle} module for more + details on the interface expected of \var{function} and + \var{constructor}. \end{funcdesc} From bwarsaw@users.sourceforge.net Thu Nov 15 23:39:09 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 15 Nov 2001 15:39:09 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libpickle.tex,1.30,1.31 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv11321/Doc/lib Modified Files: libpickle.tex Log Message: A massive rewrite affecting both the pickle and cPickle module documentation. This addresses previously undocumented parts of the public interfaces, the differences between pickle and cPickle, security concerns, and on and on. Fred please proofread! Index: libpickle.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpickle.tex,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** libpickle.tex 2001/10/20 04:24:09 1.30 --- libpickle.tex 2001/11/15 23:39:07 1.31 *************** *** 1,8 **** ! \section{\module{pickle} --- ! Python object serialization} \declaremodule{standard}{pickle} \modulesynopsis{Convert Python objects to streams of bytes and back.} % Substantial improvements by Jim Kerr . \index{persistence} --- 1,8 ---- ! \section{\module{pickle} --- Python object serialization} [...989 lines suppressed...] ! should benefit from the greatly improved performance of the ! \module{cPickle} module. ! The pickle data stream produced by \module{pickle} and ! \module{cPickle} are identical, so it is possible to use ! \module{pickle} and \module{cPickle} interchangeably with existing ! pickles\footnote{Since the pickle data format is actually a tiny ! stack-oriented programming language, and some freedom is taken in the ! encodings of certain objects, it is possible that the two modules ! produce different data streams for the same input objects. However it ! is guaranteed that they will always be able to read each other's ! data streams.}. ! There are additional minor differences in API between \module{cPickle} ! and \module{pickle}, however for most applications, they are ! interchangable. More documentation is provided in the ! \module{pickle} module documentation, which ! includes a list of the documented differences. ! ! From bwarsaw@users.sourceforge.net Thu Nov 15 23:43:00 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 15 Nov 2001 15:43:00 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib pickle.py,1.54,1.55 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv12222/Lib Modified Files: pickle.py Log Message: Two changes: load_inst(): Implement the security hook that cPickle already had. When unpickling callables which are not classes, we look to see if the object has an attribute __safe_for_unpickling__. If this exists and has a true value, then we can call it to create the unpickled object. Otherwise we raise an UnpicklingError. find_class(): We no longer mask ImportError, KeyError, and AttributeError by transforming them into SystemError. The latter is definitely not the right thing to do, so we let the former three exceptions simply propagate up if they occur, i.e. we remove the try/except! Index: pickle.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pickle.py,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** pickle.py 2001/11/09 16:15:04 1.54 --- pickle.py 2001/11/15 23:42:58 1.55 *************** *** 770,773 **** --- 770,776 ---- if not instantiated: try: + if not hasattr(klass, '__safe_for_unpickling__'): + raise UnpicklingError('%s is not safe for unpickling' % + klass) value = apply(klass, args) except TypeError, err: *************** *** 808,819 **** def find_class(self, module, name): ! try: ! __import__(module) ! mod = sys.modules[module] ! klass = getattr(mod, name) ! except (ImportError, KeyError, AttributeError): ! raise SystemError, \ ! "Failed to import class %s from module %s" % \ ! (name, module) return klass --- 811,817 ---- def find_class(self, module, name): ! __import__(module) ! mod = sys.modules[module] ! klass = getattr(mod, name) return klass From bwarsaw@users.sourceforge.net Thu Nov 15 23:45:28 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 15 Nov 2001 15:45:28 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules cPickle.c,2.69,2.70 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv12731/Modules Modified Files: cPickle.c Log Message: A change to sync with pickle.py: find_class(): We no longer mask all exceptions[1] by transforming them into SystemError. The latter is definitely not the right thing to do, so we let any exceptions that occur in the PyObject_GetAttr() call to simply propagate up if they occur. [1] Note that pickle only masked ImportError, KeyError, and AttributeError, but cPickle masked all exceptions. Index: cPickle.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cPickle.c,v retrieving revision 2.69 retrieving revision 2.70 diff -C2 -d -r2.69 -r2.70 *** cPickle.c 2001/11/12 22:26:10 2.69 --- cPickle.c 2001/11/15 23:45:26 2.70 *************** *** 2538,2549 **** else global = PyObject_GetAttr(module, py_global_name); - if (global == NULL) { - char buf[256 + 37]; - sprintf(buf, "Failed to import class %.128s from module %.128s", - PyString_AS_STRING((PyStringObject*)py_global_name), - PyString_AS_STRING((PyStringObject*)py_module_name)); - PyErr_SetString(PyExc_SystemError, buf); - return NULL; - } return global; } --- 2538,2541 ---- From bwarsaw@users.sourceforge.net Thu Nov 15 23:55:14 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Thu, 15 Nov 2001 15:55:14 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libmarshal.tex,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv14911 Modified Files: libmarshal.tex Log Message: A few minor updates to make it clear(er) that pickle should be used instead of marshal for object serialization. Fred, please proofread! Index: libmarshal.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmarshal.tex,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** libmarshal.tex 2001/10/20 04:24:09 1.21 --- libmarshal.tex 2001/11/15 23:55:12 1.22 *************** *** 1,4 **** \section{\module{marshal} --- ! Alternate Python object serialization} \declaremodule{builtin}{marshal} --- 1,4 ---- \section{\module{marshal} --- ! Internal Python object serialization} \declaremodule{builtin}{marshal} *************** *** 24,28 **** \refmodule{pickle} and \refmodule{shelve}. The \module{marshal} module exists mainly to support reading and writing the ``pseudo-compiled'' code for ! Python modules of \file{.pyc} files. \refstmodindex{pickle} \refstmodindex{shelve} --- 24,34 ---- \refmodule{pickle} and \refmodule{shelve}. The \module{marshal} module exists mainly to support reading and writing the ``pseudo-compiled'' code for ! Python modules of \file{.pyc} files. Therefore, the Python ! maintainers reserve the right to modify the marshal format in backward ! incompatible ways should the need arise. If you're serializing and ! de-serializing Python objects, use the \module{pickle} module. There ! may also be unknown security problems with ! \module{marshal}\footnote{As opposed to the known security issues in ! the \module{pickle} module!}. \refstmodindex{pickle} \refstmodindex{shelve} From fdrake@users.sourceforge.net Fri Nov 16 01:05:29 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 15 Nov 2001 17:05:29 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib tkinter.tex,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv29892/lib Modified Files: tkinter.tex Log Message: Switched a couple of sections around. Cleaned up some markup nits. Add a few more of the Tk-related modules to the list of modules. Index: tkinter.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/tkinter.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** tkinter.tex 2001/11/15 17:22:04 1.1 --- tkinter.tex 2001/11/16 01:05:27 1.2 *************** *** 31,39 **** ! \section{Tkinter \label{tkinter}} ! \index{Tkinter} ! \sectionauthor{Fredrik Lundh}{fredrik@effbot.org} ! ! \index{Tkinter} \declaremodule{standard}{Tkinter} --- 31,36 ---- ! \section{\module{Tkinter} --- ! Python interface to Tcl/Tk} \declaremodule{standard}{Tkinter} *************** *** 110,113 **** --- 107,127 ---- % FIXME + \item[\module{tkColorChooser}] + Dialog to let the user choose a color. + + \item[\module{tkCommonDialog}] + + \item[\module{tkFileDialog}] + Common dialogs to allow the user to specify a file to open or save. + + \item[\module{tkFont}] + Utilities to help work with fonts. + + \item[\module{tkMessageBox}] + Access to standard Tk dialog boxes. + + \item[\module{tkSimpleDialog}] + Basic dialogs and convenience functions. + \item[\module{Tkdnd}] Drag-and-drop support for \refmodule{Tkinter}. *************** *** 121,125 **** \subsection{Tkinter Life Preserver} ! \index{Tkinter} This section is not designed to be an exhaustive tutorial on either --- 135,140 ---- \subsection{Tkinter Life Preserver} ! \sectionauthor{Matt Conway}{} ! % Converted to LaTeX by Mike Clarkson. This section is not designed to be an exhaustive tutorial on either *************** *** 281,285 **** are instantiated. \item The Widget class is not meant to be instantiated, it ! is meant only for subclassing to make ``real'' widgets. (in C++, this is called an `abstract class') \end{itemize} --- 296,300 ---- are instantiated. \item The Widget class is not meant to be instantiated, it ! is meant only for subclassing to make ``real'' widgets. (in \Cpp, this is called an `abstract class') \end{itemize} *************** *** 338,342 **** new \var{widget command} is the programmer's handle for getting the new widget to perform some \var{action}. In C, you'd express this as ! someAction(fred, someOptions), in C++, you would express this as fred.someAction(someOptions), and in Tk, you say: --- 353,357 ---- new \var{widget command} is the programmer's handle for getting the new widget to perform some \var{action}. In C, you'd express this as ! someAction(fred, someOptions), in \Cpp, you would express this as fred.someAction(someOptions), and in Tk, you say: *************** *** 888,895 **** \end{description} - - \section{Tix \label{tix-widgets}} ! \index{Tix} \declaremodule{standard}{Tix} --- 903,909 ---- \end{description} ! \section{\module{Tix} --- ! Extension widgets for Tk} \declaremodule{standard}{Tix} *************** *** 897,900 **** --- 911,916 ---- \sectionauthor{Mike Clarkson}{mikeclarkson@users.sourceforge.net} + \index{Tix} + The \module{Tix} (Tk Interface Extension) module provides an additional rich set of widgets. Although the standard Tk library has *************** *** 987,1039 **** \subsubsection{Basic Widgets} - \index{Balloon widget} \begin{classdesc}{Balloon}{} A \ulink{Balloon} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixBalloon.htm} that pops ! up over a widget to provide help. When the user moves the cursor ! inside a widget to which a Balloon widget has been bound, a small ! pop-up window with a descriptive message will be shown on the screen. \end{classdesc} ! % Python Demo of: \ulink{ Balloon}{http://tix.sourceforge.net/dist/current/demos/samples/Balloon.tcl} - \index{ButtonBox widget} \begin{classdesc}{ButtonBox}{} The \ulink{ButtonBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixButtonBox.htm} widget ! creates a box of buttons, such as is commonly used for \code{Ok Cancel}. \end{classdesc} ! % Python Demo of: \ulink{ ButtonBox}{http://tix.sourceforge.net/dist/current/demos/samples/BtnBox.tcl} - \index{ComboBox widget} \begin{classdesc}{ComboBox}{} The \ulink{ComboBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixComboBox.htm} widget is ! similar to the combo box control in MS Windows. The user can select a ! choice by either typing in the entry subwdget or selecting from the ! listbox subwidget. \end{classdesc} ! % Python Demo of: \ulink{ ComboBox}{http://tix.sourceforge.net/dist/current/demos/samples/ComboBox.tcl} - \index{Control widget} \begin{classdesc}{Control}{} The \ulink{Control} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixControl.htm} widget is ! also known as the \class{SpinBox} widget. The user can adjust the value ! by pressing the two arrow buttons or by entering the value directly ! into the entry. The new value will be checked against the user-defined ! upper and lower limits. \end{classdesc} ! % Python Demo of: \ulink{ Control}{http://tix.sourceforge.net/dist/current/demos/samples/Control.tcl} - \index{LabelEntry widget} \begin{classdesc}{LabelEntry}{} The \ulink{LabelEntry} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixLabelEntry.htm} widget ! packages an entry widget and a label into one mega widget. It can be ! used be used to simplify the creation of ``entry-form'' type of interface. \end{classdesc} --- 1003,1057 ---- \subsubsection{Basic Widgets} \begin{classdesc}{Balloon}{} A \ulink{Balloon} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixBalloon.htm} ! that pops up over a widget to provide help. When the user moves the ! cursor inside a widget to which a Balloon widget has been bound, a ! small pop-up window with a descriptive message will be shown on the ! screen. \end{classdesc} ! % Python Demo of: ! % \ulink{Balloon}{http://tix.sourceforge.net/dist/current/demos/samples/Balloon.tcl} \begin{classdesc}{ButtonBox}{} The \ulink{ButtonBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixButtonBox.htm} ! widget creates a box of buttons, such as is commonly used for \code{Ok ! Cancel}. \end{classdesc} ! % Python Demo of: ! % \ulink{ButtonBox}{http://tix.sourceforge.net/dist/current/demos/samples/BtnBox.tcl} \begin{classdesc}{ComboBox}{} The \ulink{ComboBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixComboBox.htm} ! widget is similar to the combo box control in MS Windows. The user can ! select a choice by either typing in the entry subwdget or selecting ! from the listbox subwidget. \end{classdesc} ! % Python Demo of: ! % \ulink{ComboBox}{http://tix.sourceforge.net/dist/current/demos/samples/ComboBox.tcl} \begin{classdesc}{Control}{} The \ulink{Control} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixControl.htm} ! widget is also known as the \class{SpinBox} widget. The user can ! adjust the value by pressing the two arrow buttons or by entering the ! value directly into the entry. The new value will be checked against ! the user-defined upper and lower limits. \end{classdesc} ! % Python Demo of: ! % \ulink{Control}{http://tix.sourceforge.net/dist/current/demos/samples/Control.tcl} \begin{classdesc}{LabelEntry}{} The \ulink{LabelEntry} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixLabelEntry.htm} ! widget packages an entry widget and a label into one mega widget. It ! can be used be used to simplify the creation of ``entry-form'' type of ! interface. \end{classdesc} *************** *** 1041,1050 **** % \ulink{LabelEntry}{http://tix.sourceforge.net/dist/current/demos/samples/LabEntry.tcl} - \index{LabelFrame widget} \begin{classdesc}{LabelFrame}{} The \ulink{LabelFrame} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixLabelFrame.htm} widget ! packages a frame widget and a label into one mega widget. To create ! widgets inside a LabelFrame widget, one creates the new widgets relative to the \member{frame} subwidget and manage them inside the \member{frame} subwidget. --- 1059,1067 ---- % \ulink{LabelEntry}{http://tix.sourceforge.net/dist/current/demos/samples/LabEntry.tcl} \begin{classdesc}{LabelFrame}{} The \ulink{LabelFrame} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixLabelFrame.htm} ! widget packages a frame widget and a label into one mega widget. To ! create widgets inside a LabelFrame widget, one creates the new widgets relative to the \member{frame} subwidget and manage them inside the \member{frame} subwidget. *************** *** 1054,1063 **** % \ulink{LabelFrame}{http://tix.sourceforge.net/dist/current/demos/samples/LabFrame.tcl} - \index{Meter widget} \begin{classdesc}{Meter}{} The \ulink{Meter} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixMeter.htm} widget can ! be used to show the progress of a background job which may take a long ! time to execute. \end{classdesc} --- 1071,1079 ---- % \ulink{LabelFrame}{http://tix.sourceforge.net/dist/current/demos/samples/LabFrame.tcl} \begin{classdesc}{Meter}{} The \ulink{Meter} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixMeter.htm} ! widget can be used to show the progress of a background job which may ! take a long time to execute. \end{classdesc} *************** *** 1065,1111 **** % \ulink{Meter}{http://tix.sourceforge.net/dist/current/demos/samples/Meter.tcl} - \index{OptionMenu widget} \begin{classdesc}{OptionMenu}{} The \ulink{OptionMenu} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixOptionMenu.htm} creates a ! menu button of options. \end{classdesc} ! % Python Demo of: \ulink{ OptionMenu}{http://tix.sourceforge.net/dist/current/demos/samples/OptMenu.tcl} - \index{PopupMenu widget} \begin{classdesc}{PopupMenu}{} The \ulink{PopupMenu} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixPopupMenu.htm} widget can ! be used as a replacement of the \code{tk_popup} command. The advantage ! of the \refmodule{Tix} PopupMenu widget is it requires less application ! code to manipulate. \end{classdesc} ! % Python Demo of: \ulink{ PopupMenu}{http://tix.sourceforge.net/dist/current/demos/samples/PopMenu.tcl} - \index{Select widget} \begin{classdesc}{Select}{} The \ulink{Select} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixSelect.htm} widget is a ! container of button subwidgets. It can be used to provide radio-box or ! check-box style of selection options for the user. \end{classdesc} ! % Python Demo of: \ulink{ Select}{http://tix.sourceforge.net/dist/current/demos/samples/Select.tcl} - \index{StdButtonBox widget} \begin{classdesc}{StdButtonBox}{} The \ulink{StdButtonBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixStdButtonBox.htm} widget is a ! group of Standard buttons for Motif-like dialog boxes. \end{classdesc} ! % Python Demo of: \ulink{ StdButtonBox}{http://tix.sourceforge.net/dist/current/demos/samples/StdBBox.tcl} \subsubsection{File Selectors} - \index{DirList widget} \begin{classdesc}{DirList}{} The \ulink{DirList} --- 1081,1126 ---- % \ulink{Meter}{http://tix.sourceforge.net/dist/current/demos/samples/Meter.tcl} \begin{classdesc}{OptionMenu}{} The \ulink{OptionMenu} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixOptionMenu.htm} ! creates a menu button of options. \end{classdesc} ! % Python Demo of: ! % \ulink{OptionMenu}{http://tix.sourceforge.net/dist/current/demos/samples/OptMenu.tcl} \begin{classdesc}{PopupMenu}{} The \ulink{PopupMenu} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixPopupMenu.htm} ! widget can be used as a replacement of the \code{tk_popup} ! command. The advantage of the \refmodule{Tix} \class{PopupMenu} widget ! is it requires less application code to manipulate. \end{classdesc} ! % Python Demo of: ! % \ulink{PopupMenu}{http://tix.sourceforge.net/dist/current/demos/samples/PopMenu.tcl} \begin{classdesc}{Select}{} The \ulink{Select} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixSelect.htm} ! widget is a container of button subwidgets. It can be used to provide ! radio-box or check-box style of selection options for the user. \end{classdesc} ! % Python Demo of: ! % \ulink{Select}{http://tix.sourceforge.net/dist/current/demos/samples/Select.tcl} \begin{classdesc}{StdButtonBox}{} The \ulink{StdButtonBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixStdButtonBox.htm} ! widget is a group of standard buttons for Motif-like dialog boxes. \end{classdesc} ! % Python Demo of: ! % \ulink{StdButtonBox}{http://tix.sourceforge.net/dist/current/demos/samples/StdBBox.tcl} \subsubsection{File Selectors} \begin{classdesc}{DirList}{} The \ulink{DirList} *************** *** 1116,1144 **** \end{classdesc} ! % Python Demo of: \ulink{ DirList}{http://tix.sourceforge.net/dist/current/demos/samples/DirList.tcl} - \index{DirTree widget} \begin{classdesc}{DirTree}{} The \ulink{DirTree} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixDirTree.htm} widget ! displays a tree view of a directory, its previous directories and its ! sub-directories. The user can choose one of the directories displayed ! in the list or change to another directory. \end{classdesc} ! % Python Demo of: \ulink{ DirTree}{http://tix.sourceforge.net/dist/current/demos/samples/DirTree.tcl} - \index{DirSelectDialog widget} \begin{classdesc}{DirSelectDialog}{} The \ulink{DirSelectDialog} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixDirSelectDialog.htm} widget ! presents the directories in the file system in a dialog window. The ! user can use this dialog window to navigate through the file system to ! select the desired directory. \end{classdesc} ! % Python Demo of: \ulink{ DirSelectDialog}{http://tix.sourceforge.net/dist/current/demos/samples/DirDlg.tcl} - \index{DirSelectBox widget} \begin{classdesc}{DirSelectBox}{} The \class{DirSelectBox} is similar --- 1131,1159 ---- \end{classdesc} ! % Python Demo of: ! % \ulink{DirList}{http://tix.sourceforge.net/dist/current/demos/samples/DirList.tcl} \begin{classdesc}{DirTree}{} The \ulink{DirTree} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixDirTree.htm} ! widget displays a tree view of a directory, its previous directories ! and its sub-directories. The user can choose one of the directories ! displayed in the list or change to another directory. \end{classdesc} ! % Python Demo of: ! % \ulink{DirTree}{http://tix.sourceforge.net/dist/current/demos/samples/DirTree.tcl} \begin{classdesc}{DirSelectDialog}{} The \ulink{DirSelectDialog} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixDirSelectDialog.htm} ! widget presents the directories in the file system in a dialog ! window. The user can use this dialog window to navigate through the ! file system to select the desired directory. \end{classdesc} ! % Python Demo of: ! % \ulink{DirSelectDialog}{http://tix.sourceforge.net/dist/current/demos/samples/DirDlg.tcl} \begin{classdesc}{DirSelectBox}{} The \class{DirSelectBox} is similar *************** *** 1149,1297 **** \end{classdesc} - \index{ExFileSelectBox widget} \begin{classdesc}{ExFileSelectBox}{} The \ulink{ExFileSelectBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixExFileSelectBox.htm} widget is ! usually embedded in a tixExFileSelectDialog widget. It provides an ! convenient method for the user to select files. The style of the ! ExFileSelectBox widget is very similar to the standard file dialog in ! MS Windows 3.1. \end{classdesc} ! % Python Demo of: \ulink{ ExFileSelectDialog}{http://tix.sourceforge.net/dist/current/demos/samples/EFileDlg.tcl} - \index{FileSelectBox widget} \begin{classdesc}{FileSelectBox}{} The \ulink{FileSelectBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixFileSelectBox.htm} is similar ! to the standard Motif(TM) file-selection box. It is generally used for ! the user to choose a file. FileSelectBox stores the files mostly ! recently selected into a ComboBox widget so that they can be quickly ! selected again. \end{classdesc} ! % Python Demo of: \ulink{ FileSelectDialog}{http://tix.sourceforge.net/dist/current/demos/samples/FileDlg.tcl} - \index{FileEntry widget} \begin{classdesc}{FileEntry}{} The \ulink{FileEntry} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixFileEntry.htm} widget can ! be used to input a filename. The user can type in the filename ! manually. Alternatively, the user can press the button widget that ! sits next to the entry, which will bring up a file selection dialog. \end{classdesc} ! % Python Demo of: \ulink{ FileEntry}{http://tix.sourceforge.net/dist/current/demos/samples/FileEnt.tcl} \subsubsection{Hierachical ListBox} - \index{HList widget} \begin{classdesc}{HList}{} The \ulink{HList} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixHList.htm} widget can be ! used to display any data that have a hierarchical structure, for ! example, file system directory trees. The list entries are indented ! and connected by branch lines according to their places in the hierachy. \end{classdesc} ! % Python Demo of: \ulink{ HList}{http://tix.sourceforge.net/dist/current/demos/samples/HList1.tcl} - \index{CheckList widget} \begin{classdesc}{CheckList}{} The \ulink{CheckList} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixCheckList.htm} widget ! displays a list of items to be selected by the user. CheckList acts ! similarly to the Tk checkbutton or radiobutton widgets, except it is ! capable of handling many more items than checkbuttons or radiobuttons. \end{classdesc} - - % Python Demo of: \ulink{ CheckList}{http://tix.sourceforge.net/dist/current/demos/samples/ChkList.tcl} - % Python Demo of: \ulink{ScrolledHList (1)}{http://tix.sourceforge.net/dist/current/demos/samples/SHList.tcl} - % Python Demo of: \ulink{ScrolledHList (2)}{http://tix.sourceforge.net/dist/current/demos/samples/SHList2.tcl} - \index{Tree widget} \begin{classdesc}{Tree}{} The \ulink{Tree} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixTree.htm} widget can be ! used to display hierachical data in a tree form. The user can adjust ! the view of the tree by opening or closing parts of the tree. \end{classdesc} ! % Python Demo of: \ulink{ Tree}{http://tix.sourceforge.net/dist/current/demos/samples/Tree.tcl} ! % Python Demo of: \ulink{Tree (Dynamic)}{http://tix.sourceforge.net/dist/current/demos/samples/DynTree.tcl} \subsubsection{Tabular ListBox} - \index{TList widget} \begin{classdesc}{TList}{} The \ulink{TList} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixTList.htm} widget can be ! used to display data in a tabular format. The list entries of a TList ! widget are similar to the entries in the Tk listbox widget. The main ! differences are (1) the TList widget can display the list entries in a ! two dimensional format and (2) you can use graphical images as well as ! multiple colors and fonts for the list entries. \end{classdesc} ! % Python Demo of: \ulink{ScrolledTList (1)}{http://tix.sourceforge.net/dist/current/demos/samples/STList1.tcl} ! % Python Demo of: \ulink{ScrolledTList (2)}{http://tix.sourceforge.net/dist/current/demos/samples/STList2.tcl} % Grid has yet to be added to Python % \subsubsection{Grid Widget} ! % % Python Demo of: \ulink{Simple Grid}{http://tix.sourceforge.net/dist/current/demos/samples/SGrid0.tcl} ! % % Python Demo of: \ulink{ScrolledGrid}{http://tix.sourceforge.net/dist/current/demos/samples/SGrid1.tcl} ! % % Python Demo of: \ulink{Editable Grid}{http://tix.sourceforge.net/dist/current/demos/samples/EditGrid.tcl} \subsubsection{Manager Widgets} - \index{PanedWindow widget} \begin{classdesc}{PanedWindow}{} The \ulink{PanedWindow} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixPanedWindow.htm} widget ! allows the user to interactively manipulate the sizes of several ! panes. The panes can be arranged either vertically or horizontally.The ! user changes the sizes of the panes by dragging the resize handle ! between two panes. \end{classdesc} ! % Python Demo of: \ulink{ PanedWindow}{http://tix.sourceforge.net/dist/current/demos/samples/PanedWin.tcl} - \index{ListNoteBook widget} \begin{classdesc}{ListNoteBook}{} The \ulink{ListNoteBook} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixListNoteBook.htm} widget is ! very similar to the TixNoteBook widget: it can be used to display many ! windows in a limited space using a notebook metaphor. The notebook is ! divided into a stack of pages (windows). At one time only one of these ! pages can be shown. The user can navigate through these pages by ! choosing the name of the desired page in the \member{hlist} subwidget. \end{classdesc} ! % Python Demo of: \ulink{ ListNoteBook}{http://tix.sourceforge.net/dist/current/demos/samples/ListNBK.tcl} ! - \index{NoteBook widget} \begin{classdesc}{NoteBook}{} The \ulink{NoteBook} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixNoteBook.htm} widget can ! be used to display many windows in a limited space using a notebook ! metaphor. The notebook is divided into a stack of pages. At one time ! only one of these pages can be shown. The user can navigate through ! these pages by choosing the visual ``tabs'' at the top of the NoteBook widget. \end{classdesc} ! % Python Demo of: \ulink{ NoteBook}{http://tix.sourceforge.net/dist/current/demos/samples/NoteBook.tcl} % \subsubsection{Scrolled Widgets} ! % Python Demo of: \ulink{ ScrolledListBox}{http://tix.sourceforge.net/dist/current/demos/samples/SListBox.tcl} ! % Python Demo of: \ulink{ ScrolledText}{http://tix.sourceforge.net/dist/current/demos/samples/SText.tcl} ! % Python Demo of: \ulink{ ScrolledWindow}{http://tix.sourceforge.net/dist/current/demos/samples/SWindow.tcl} ! % Python Demo of: \ulink{Canvas Object View}{http://tix.sourceforge.net/dist/current/demos/samples/CObjView.tcl} --- 1164,1328 ---- \end{classdesc} \begin{classdesc}{ExFileSelectBox}{} The \ulink{ExFileSelectBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixExFileSelectBox.htm} ! widget is usually embedded in a tixExFileSelectDialog widget. It ! provides an convenient method for the user to select files. The style ! of the \class{ExFileSelectBox} widget is very similar to the standard ! file dialog on MS Windows 3.1. \end{classdesc} ! % Python Demo of: ! %\ulink{ExFileSelectDialog}{http://tix.sourceforge.net/dist/current/demos/samples/EFileDlg.tcl} \begin{classdesc}{FileSelectBox}{} The \ulink{FileSelectBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixFileSelectBox.htm} ! is similar to the standard Motif(TM) file-selection box. It is ! generally used for the user to choose a file. FileSelectBox stores the ! files mostly recently selected into a \class{ComboBox} widget so that ! they can be quickly selected again. \end{classdesc} ! % Python Demo of: ! % \ulink{FileSelectDialog}{http://tix.sourceforge.net/dist/current/demos/samples/FileDlg.tcl} \begin{classdesc}{FileEntry}{} The \ulink{FileEntry} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixFileEntry.htm} ! widget can be used to input a filename. The user can type in the ! filename manually. Alternatively, the user can press the button widget ! that sits next to the entry, which will bring up a file selection ! dialog. \end{classdesc} ! % Python Demo of: ! % \ulink{FileEntry}{http://tix.sourceforge.net/dist/current/demos/samples/FileEnt.tcl} \subsubsection{Hierachical ListBox} \begin{classdesc}{HList}{} The \ulink{HList} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixHList.htm} ! widget can be used to display any data that have a hierarchical ! structure, for example, file system directory trees. The list entries ! are indented and connected by branch lines according to their places ! in the hierachy. \end{classdesc} ! % Python Demo of: ! % \ulink{HList}{http://tix.sourceforge.net/dist/current/demos/samples/HList1.tcl} \begin{classdesc}{CheckList}{} The \ulink{CheckList} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixCheckList.htm} ! widget displays a list of items to be selected by the user. CheckList ! acts similarly to the Tk checkbutton or radiobutton widgets, except it ! is capable of handling many more items than checkbuttons or ! radiobuttons. \end{classdesc} + % Python Demo of: + % \ulink{ CheckList}{http://tix.sourceforge.net/dist/current/demos/samples/ChkList.tcl} + % Python Demo of: + % \ulink{ScrolledHList (1)}{http://tix.sourceforge.net/dist/current/demos/samples/SHList.tcl} + % Python Demo of: + % \ulink{ScrolledHList (2)}{http://tix.sourceforge.net/dist/current/demos/samples/SHList2.tcl} \begin{classdesc}{Tree}{} The \ulink{Tree} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixTree.htm} ! widget can be used to display hierachical data in a tree form. The ! user can adjust the view of the tree by opening or closing parts of ! the tree. \end{classdesc} ! % Python Demo of: ! % \ulink{Tree}{http://tix.sourceforge.net/dist/current/demos/samples/Tree.tcl} ! % Python Demo of: ! % \ulink{Tree (Dynamic)}{http://tix.sourceforge.net/dist/current/demos/samples/DynTree.tcl} \subsubsection{Tabular ListBox} \begin{classdesc}{TList}{} The \ulink{TList} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixTList.htm} ! widget can be used to display data in a tabular format. The list ! entries of a \class{TList} widget are similar to the entries in the Tk ! listbox widget. The main differences are (1) the \class{TList} widget ! can display the list entries in a two dimensional format and (2) you ! can use graphical images as well as multiple colors and fonts for the ! list entries. \end{classdesc} ! % Python Demo of: ! % \ulink{ScrolledTList (1)}{http://tix.sourceforge.net/dist/current/demos/samples/STList1.tcl} ! % Python Demo of: ! % \ulink{ScrolledTList (2)}{http://tix.sourceforge.net/dist/current/demos/samples/STList2.tcl} % Grid has yet to be added to Python % \subsubsection{Grid Widget} ! % Python Demo of: ! % \ulink{Simple Grid}{http://tix.sourceforge.net/dist/current/demos/samples/SGrid0.tcl} ! % Python Demo of: ! % \ulink{ScrolledGrid}{http://tix.sourceforge.net/dist/current/demos/samples/SGrid1.tcl} ! % Python Demo of: ! % \ulink{Editable Grid}{http://tix.sourceforge.net/dist/current/demos/samples/EditGrid.tcl} \subsubsection{Manager Widgets} \begin{classdesc}{PanedWindow}{} The \ulink{PanedWindow} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixPanedWindow.htm} ! widget allows the user to interactively manipulate the sizes of ! several panes. The panes can be arranged either vertically or ! horizontally. The user changes the sizes of the panes by dragging the ! resize handle between two panes. \end{classdesc} ! % Python Demo of: ! % \ulink{PanedWindow}{http://tix.sourceforge.net/dist/current/demos/samples/PanedWin.tcl} \begin{classdesc}{ListNoteBook}{} The \ulink{ListNoteBook} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixListNoteBook.htm} ! widget is very similar to the \class{TixNoteBook} widget: it can be ! used to display many windows in a limited space using a notebook ! metaphor. The notebook is divided into a stack of pages (windows). At ! one time only one of these pages can be shown. The user can navigate ! through these pages by choosing the name of the desired page in the ! \member{hlist} subwidget. \end{classdesc} ! % Python Demo of: ! % \ulink{ListNoteBook}{http://tix.sourceforge.net/dist/current/demos/samples/ListNBK.tcl} \begin{classdesc}{NoteBook}{} The \ulink{NoteBook} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixNoteBook.htm} ! widget can be used to display many windows in a limited space using a ! notebook metaphor. The notebook is divided into a stack of pages. At ! one time only one of these pages can be shown. The user can navigate ! through these pages by choosing the visual ``tabs'' at the top of the ! NoteBook widget. \end{classdesc} ! % Python Demo of: ! % \ulink{NoteBook}{http://tix.sourceforge.net/dist/current/demos/samples/NoteBook.tcl} % \subsubsection{Scrolled Widgets} ! % Python Demo of: ! % \ulink{ScrolledListBox}{http://tix.sourceforge.net/dist/current/demos/samples/SListBox.tcl} ! % Python Demo of: ! % \ulink{ScrolledText}{http://tix.sourceforge.net/dist/current/demos/samples/SText.tcl} ! % Python Demo of: ! % \ulink{ScrolledWindow}{http://tix.sourceforge.net/dist/current/demos/samples/SWindow.tcl} ! % Python Demo of: ! % \ulink{Canvas Object View}{http://tix.sourceforge.net/dist/current/demos/samples/CObjView.tcl} *************** *** 1360,1449 **** %end{latexonly} - - \section{Other User Interface Modules and Packages - \label{other-gui-modules}} - - - There are an number of extension widget sets to \refmodule{Tkinter}. - - \begin{seealso} - \seetitle[http://pmw.sourceforge.net/]{Python megawidgets}{is a - toolkit for building high-level compound widgets in Python using the - \refmodule{Tkinter} module. It consists of a set of base classes and - a library of flexible and extensible megawidgets built on this - foundation. These megawidgets include notebooks, comboboxes, selection - widgets, paned widgets, scrolled widgets, dialog windows, etc. Also, - with the Pmw.Blt interface to BLT, the busy, graph, stripchart, tabset - and vector commands are be available. - - The initial ideas for Pmw were taken from the Tk \code{itcl} - extensions \code{[incr Tk]} by Michael McLennan and \code{[incr - Widgets]} by Mark Ulferts. Several of the megawidgets are direct - translations from the itcl to Python. It offers most of the range of - widgets that \code{[incr Widgets]} does, and is almost as complete as - Tix, lacking however Tix's fast \class{HList} widget for drawing trees. - } - \seetitle[http://tkinter.effbot.org]{Tkinter3000}{ - is a Widget Construction Kit that allows you to write new Tkinter - widgets in Python using Mixins. It is built on top of Tkinter, - and does not offer the extended range of widgets that \refmodule{Tix} does, - but does allow a form of building mega-widgets. The project is - still in the early stages. - } - \end{seealso} - - - \refmodule{Tkinter} is not the only GUI for Python, but is however the - most commonly used one. - - \begin{seealso} - \seetitle[http://www.wxwindows.org]{wxWindows}{ - is a GUI toolkit that combines the most attractive attributes of Qt, - Tk, Motif, and GTK+ in one powerful and efficient package. It is - implemented in C++. wxWindows supports two flavors of Unix - implementation: GTK+ and Motif, and under Windows, it has a standard - Microsoft Foundation Classes (MFC) appearance, because it uses Win32 - widgets. There is a Python class wrapper, independent of Tkinter. - - wxWindows is much richer in widgets than \refmodule{Tkinter}, with its - help system, sophisticated HTML and image viewers, and other - specialized widgets, extensive documentation, and printing capabilities. - } - \seetitle[http://www.thekompany.com]{PyKDE}{ - PyKDE is a SIP wrapped interface to the Qt toolkit. - The Qt C++ toolkit lies at the heart of the KDE desktop, and the - Qt toolkit allows very tight integration with KDE, and also Windows - portability. SIP is a tool for generating bindings for \Cpp{} libraries - as Python classes, and is specifically designed for Python. - } - \seetitle[http://fxpy.sourceforge.net/]{FXPy}{ - is a Python extension module which provides an interface to the - \citetitle[http://www.cfdrc.com/FOX/fox.html]{FOX} GUI. - FOX is a C++ based Toolkit for developing Graphical User Interfaces - easily and effectively. It offers a wide, and growing, collection of - Controls, and provides state of the art facilities such as drag and - drop, selection, as well as OpenGL widgets for 3D graphical - manipulation. FOX also implements icons, images, and user-convenience - features such as status line help, and tooltips. - - Even though FOX offers a large collection of Controls already, FOX - leverages C++ to allow programmers to easily build additional Controls - and GUI elements, simply by taking existing controls, and creating a - derived class which simply adds or redefines the desired behavior. - } - \seetitle[http://www.daa.com.au/\~james/pygtk/]{PyGTK}{ - is a set of bindings for the \ulink{GTK}{http://www.gtk.org/} widget set. - It provides an object oriented interface that is slightly higher - level than the C one. It automatically does all the type casting and - reference counting that you would have to do normally with the C - API. There are also \ulink{bindings}{http://www.daa.com.au/\~james/gnome/} - to \ulink{GNOME}{http://www.gnome.org}, and a - \ulink{tutorial} - {http://laguna.fmedic.unam.mx/\~daniel/pygtutorial/pygtutorial/index.html} - is available. - } - \end{seealso} ! % XXX Reference URLs that compare the different UI packages --- 1391,1396 ---- %end{latexonly} ! \input{libturtle} *************** *** 1673,1674 **** --- 1620,1708 ---- \code{sys.argv}. \end{enumerate} + + + \section{Other Graphical User Interface Packages + \label{other-gui-packages}} + + + There are an number of extension widget sets to \refmodule{Tkinter}. + + \begin{seealso} + \seetitle[http://pmw.sourceforge.net/]{Python megawidgets}{is a + toolkit for building high-level compound widgets in Python using the + \refmodule{Tkinter} module. It consists of a set of base classes and + a library of flexible and extensible megawidgets built on this + foundation. These megawidgets include notebooks, comboboxes, selection + widgets, paned widgets, scrolled widgets, dialog windows, etc. Also, + with the Pmw.Blt interface to BLT, the busy, graph, stripchart, tabset + and vector commands are be available. + + The initial ideas for Pmw were taken from the Tk \code{itcl} + extensions \code{[incr Tk]} by Michael McLennan and \code{[incr + Widgets]} by Mark Ulferts. Several of the megawidgets are direct + translations from the itcl to Python. It offers most of the range of + widgets that \code{[incr Widgets]} does, and is almost as complete as + Tix, lacking however Tix's fast \class{HList} widget for drawing trees. + } + \seetitle[http://tkinter.effbot.org]{Tkinter3000}{ + is a Widget Construction Kit that allows you to write new Tkinter + widgets in Python using Mixins. It is built on top of Tkinter, + and does not offer the extended range of widgets that \refmodule{Tix} does, + but does allow a form of building mega-widgets. The project is + still in the early stages. + } + \end{seealso} + + + \refmodule{Tkinter} is not the only GUI for Python, but is however the + most commonly used one. + + \begin{seealso} + \seetitle[http://www.wxwindows.org]{wxWindows}{ + is a GUI toolkit that combines the most attractive attributes of Qt, + Tk, Motif, and GTK+ in one powerful and efficient package. It is + implemented in \Cpp. wxWindows supports two flavors of Unix + implementation: GTK+ and Motif, and under Windows, it has a standard + Microsoft Foundation Classes (MFC) appearance, because it uses Win32 + widgets. There is a Python class wrapper, independent of Tkinter. + + wxWindows is much richer in widgets than \refmodule{Tkinter}, with its + help system, sophisticated HTML and image viewers, and other + specialized widgets, extensive documentation, and printing capabilities. + } + \seetitle[http://www.thekompany.com]{PyKDE}{ + PyKDE is a SIP wrapped interface to the Qt toolkit. + The Qt \Cpp{} toolkit lies at the heart of the KDE desktop, and the + Qt toolkit allows very tight integration with KDE, and also Windows + portability. SIP is a tool for generating bindings for \Cpp{} libraries + as Python classes, and is specifically designed for Python. + } + \seetitle[http://fxpy.sourceforge.net/]{FXPy}{ + is a Python extension module which provides an interface to the + \citetitle[http://www.cfdrc.com/FOX/fox.html]{FOX} GUI. + FOX is a \Cpp{} based Toolkit for developing Graphical User Interfaces + easily and effectively. It offers a wide, and growing, collection of + Controls, and provides state of the art facilities such as drag and + drop, selection, as well as OpenGL widgets for 3D graphical + manipulation. FOX also implements icons, images, and user-convenience + features such as status line help, and tooltips. + + Even though FOX offers a large collection of controls already, FOX + leverages \Cpp{} to allow programmers to easily build additional Controls + and GUI elements, simply by taking existing controls, and creating a + derived class which simply adds or redefines the desired behavior. + } + \seetitle[http://www.daa.com.au/\~james/pygtk/]{PyGTK}{ + is a set of bindings for the \ulink{GTK}{http://www.gtk.org/} widget set. + It provides an object oriented interface that is slightly higher + level than the C one. It automatically does all the type casting and + reference counting that you would have to do normally with the C + API. There are also \ulink{bindings}{http://www.daa.com.au/\~james/gnome/} + to \ulink{GNOME}{http://www.gnome.org}, and a + \ulink{tutorial} + {http://laguna.fmedic.unam.mx/\~daniel/pygtutorial/pygtutorial/index.html} + is available. + } + \end{seealso} + + % XXX Reference URLs that compare the different UI packages From fdrake@users.sourceforge.net Fri Nov 16 02:52:59 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 15 Nov 2001 18:52:59 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib urlparse.py,1.30,1.31 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv17345/Lib Modified Files: urlparse.py Log Message: Fix parsing of parameters from a URL; urlparse() did not check that it only split parameters from the last path segment. Introduces two new functions, urlsplit() and urlunsplit(), that do the simpler job of splitting the URL without monkeying around with the parameters field, since that was not being handled properly. This closes bug #478038. Index: urlparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urlparse.py,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** urlparse.py 2001/08/13 14:38:50 1.30 --- urlparse.py 2001/11/16 02:52:57 1.31 *************** *** 44,48 **** ! def urlparse(url, scheme = '', allow_fragments = 1): """Parse a URL into 6 components: :///;?# --- 44,48 ---- ! def urlparse(url, scheme='', allow_fragments=1): """Parse a URL into 6 components: :///;?# *************** *** 50,53 **** --- 50,76 ---- Note that we don't break the components up in smaller bits (e.g. netloc is a single string) and we don't expand % escapes.""" + tuple = urlsplit(url, scheme, allow_fragments) + scheme, netloc, url, query, fragment = tuple + if scheme in uses_params and ';' in url: + url, params = _splitparams(url) + else: + params = '' + return scheme, netloc, url, params, query, fragment + + def _splitparams(url): + if '/' in url: + i = url.find(';', url.rfind('/')) + if i < 0: + return url, '' + else: + i = url.find(';') + return url[:i], url[i+1:] + + def urlsplit(url, scheme='', allow_fragments=1): + """Parse a URL into 5 components: + :///?# + Return a 5-tuple: (scheme, netloc, path, query, fragment). + Note that we don't break the components up in smaller bits + (e.g. netloc is a single string) and we don't expand % escapes.""" key = url, scheme, allow_fragments cached = _parse_cache.get(key, None) *************** *** 56,60 **** if len(_parse_cache) >= MAX_CACHE_SIZE: # avoid runaway growth clear_cache() ! netloc = params = query = fragment = '' i = url.find(':') if i > 0: --- 79,83 ---- if len(_parse_cache) >= MAX_CACHE_SIZE: # avoid runaway growth clear_cache() ! netloc = query = fragment = '' i = url.find(':') if i > 0: *************** *** 68,85 **** netloc = url[2:i] url = url[i:] ! if allow_fragments: ! i = url.rfind('#') ! if i >= 0: ! fragment = url[i+1:] ! url = url[:i] ! i = url.find('?') ! if i >= 0: ! query = url[i+1:] ! url = url[:i] ! i = url.find(';') ! if i >= 0: ! params = url[i+1:] ! url = url[:i] ! tuple = scheme, netloc, url, params, query, fragment _parse_cache[key] = tuple return tuple --- 91,99 ---- netloc = url[2:i] url = url[i:] ! if allow_fragments and '#' in url: ! url, fragment = url.split('#', 1) ! if '?' in url: ! url, query = url.split('?', 1) ! tuple = scheme, netloc, url, query, fragment _parse_cache[key] = tuple return tuple *************** *** 95,111 **** i = len(url) netloc, url = url[2:i], url[i:] ! if allow_fragments and scheme in uses_fragment: ! i = url.rfind('#') ! if i >= 0: ! url, fragment = url[:i], url[i+1:] ! if scheme in uses_query: ! i = url.find('?') ! if i >= 0: ! url, query = url[:i], url[i+1:] ! if scheme in uses_params: ! i = url.find(';') ! if i >= 0: ! url, params = url[:i], url[i+1:] ! tuple = scheme, netloc, url, params, query, fragment _parse_cache[key] = tuple return tuple --- 109,117 ---- i = len(url) netloc, url = url[2:i], url[i:] ! if allow_fragments and scheme in uses_fragment and '#' in url: ! url, fragment = url.split('#', 1) ! if scheme in uses_query and '?' in url: ! url, query = url.split('?', 1) ! tuple = scheme, netloc, url, query, fragment _parse_cache[key] = tuple return tuple *************** *** 116,119 **** --- 122,130 ---- originally had redundant delimiters, e.g. a ? with an empty query (the draft states that these are equivalent).""" + if params: + url = "%s;%s" % (url, params) + return urlunsplit((scheme, netloc, url, query, fragment)) + + def urlunsplit((scheme, netloc, url, query, fragment)): if netloc or (scheme in uses_netloc and url[:2] == '//'): if url and url[:1] != '/': url = '/' + url *************** *** 121,126 **** if scheme: url = scheme + ':' + url - if params: - url = url + ';' + params if query: url = url + '?' + query --- 132,135 ---- *************** *** 188,194 **** empty string. """ ! s, n, p, a, q, frag = urlparse(url) ! defrag = urlunparse((s, n, p, a, q, '')) ! return defrag, frag --- 197,206 ---- empty string. """ ! if '#' in url: ! s, n, p, a, q, frag = urlparse(url) ! defrag = urlunparse((s, n, p, a, q, '')) ! return defrag, frag ! else: ! return url, '' From fdrake@users.sourceforge.net Fri Nov 16 03:18:56 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 15 Nov 2001 19:18:56 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib urlparse.py,1.30,1.30.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv22118/Lib Modified Files: Tag: r22b2-branch urlparse.py Log Message: Fix parsing of parameters from a URL; urlparse() did not check that it only split parameters from the last path segment. Introduces two new functions, urlsplit() and urlunsplit(), that do the simpler job of splitting the URL without monkeying around with the parameters field, since that was not being handled properly. This closes bug #478038. Index: urlparse.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/urlparse.py,v retrieving revision 1.30 retrieving revision 1.30.10.1 diff -C2 -d -r1.30 -r1.30.10.1 *** urlparse.py 2001/08/13 14:38:50 1.30 --- urlparse.py 2001/11/16 03:18:54 1.30.10.1 *************** *** 44,48 **** ! def urlparse(url, scheme = '', allow_fragments = 1): """Parse a URL into 6 components: :///;?# --- 44,48 ---- ! def urlparse(url, scheme='', allow_fragments=1): """Parse a URL into 6 components: :///;?# *************** *** 50,53 **** --- 50,76 ---- Note that we don't break the components up in smaller bits (e.g. netloc is a single string) and we don't expand % escapes.""" + tuple = urlsplit(url, scheme, allow_fragments) + scheme, netloc, url, query, fragment = tuple + if scheme in uses_params and ';' in url: + url, params = _splitparams(url) + else: + params = '' + return scheme, netloc, url, params, query, fragment + + def _splitparams(url): + if '/' in url: + i = url.find(';', url.rfind('/')) + if i < 0: + return url, '' + else: + i = url.find(';') + return url[:i], url[i+1:] + + def urlsplit(url, scheme='', allow_fragments=1): + """Parse a URL into 5 components: + :///?# + Return a 5-tuple: (scheme, netloc, path, query, fragment). + Note that we don't break the components up in smaller bits + (e.g. netloc is a single string) and we don't expand % escapes.""" key = url, scheme, allow_fragments cached = _parse_cache.get(key, None) *************** *** 56,60 **** if len(_parse_cache) >= MAX_CACHE_SIZE: # avoid runaway growth clear_cache() ! netloc = params = query = fragment = '' i = url.find(':') if i > 0: --- 79,83 ---- if len(_parse_cache) >= MAX_CACHE_SIZE: # avoid runaway growth clear_cache() ! netloc = query = fragment = '' i = url.find(':') if i > 0: *************** *** 68,85 **** netloc = url[2:i] url = url[i:] ! if allow_fragments: ! i = url.rfind('#') ! if i >= 0: ! fragment = url[i+1:] ! url = url[:i] ! i = url.find('?') ! if i >= 0: ! query = url[i+1:] ! url = url[:i] ! i = url.find(';') ! if i >= 0: ! params = url[i+1:] ! url = url[:i] ! tuple = scheme, netloc, url, params, query, fragment _parse_cache[key] = tuple return tuple --- 91,99 ---- netloc = url[2:i] url = url[i:] ! if allow_fragments and '#' in url: ! url, fragment = url.split('#', 1) ! if '?' in url: ! url, query = url.split('?', 1) ! tuple = scheme, netloc, url, query, fragment _parse_cache[key] = tuple return tuple *************** *** 95,111 **** i = len(url) netloc, url = url[2:i], url[i:] ! if allow_fragments and scheme in uses_fragment: ! i = url.rfind('#') ! if i >= 0: ! url, fragment = url[:i], url[i+1:] ! if scheme in uses_query: ! i = url.find('?') ! if i >= 0: ! url, query = url[:i], url[i+1:] ! if scheme in uses_params: ! i = url.find(';') ! if i >= 0: ! url, params = url[:i], url[i+1:] ! tuple = scheme, netloc, url, params, query, fragment _parse_cache[key] = tuple return tuple --- 109,117 ---- i = len(url) netloc, url = url[2:i], url[i:] ! if allow_fragments and scheme in uses_fragment and '#' in url: ! url, fragment = url.split('#', 1) ! if scheme in uses_query and '?' in url: ! url, query = url.split('?', 1) ! tuple = scheme, netloc, url, query, fragment _parse_cache[key] = tuple return tuple *************** *** 116,119 **** --- 122,130 ---- originally had redundant delimiters, e.g. a ? with an empty query (the draft states that these are equivalent).""" + if params: + url = "%s;%s" % (url, params) + return urlunsplit((scheme, netloc, url, query, fragment)) + + def urlunsplit((scheme, netloc, url, query, fragment)): if netloc or (scheme in uses_netloc and url[:2] == '//'): if url and url[:1] != '/': url = '/' + url *************** *** 121,126 **** if scheme: url = scheme + ':' + url - if params: - url = url + ';' + params if query: url = url + '?' + query --- 132,135 ---- *************** *** 188,194 **** empty string. """ ! s, n, p, a, q, frag = urlparse(url) ! defrag = urlunparse((s, n, p, a, q, '')) ! return defrag, frag --- 197,206 ---- empty string. """ ! if '#' in url: ! s, n, p, a, q, frag = urlparse(url) ! defrag = urlunparse((s, n, p, a, q, '')) ! return defrag, frag ! else: ! return url, '' From fdrake@users.sourceforge.net Fri Nov 16 03:19:24 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 15 Nov 2001 19:19:24 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib tkinter.tex,1.1,1.1.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv22182/Doc/lib Modified Files: Tag: r22b2-branch tkinter.tex Log Message: Switched a couple of sections around. Cleaned up some markup nits. Add a few more of the Tk-related modules to the list of modules. Index: tkinter.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/tkinter.tex,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** tkinter.tex 2001/11/15 17:22:04 1.1 --- tkinter.tex 2001/11/16 03:19:22 1.1.2.1 *************** *** 31,39 **** ! \section{Tkinter \label{tkinter}} ! \index{Tkinter} ! \sectionauthor{Fredrik Lundh}{fredrik@effbot.org} ! ! \index{Tkinter} \declaremodule{standard}{Tkinter} --- 31,36 ---- ! \section{\module{Tkinter} --- ! Python interface to Tcl/Tk} \declaremodule{standard}{Tkinter} *************** *** 110,113 **** --- 107,127 ---- % FIXME + \item[\module{tkColorChooser}] + Dialog to let the user choose a color. + + \item[\module{tkCommonDialog}] + + \item[\module{tkFileDialog}] + Common dialogs to allow the user to specify a file to open or save. + + \item[\module{tkFont}] + Utilities to help work with fonts. + + \item[\module{tkMessageBox}] + Access to standard Tk dialog boxes. + + \item[\module{tkSimpleDialog}] + Basic dialogs and convenience functions. + \item[\module{Tkdnd}] Drag-and-drop support for \refmodule{Tkinter}. *************** *** 121,125 **** \subsection{Tkinter Life Preserver} ! \index{Tkinter} This section is not designed to be an exhaustive tutorial on either --- 135,140 ---- \subsection{Tkinter Life Preserver} ! \sectionauthor{Matt Conway}{} ! % Converted to LaTeX by Mike Clarkson. This section is not designed to be an exhaustive tutorial on either *************** *** 281,285 **** are instantiated. \item The Widget class is not meant to be instantiated, it ! is meant only for subclassing to make ``real'' widgets. (in C++, this is called an `abstract class') \end{itemize} --- 296,300 ---- are instantiated. \item The Widget class is not meant to be instantiated, it ! is meant only for subclassing to make ``real'' widgets. (in \Cpp, this is called an `abstract class') \end{itemize} *************** *** 338,342 **** new \var{widget command} is the programmer's handle for getting the new widget to perform some \var{action}. In C, you'd express this as ! someAction(fred, someOptions), in C++, you would express this as fred.someAction(someOptions), and in Tk, you say: --- 353,357 ---- new \var{widget command} is the programmer's handle for getting the new widget to perform some \var{action}. In C, you'd express this as ! someAction(fred, someOptions), in \Cpp, you would express this as fred.someAction(someOptions), and in Tk, you say: *************** *** 888,895 **** \end{description} - - \section{Tix \label{tix-widgets}} ! \index{Tix} \declaremodule{standard}{Tix} --- 903,909 ---- \end{description} ! \section{\module{Tix} --- ! Extension widgets for Tk} \declaremodule{standard}{Tix} *************** *** 897,900 **** --- 911,916 ---- \sectionauthor{Mike Clarkson}{mikeclarkson@users.sourceforge.net} + \index{Tix} + The \module{Tix} (Tk Interface Extension) module provides an additional rich set of widgets. Although the standard Tk library has *************** *** 987,1039 **** \subsubsection{Basic Widgets} - \index{Balloon widget} \begin{classdesc}{Balloon}{} A \ulink{Balloon} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixBalloon.htm} that pops ! up over a widget to provide help. When the user moves the cursor ! inside a widget to which a Balloon widget has been bound, a small ! pop-up window with a descriptive message will be shown on the screen. \end{classdesc} ! % Python Demo of: \ulink{ Balloon}{http://tix.sourceforge.net/dist/current/demos/samples/Balloon.tcl} - \index{ButtonBox widget} \begin{classdesc}{ButtonBox}{} The \ulink{ButtonBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixButtonBox.htm} widget ! creates a box of buttons, such as is commonly used for \code{Ok Cancel}. \end{classdesc} ! % Python Demo of: \ulink{ ButtonBox}{http://tix.sourceforge.net/dist/current/demos/samples/BtnBox.tcl} - \index{ComboBox widget} \begin{classdesc}{ComboBox}{} The \ulink{ComboBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixComboBox.htm} widget is ! similar to the combo box control in MS Windows. The user can select a ! choice by either typing in the entry subwdget or selecting from the ! listbox subwidget. \end{classdesc} ! % Python Demo of: \ulink{ ComboBox}{http://tix.sourceforge.net/dist/current/demos/samples/ComboBox.tcl} - \index{Control widget} \begin{classdesc}{Control}{} The \ulink{Control} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixControl.htm} widget is ! also known as the \class{SpinBox} widget. The user can adjust the value ! by pressing the two arrow buttons or by entering the value directly ! into the entry. The new value will be checked against the user-defined ! upper and lower limits. \end{classdesc} ! % Python Demo of: \ulink{ Control}{http://tix.sourceforge.net/dist/current/demos/samples/Control.tcl} - \index{LabelEntry widget} \begin{classdesc}{LabelEntry}{} The \ulink{LabelEntry} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixLabelEntry.htm} widget ! packages an entry widget and a label into one mega widget. It can be ! used be used to simplify the creation of ``entry-form'' type of interface. \end{classdesc} --- 1003,1057 ---- \subsubsection{Basic Widgets} \begin{classdesc}{Balloon}{} A \ulink{Balloon} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixBalloon.htm} ! that pops up over a widget to provide help. When the user moves the ! cursor inside a widget to which a Balloon widget has been bound, a ! small pop-up window with a descriptive message will be shown on the ! screen. \end{classdesc} ! % Python Demo of: ! % \ulink{Balloon}{http://tix.sourceforge.net/dist/current/demos/samples/Balloon.tcl} \begin{classdesc}{ButtonBox}{} The \ulink{ButtonBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixButtonBox.htm} ! widget creates a box of buttons, such as is commonly used for \code{Ok ! Cancel}. \end{classdesc} ! % Python Demo of: ! % \ulink{ButtonBox}{http://tix.sourceforge.net/dist/current/demos/samples/BtnBox.tcl} \begin{classdesc}{ComboBox}{} The \ulink{ComboBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixComboBox.htm} ! widget is similar to the combo box control in MS Windows. The user can ! select a choice by either typing in the entry subwdget or selecting ! from the listbox subwidget. \end{classdesc} ! % Python Demo of: ! % \ulink{ComboBox}{http://tix.sourceforge.net/dist/current/demos/samples/ComboBox.tcl} \begin{classdesc}{Control}{} The \ulink{Control} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixControl.htm} ! widget is also known as the \class{SpinBox} widget. The user can ! adjust the value by pressing the two arrow buttons or by entering the ! value directly into the entry. The new value will be checked against ! the user-defined upper and lower limits. \end{classdesc} ! % Python Demo of: ! % \ulink{Control}{http://tix.sourceforge.net/dist/current/demos/samples/Control.tcl} \begin{classdesc}{LabelEntry}{} The \ulink{LabelEntry} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixLabelEntry.htm} ! widget packages an entry widget and a label into one mega widget. It ! can be used be used to simplify the creation of ``entry-form'' type of ! interface. \end{classdesc} *************** *** 1041,1050 **** % \ulink{LabelEntry}{http://tix.sourceforge.net/dist/current/demos/samples/LabEntry.tcl} - \index{LabelFrame widget} \begin{classdesc}{LabelFrame}{} The \ulink{LabelFrame} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixLabelFrame.htm} widget ! packages a frame widget and a label into one mega widget. To create ! widgets inside a LabelFrame widget, one creates the new widgets relative to the \member{frame} subwidget and manage them inside the \member{frame} subwidget. --- 1059,1067 ---- % \ulink{LabelEntry}{http://tix.sourceforge.net/dist/current/demos/samples/LabEntry.tcl} \begin{classdesc}{LabelFrame}{} The \ulink{LabelFrame} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixLabelFrame.htm} ! widget packages a frame widget and a label into one mega widget. To ! create widgets inside a LabelFrame widget, one creates the new widgets relative to the \member{frame} subwidget and manage them inside the \member{frame} subwidget. *************** *** 1054,1063 **** % \ulink{LabelFrame}{http://tix.sourceforge.net/dist/current/demos/samples/LabFrame.tcl} - \index{Meter widget} \begin{classdesc}{Meter}{} The \ulink{Meter} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixMeter.htm} widget can ! be used to show the progress of a background job which may take a long ! time to execute. \end{classdesc} --- 1071,1079 ---- % \ulink{LabelFrame}{http://tix.sourceforge.net/dist/current/demos/samples/LabFrame.tcl} \begin{classdesc}{Meter}{} The \ulink{Meter} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixMeter.htm} ! widget can be used to show the progress of a background job which may ! take a long time to execute. \end{classdesc} *************** *** 1065,1111 **** % \ulink{Meter}{http://tix.sourceforge.net/dist/current/demos/samples/Meter.tcl} - \index{OptionMenu widget} \begin{classdesc}{OptionMenu}{} The \ulink{OptionMenu} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixOptionMenu.htm} creates a ! menu button of options. \end{classdesc} ! % Python Demo of: \ulink{ OptionMenu}{http://tix.sourceforge.net/dist/current/demos/samples/OptMenu.tcl} - \index{PopupMenu widget} \begin{classdesc}{PopupMenu}{} The \ulink{PopupMenu} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixPopupMenu.htm} widget can ! be used as a replacement of the \code{tk_popup} command. The advantage ! of the \refmodule{Tix} PopupMenu widget is it requires less application ! code to manipulate. \end{classdesc} ! % Python Demo of: \ulink{ PopupMenu}{http://tix.sourceforge.net/dist/current/demos/samples/PopMenu.tcl} - \index{Select widget} \begin{classdesc}{Select}{} The \ulink{Select} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixSelect.htm} widget is a ! container of button subwidgets. It can be used to provide radio-box or ! check-box style of selection options for the user. \end{classdesc} ! % Python Demo of: \ulink{ Select}{http://tix.sourceforge.net/dist/current/demos/samples/Select.tcl} - \index{StdButtonBox widget} \begin{classdesc}{StdButtonBox}{} The \ulink{StdButtonBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixStdButtonBox.htm} widget is a ! group of Standard buttons for Motif-like dialog boxes. \end{classdesc} ! % Python Demo of: \ulink{ StdButtonBox}{http://tix.sourceforge.net/dist/current/demos/samples/StdBBox.tcl} \subsubsection{File Selectors} - \index{DirList widget} \begin{classdesc}{DirList}{} The \ulink{DirList} --- 1081,1126 ---- % \ulink{Meter}{http://tix.sourceforge.net/dist/current/demos/samples/Meter.tcl} \begin{classdesc}{OptionMenu}{} The \ulink{OptionMenu} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixOptionMenu.htm} ! creates a menu button of options. \end{classdesc} ! % Python Demo of: ! % \ulink{OptionMenu}{http://tix.sourceforge.net/dist/current/demos/samples/OptMenu.tcl} \begin{classdesc}{PopupMenu}{} The \ulink{PopupMenu} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixPopupMenu.htm} ! widget can be used as a replacement of the \code{tk_popup} ! command. The advantage of the \refmodule{Tix} \class{PopupMenu} widget ! is it requires less application code to manipulate. \end{classdesc} ! % Python Demo of: ! % \ulink{PopupMenu}{http://tix.sourceforge.net/dist/current/demos/samples/PopMenu.tcl} \begin{classdesc}{Select}{} The \ulink{Select} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixSelect.htm} ! widget is a container of button subwidgets. It can be used to provide ! radio-box or check-box style of selection options for the user. \end{classdesc} ! % Python Demo of: ! % \ulink{Select}{http://tix.sourceforge.net/dist/current/demos/samples/Select.tcl} \begin{classdesc}{StdButtonBox}{} The \ulink{StdButtonBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixStdButtonBox.htm} ! widget is a group of standard buttons for Motif-like dialog boxes. \end{classdesc} ! % Python Demo of: ! % \ulink{StdButtonBox}{http://tix.sourceforge.net/dist/current/demos/samples/StdBBox.tcl} \subsubsection{File Selectors} \begin{classdesc}{DirList}{} The \ulink{DirList} *************** *** 1116,1144 **** \end{classdesc} ! % Python Demo of: \ulink{ DirList}{http://tix.sourceforge.net/dist/current/demos/samples/DirList.tcl} - \index{DirTree widget} \begin{classdesc}{DirTree}{} The \ulink{DirTree} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixDirTree.htm} widget ! displays a tree view of a directory, its previous directories and its ! sub-directories. The user can choose one of the directories displayed ! in the list or change to another directory. \end{classdesc} ! % Python Demo of: \ulink{ DirTree}{http://tix.sourceforge.net/dist/current/demos/samples/DirTree.tcl} - \index{DirSelectDialog widget} \begin{classdesc}{DirSelectDialog}{} The \ulink{DirSelectDialog} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixDirSelectDialog.htm} widget ! presents the directories in the file system in a dialog window. The ! user can use this dialog window to navigate through the file system to ! select the desired directory. \end{classdesc} ! % Python Demo of: \ulink{ DirSelectDialog}{http://tix.sourceforge.net/dist/current/demos/samples/DirDlg.tcl} - \index{DirSelectBox widget} \begin{classdesc}{DirSelectBox}{} The \class{DirSelectBox} is similar --- 1131,1159 ---- \end{classdesc} ! % Python Demo of: ! % \ulink{DirList}{http://tix.sourceforge.net/dist/current/demos/samples/DirList.tcl} \begin{classdesc}{DirTree}{} The \ulink{DirTree} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixDirTree.htm} ! widget displays a tree view of a directory, its previous directories ! and its sub-directories. The user can choose one of the directories ! displayed in the list or change to another directory. \end{classdesc} ! % Python Demo of: ! % \ulink{DirTree}{http://tix.sourceforge.net/dist/current/demos/samples/DirTree.tcl} \begin{classdesc}{DirSelectDialog}{} The \ulink{DirSelectDialog} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixDirSelectDialog.htm} ! widget presents the directories in the file system in a dialog ! window. The user can use this dialog window to navigate through the ! file system to select the desired directory. \end{classdesc} ! % Python Demo of: ! % \ulink{DirSelectDialog}{http://tix.sourceforge.net/dist/current/demos/samples/DirDlg.tcl} \begin{classdesc}{DirSelectBox}{} The \class{DirSelectBox} is similar *************** *** 1149,1297 **** \end{classdesc} - \index{ExFileSelectBox widget} \begin{classdesc}{ExFileSelectBox}{} The \ulink{ExFileSelectBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixExFileSelectBox.htm} widget is ! usually embedded in a tixExFileSelectDialog widget. It provides an ! convenient method for the user to select files. The style of the ! ExFileSelectBox widget is very similar to the standard file dialog in ! MS Windows 3.1. \end{classdesc} ! % Python Demo of: \ulink{ ExFileSelectDialog}{http://tix.sourceforge.net/dist/current/demos/samples/EFileDlg.tcl} - \index{FileSelectBox widget} \begin{classdesc}{FileSelectBox}{} The \ulink{FileSelectBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixFileSelectBox.htm} is similar ! to the standard Motif(TM) file-selection box. It is generally used for ! the user to choose a file. FileSelectBox stores the files mostly ! recently selected into a ComboBox widget so that they can be quickly ! selected again. \end{classdesc} ! % Python Demo of: \ulink{ FileSelectDialog}{http://tix.sourceforge.net/dist/current/demos/samples/FileDlg.tcl} - \index{FileEntry widget} \begin{classdesc}{FileEntry}{} The \ulink{FileEntry} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixFileEntry.htm} widget can ! be used to input a filename. The user can type in the filename ! manually. Alternatively, the user can press the button widget that ! sits next to the entry, which will bring up a file selection dialog. \end{classdesc} ! % Python Demo of: \ulink{ FileEntry}{http://tix.sourceforge.net/dist/current/demos/samples/FileEnt.tcl} \subsubsection{Hierachical ListBox} - \index{HList widget} \begin{classdesc}{HList}{} The \ulink{HList} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixHList.htm} widget can be ! used to display any data that have a hierarchical structure, for ! example, file system directory trees. The list entries are indented ! and connected by branch lines according to their places in the hierachy. \end{classdesc} ! % Python Demo of: \ulink{ HList}{http://tix.sourceforge.net/dist/current/demos/samples/HList1.tcl} - \index{CheckList widget} \begin{classdesc}{CheckList}{} The \ulink{CheckList} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixCheckList.htm} widget ! displays a list of items to be selected by the user. CheckList acts ! similarly to the Tk checkbutton or radiobutton widgets, except it is ! capable of handling many more items than checkbuttons or radiobuttons. \end{classdesc} - - % Python Demo of: \ulink{ CheckList}{http://tix.sourceforge.net/dist/current/demos/samples/ChkList.tcl} - % Python Demo of: \ulink{ScrolledHList (1)}{http://tix.sourceforge.net/dist/current/demos/samples/SHList.tcl} - % Python Demo of: \ulink{ScrolledHList (2)}{http://tix.sourceforge.net/dist/current/demos/samples/SHList2.tcl} - \index{Tree widget} \begin{classdesc}{Tree}{} The \ulink{Tree} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixTree.htm} widget can be ! used to display hierachical data in a tree form. The user can adjust ! the view of the tree by opening or closing parts of the tree. \end{classdesc} ! % Python Demo of: \ulink{ Tree}{http://tix.sourceforge.net/dist/current/demos/samples/Tree.tcl} ! % Python Demo of: \ulink{Tree (Dynamic)}{http://tix.sourceforge.net/dist/current/demos/samples/DynTree.tcl} \subsubsection{Tabular ListBox} - \index{TList widget} \begin{classdesc}{TList}{} The \ulink{TList} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixTList.htm} widget can be ! used to display data in a tabular format. The list entries of a TList ! widget are similar to the entries in the Tk listbox widget. The main ! differences are (1) the TList widget can display the list entries in a ! two dimensional format and (2) you can use graphical images as well as ! multiple colors and fonts for the list entries. \end{classdesc} ! % Python Demo of: \ulink{ScrolledTList (1)}{http://tix.sourceforge.net/dist/current/demos/samples/STList1.tcl} ! % Python Demo of: \ulink{ScrolledTList (2)}{http://tix.sourceforge.net/dist/current/demos/samples/STList2.tcl} % Grid has yet to be added to Python % \subsubsection{Grid Widget} ! % % Python Demo of: \ulink{Simple Grid}{http://tix.sourceforge.net/dist/current/demos/samples/SGrid0.tcl} ! % % Python Demo of: \ulink{ScrolledGrid}{http://tix.sourceforge.net/dist/current/demos/samples/SGrid1.tcl} ! % % Python Demo of: \ulink{Editable Grid}{http://tix.sourceforge.net/dist/current/demos/samples/EditGrid.tcl} \subsubsection{Manager Widgets} - \index{PanedWindow widget} \begin{classdesc}{PanedWindow}{} The \ulink{PanedWindow} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixPanedWindow.htm} widget ! allows the user to interactively manipulate the sizes of several ! panes. The panes can be arranged either vertically or horizontally.The ! user changes the sizes of the panes by dragging the resize handle ! between two panes. \end{classdesc} ! % Python Demo of: \ulink{ PanedWindow}{http://tix.sourceforge.net/dist/current/demos/samples/PanedWin.tcl} - \index{ListNoteBook widget} \begin{classdesc}{ListNoteBook}{} The \ulink{ListNoteBook} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixListNoteBook.htm} widget is ! very similar to the TixNoteBook widget: it can be used to display many ! windows in a limited space using a notebook metaphor. The notebook is ! divided into a stack of pages (windows). At one time only one of these ! pages can be shown. The user can navigate through these pages by ! choosing the name of the desired page in the \member{hlist} subwidget. \end{classdesc} ! % Python Demo of: \ulink{ ListNoteBook}{http://tix.sourceforge.net/dist/current/demos/samples/ListNBK.tcl} ! - \index{NoteBook widget} \begin{classdesc}{NoteBook}{} The \ulink{NoteBook} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixNoteBook.htm} widget can ! be used to display many windows in a limited space using a notebook ! metaphor. The notebook is divided into a stack of pages. At one time ! only one of these pages can be shown. The user can navigate through ! these pages by choosing the visual ``tabs'' at the top of the NoteBook widget. \end{classdesc} ! % Python Demo of: \ulink{ NoteBook}{http://tix.sourceforge.net/dist/current/demos/samples/NoteBook.tcl} % \subsubsection{Scrolled Widgets} ! % Python Demo of: \ulink{ ScrolledListBox}{http://tix.sourceforge.net/dist/current/demos/samples/SListBox.tcl} ! % Python Demo of: \ulink{ ScrolledText}{http://tix.sourceforge.net/dist/current/demos/samples/SText.tcl} ! % Python Demo of: \ulink{ ScrolledWindow}{http://tix.sourceforge.net/dist/current/demos/samples/SWindow.tcl} ! % Python Demo of: \ulink{Canvas Object View}{http://tix.sourceforge.net/dist/current/demos/samples/CObjView.tcl} --- 1164,1328 ---- \end{classdesc} \begin{classdesc}{ExFileSelectBox}{} The \ulink{ExFileSelectBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixExFileSelectBox.htm} ! widget is usually embedded in a tixExFileSelectDialog widget. It ! provides an convenient method for the user to select files. The style ! of the \class{ExFileSelectBox} widget is very similar to the standard ! file dialog on MS Windows 3.1. \end{classdesc} ! % Python Demo of: ! %\ulink{ExFileSelectDialog}{http://tix.sourceforge.net/dist/current/demos/samples/EFileDlg.tcl} \begin{classdesc}{FileSelectBox}{} The \ulink{FileSelectBox} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixFileSelectBox.htm} ! is similar to the standard Motif(TM) file-selection box. It is ! generally used for the user to choose a file. FileSelectBox stores the ! files mostly recently selected into a \class{ComboBox} widget so that ! they can be quickly selected again. \end{classdesc} ! % Python Demo of: ! % \ulink{FileSelectDialog}{http://tix.sourceforge.net/dist/current/demos/samples/FileDlg.tcl} \begin{classdesc}{FileEntry}{} The \ulink{FileEntry} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixFileEntry.htm} ! widget can be used to input a filename. The user can type in the ! filename manually. Alternatively, the user can press the button widget ! that sits next to the entry, which will bring up a file selection ! dialog. \end{classdesc} ! % Python Demo of: ! % \ulink{FileEntry}{http://tix.sourceforge.net/dist/current/demos/samples/FileEnt.tcl} \subsubsection{Hierachical ListBox} \begin{classdesc}{HList}{} The \ulink{HList} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixHList.htm} ! widget can be used to display any data that have a hierarchical ! structure, for example, file system directory trees. The list entries ! are indented and connected by branch lines according to their places ! in the hierachy. \end{classdesc} ! % Python Demo of: ! % \ulink{HList}{http://tix.sourceforge.net/dist/current/demos/samples/HList1.tcl} \begin{classdesc}{CheckList}{} The \ulink{CheckList} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixCheckList.htm} ! widget displays a list of items to be selected by the user. CheckList ! acts similarly to the Tk checkbutton or radiobutton widgets, except it ! is capable of handling many more items than checkbuttons or ! radiobuttons. \end{classdesc} + % Python Demo of: + % \ulink{ CheckList}{http://tix.sourceforge.net/dist/current/demos/samples/ChkList.tcl} + % Python Demo of: + % \ulink{ScrolledHList (1)}{http://tix.sourceforge.net/dist/current/demos/samples/SHList.tcl} + % Python Demo of: + % \ulink{ScrolledHList (2)}{http://tix.sourceforge.net/dist/current/demos/samples/SHList2.tcl} \begin{classdesc}{Tree}{} The \ulink{Tree} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixTree.htm} ! widget can be used to display hierachical data in a tree form. The ! user can adjust the view of the tree by opening or closing parts of ! the tree. \end{classdesc} ! % Python Demo of: ! % \ulink{Tree}{http://tix.sourceforge.net/dist/current/demos/samples/Tree.tcl} ! % Python Demo of: ! % \ulink{Tree (Dynamic)}{http://tix.sourceforge.net/dist/current/demos/samples/DynTree.tcl} \subsubsection{Tabular ListBox} \begin{classdesc}{TList}{} The \ulink{TList} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixTList.htm} ! widget can be used to display data in a tabular format. The list ! entries of a \class{TList} widget are similar to the entries in the Tk ! listbox widget. The main differences are (1) the \class{TList} widget ! can display the list entries in a two dimensional format and (2) you ! can use graphical images as well as multiple colors and fonts for the ! list entries. \end{classdesc} ! % Python Demo of: ! % \ulink{ScrolledTList (1)}{http://tix.sourceforge.net/dist/current/demos/samples/STList1.tcl} ! % Python Demo of: ! % \ulink{ScrolledTList (2)}{http://tix.sourceforge.net/dist/current/demos/samples/STList2.tcl} % Grid has yet to be added to Python % \subsubsection{Grid Widget} ! % Python Demo of: ! % \ulink{Simple Grid}{http://tix.sourceforge.net/dist/current/demos/samples/SGrid0.tcl} ! % Python Demo of: ! % \ulink{ScrolledGrid}{http://tix.sourceforge.net/dist/current/demos/samples/SGrid1.tcl} ! % Python Demo of: ! % \ulink{Editable Grid}{http://tix.sourceforge.net/dist/current/demos/samples/EditGrid.tcl} \subsubsection{Manager Widgets} \begin{classdesc}{PanedWindow}{} The \ulink{PanedWindow} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixPanedWindow.htm} ! widget allows the user to interactively manipulate the sizes of ! several panes. The panes can be arranged either vertically or ! horizontally. The user changes the sizes of the panes by dragging the ! resize handle between two panes. \end{classdesc} ! % Python Demo of: ! % \ulink{PanedWindow}{http://tix.sourceforge.net/dist/current/demos/samples/PanedWin.tcl} \begin{classdesc}{ListNoteBook}{} The \ulink{ListNoteBook} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixListNoteBook.htm} ! widget is very similar to the \class{TixNoteBook} widget: it can be ! used to display many windows in a limited space using a notebook ! metaphor. The notebook is divided into a stack of pages (windows). At ! one time only one of these pages can be shown. The user can navigate ! through these pages by choosing the name of the desired page in the ! \member{hlist} subwidget. \end{classdesc} ! % Python Demo of: ! % \ulink{ListNoteBook}{http://tix.sourceforge.net/dist/current/demos/samples/ListNBK.tcl} \begin{classdesc}{NoteBook}{} The \ulink{NoteBook} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixNoteBook.htm} ! widget can be used to display many windows in a limited space using a ! notebook metaphor. The notebook is divided into a stack of pages. At ! one time only one of these pages can be shown. The user can navigate ! through these pages by choosing the visual ``tabs'' at the top of the ! NoteBook widget. \end{classdesc} ! % Python Demo of: ! % \ulink{NoteBook}{http://tix.sourceforge.net/dist/current/demos/samples/NoteBook.tcl} % \subsubsection{Scrolled Widgets} ! % Python Demo of: ! % \ulink{ScrolledListBox}{http://tix.sourceforge.net/dist/current/demos/samples/SListBox.tcl} ! % Python Demo of: ! % \ulink{ScrolledText}{http://tix.sourceforge.net/dist/current/demos/samples/SText.tcl} ! % Python Demo of: ! % \ulink{ScrolledWindow}{http://tix.sourceforge.net/dist/current/demos/samples/SWindow.tcl} ! % Python Demo of: ! % \ulink{Canvas Object View}{http://tix.sourceforge.net/dist/current/demos/samples/CObjView.tcl} *************** *** 1360,1449 **** %end{latexonly} - - \section{Other User Interface Modules and Packages - \label{other-gui-modules}} - - - There are an number of extension widget sets to \refmodule{Tkinter}. - - \begin{seealso} - \seetitle[http://pmw.sourceforge.net/]{Python megawidgets}{is a - toolkit for building high-level compound widgets in Python using the - \refmodule{Tkinter} module. It consists of a set of base classes and - a library of flexible and extensible megawidgets built on this - foundation. These megawidgets include notebooks, comboboxes, selection - widgets, paned widgets, scrolled widgets, dialog windows, etc. Also, - with the Pmw.Blt interface to BLT, the busy, graph, stripchart, tabset - and vector commands are be available. - - The initial ideas for Pmw were taken from the Tk \code{itcl} - extensions \code{[incr Tk]} by Michael McLennan and \code{[incr - Widgets]} by Mark Ulferts. Several of the megawidgets are direct - translations from the itcl to Python. It offers most of the range of - widgets that \code{[incr Widgets]} does, and is almost as complete as - Tix, lacking however Tix's fast \class{HList} widget for drawing trees. - } - \seetitle[http://tkinter.effbot.org]{Tkinter3000}{ - is a Widget Construction Kit that allows you to write new Tkinter - widgets in Python using Mixins. It is built on top of Tkinter, - and does not offer the extended range of widgets that \refmodule{Tix} does, - but does allow a form of building mega-widgets. The project is - still in the early stages. - } - \end{seealso} - - - \refmodule{Tkinter} is not the only GUI for Python, but is however the - most commonly used one. - - \begin{seealso} - \seetitle[http://www.wxwindows.org]{wxWindows}{ - is a GUI toolkit that combines the most attractive attributes of Qt, - Tk, Motif, and GTK+ in one powerful and efficient package. It is - implemented in C++. wxWindows supports two flavors of Unix - implementation: GTK+ and Motif, and under Windows, it has a standard - Microsoft Foundation Classes (MFC) appearance, because it uses Win32 - widgets. There is a Python class wrapper, independent of Tkinter. - - wxWindows is much richer in widgets than \refmodule{Tkinter}, with its - help system, sophisticated HTML and image viewers, and other - specialized widgets, extensive documentation, and printing capabilities. - } - \seetitle[http://www.thekompany.com]{PyKDE}{ - PyKDE is a SIP wrapped interface to the Qt toolkit. - The Qt C++ toolkit lies at the heart of the KDE desktop, and the - Qt toolkit allows very tight integration with KDE, and also Windows - portability. SIP is a tool for generating bindings for \Cpp{} libraries - as Python classes, and is specifically designed for Python. - } - \seetitle[http://fxpy.sourceforge.net/]{FXPy}{ - is a Python extension module which provides an interface to the - \citetitle[http://www.cfdrc.com/FOX/fox.html]{FOX} GUI. - FOX is a C++ based Toolkit for developing Graphical User Interfaces - easily and effectively. It offers a wide, and growing, collection of - Controls, and provides state of the art facilities such as drag and - drop, selection, as well as OpenGL widgets for 3D graphical - manipulation. FOX also implements icons, images, and user-convenience - features such as status line help, and tooltips. - - Even though FOX offers a large collection of Controls already, FOX - leverages C++ to allow programmers to easily build additional Controls - and GUI elements, simply by taking existing controls, and creating a - derived class which simply adds or redefines the desired behavior. - } - \seetitle[http://www.daa.com.au/\~james/pygtk/]{PyGTK}{ - is a set of bindings for the \ulink{GTK}{http://www.gtk.org/} widget set. - It provides an object oriented interface that is slightly higher - level than the C one. It automatically does all the type casting and - reference counting that you would have to do normally with the C - API. There are also \ulink{bindings}{http://www.daa.com.au/\~james/gnome/} - to \ulink{GNOME}{http://www.gnome.org}, and a - \ulink{tutorial} - {http://laguna.fmedic.unam.mx/\~daniel/pygtutorial/pygtutorial/index.html} - is available. - } - \end{seealso} ! % XXX Reference URLs that compare the different UI packages --- 1391,1396 ---- %end{latexonly} ! \input{libturtle} *************** *** 1673,1674 **** --- 1620,1708 ---- \code{sys.argv}. \end{enumerate} + + + \section{Other Graphical User Interface Packages + \label{other-gui-packages}} + + + There are an number of extension widget sets to \refmodule{Tkinter}. + + \begin{seealso} + \seetitle[http://pmw.sourceforge.net/]{Python megawidgets}{is a + toolkit for building high-level compound widgets in Python using the + \refmodule{Tkinter} module. It consists of a set of base classes and + a library of flexible and extensible megawidgets built on this + foundation. These megawidgets include notebooks, comboboxes, selection + widgets, paned widgets, scrolled widgets, dialog windows, etc. Also, + with the Pmw.Blt interface to BLT, the busy, graph, stripchart, tabset + and vector commands are be available. + + The initial ideas for Pmw were taken from the Tk \code{itcl} + extensions \code{[incr Tk]} by Michael McLennan and \code{[incr + Widgets]} by Mark Ulferts. Several of the megawidgets are direct + translations from the itcl to Python. It offers most of the range of + widgets that \code{[incr Widgets]} does, and is almost as complete as + Tix, lacking however Tix's fast \class{HList} widget for drawing trees. + } + \seetitle[http://tkinter.effbot.org]{Tkinter3000}{ + is a Widget Construction Kit that allows you to write new Tkinter + widgets in Python using Mixins. It is built on top of Tkinter, + and does not offer the extended range of widgets that \refmodule{Tix} does, + but does allow a form of building mega-widgets. The project is + still in the early stages. + } + \end{seealso} + + + \refmodule{Tkinter} is not the only GUI for Python, but is however the + most commonly used one. + + \begin{seealso} + \seetitle[http://www.wxwindows.org]{wxWindows}{ + is a GUI toolkit that combines the most attractive attributes of Qt, + Tk, Motif, and GTK+ in one powerful and efficient package. It is + implemented in \Cpp. wxWindows supports two flavors of Unix + implementation: GTK+ and Motif, and under Windows, it has a standard + Microsoft Foundation Classes (MFC) appearance, because it uses Win32 + widgets. There is a Python class wrapper, independent of Tkinter. + + wxWindows is much richer in widgets than \refmodule{Tkinter}, with its + help system, sophisticated HTML and image viewers, and other + specialized widgets, extensive documentation, and printing capabilities. + } + \seetitle[http://www.thekompany.com]{PyKDE}{ + PyKDE is a SIP wrapped interface to the Qt toolkit. + The Qt \Cpp{} toolkit lies at the heart of the KDE desktop, and the + Qt toolkit allows very tight integration with KDE, and also Windows + portability. SIP is a tool for generating bindings for \Cpp{} libraries + as Python classes, and is specifically designed for Python. + } + \seetitle[http://fxpy.sourceforge.net/]{FXPy}{ + is a Python extension module which provides an interface to the + \citetitle[http://www.cfdrc.com/FOX/fox.html]{FOX} GUI. + FOX is a \Cpp{} based Toolkit for developing Graphical User Interfaces + easily and effectively. It offers a wide, and growing, collection of + Controls, and provides state of the art facilities such as drag and + drop, selection, as well as OpenGL widgets for 3D graphical + manipulation. FOX also implements icons, images, and user-convenience + features such as status line help, and tooltips. + + Even though FOX offers a large collection of controls already, FOX + leverages \Cpp{} to allow programmers to easily build additional Controls + and GUI elements, simply by taking existing controls, and creating a + derived class which simply adds or redefines the desired behavior. + } + \seetitle[http://www.daa.com.au/\~james/pygtk/]{PyGTK}{ + is a set of bindings for the \ulink{GTK}{http://www.gtk.org/} widget set. + It provides an object oriented interface that is slightly higher + level than the C one. It automatically does all the type casting and + reference counting that you would have to do normally with the C + API. There are also \ulink{bindings}{http://www.daa.com.au/\~james/gnome/} + to \ulink{GNOME}{http://www.gnome.org}, and a + \ulink{tutorial} + {http://laguna.fmedic.unam.mx/\~daniel/pygtutorial/pygtutorial/index.html} + is available. + } + \end{seealso} + + % XXX Reference URLs that compare the different UI packages From fdrake@users.sourceforge.net Fri Nov 16 03:22:18 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 15 Nov 2001 19:22:18 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib liburlparse.tex,1.19,1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv22748/Doc/lib Modified Files: liburlparse.tex Log Message: Document the urlsplit() and urlunsplit() functions. Index: liburlparse.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburlparse.tex,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** liburlparse.tex 2001/07/14 02:50:55 1.19 --- liburlparse.tex 2001/11/16 03:22:15 1.20 *************** *** 64,67 **** --- 64,86 ---- \end{funcdesc} + \begin{funcdesc}{urlsplit}{urlstring\optional{, + default_scheme\optional{, allow_fragments}}} + This is similar to \function{urlparse()}, but does not split the + params from the URL. This should generally be used instead of + \function{urlparse()} if the more recent URL syntax allowing + parameters to be applied to each segment of the \var{path} portion of + the URL (see \rfc{2396}). A separate function is needed to separate + the path segments and parameters. This function returns a 5-tuple: + (addressing scheme, network location, path, query, fragment + identifier). + \versionadded{2.2} + \end{funcdesc} + + \begin{funcdesc}{urlunsplit}{tuple} + Combine the elements of a tuple as returned by \function{urlsplit()} + into a complete URL as a string. + \versionadded{2.2} + \end{funcdesc} + \begin{funcdesc}{urljoin}{base, url\optional{, allow_fragments}} Construct a full (``absolute'') URL by combining a ``base URL'' From fdrake@users.sourceforge.net Fri Nov 16 03:22:26 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 15 Nov 2001 19:22:26 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib liburlparse.tex,1.19,1.19.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv22793/Doc/lib Modified Files: Tag: r22b2-branch liburlparse.tex Log Message: Document the urlsplit() and urlunsplit() functions. Index: liburlparse.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/liburlparse.tex,v retrieving revision 1.19 retrieving revision 1.19.12.1 diff -C2 -d -r1.19 -r1.19.12.1 *** liburlparse.tex 2001/07/14 02:50:55 1.19 --- liburlparse.tex 2001/11/16 03:22:24 1.19.12.1 *************** *** 64,67 **** --- 64,86 ---- \end{funcdesc} + \begin{funcdesc}{urlsplit}{urlstring\optional{, + default_scheme\optional{, allow_fragments}}} + This is similar to \function{urlparse()}, but does not split the + params from the URL. This should generally be used instead of + \function{urlparse()} if the more recent URL syntax allowing + parameters to be applied to each segment of the \var{path} portion of + the URL (see \rfc{2396}). A separate function is needed to separate + the path segments and parameters. This function returns a 5-tuple: + (addressing scheme, network location, path, query, fragment + identifier). + \versionadded{2.2} + \end{funcdesc} + + \begin{funcdesc}{urlunsplit}{tuple} + Combine the elements of a tuple as returned by \function{urlsplit()} + into a complete URL as a string. + \versionadded{2.2} + \end{funcdesc} + \begin{funcdesc}{urljoin}{base, url\optional{, allow_fragments}} Construct a full (``absolute'') URL by combining a ``base URL'' From fdrake@users.sourceforge.net Fri Nov 16 06:00:05 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 15 Nov 2001 22:00:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib tkinter.tex,1.1.2.1,1.1.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv15115/lib Modified Files: Tag: r22b2-branch tkinter.tex Log Message: Clean up some markup a little bit more. Make this work with the PDF format, which is a little more strict than the other formats on some things (fixable, but not tonight). Index: tkinter.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/tkinter.tex,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** tkinter.tex 2001/11/16 03:19:22 1.1.2.1 --- tkinter.tex 2001/11/16 06:00:03 1.1.2.2 *************** *** 11,15 **** extension, the \refmodule{Tix} module. ! \refmodule{Tkinter} is a thin object--oriented layer on top of Tcl/Tk. To use \refmodule{Tkinter}, you don't need to write Tcl code, but you will need to consult the Tk documentation, and occasionally --- 11,15 ---- extension, the \refmodule{Tix} module. ! The \refmodule{Tkinter} module is a thin object--oriented layer on top of Tcl/Tk. To use \refmodule{Tkinter}, you don't need to write Tcl code, but you will need to consult the Tk documentation, and occasionally *************** *** 19,26 **** Python and Tcl to interact. ! \refmodule{Tkinter} is not the only GUI for Python, but is however the ! most commonly used one; see section~\ref{other-gui-modules}, ! ``Other User Interface Modules and Packages'' for more information on ! other GUI toolkits for Python. % Other sections I have in mind are --- 19,26 ---- Python and Tcl to interact. ! Tk is not the only GUI for Python, but is however the most commonly ! used one; see section~\ref{other-gui-modules}, ``Other User Interface ! Modules and Packages,'' for more information on other GUI toolkits for ! Python. % Other sections I have in mind are *************** *** 70,79 **** \subsection{Tkinter Modules} ! \refmodule{Tkinter} consists of a number of modules. The Tk interface ! is located in a binary module named \module{_tkinter}. This module ! contains the low-level interface to Tk, and should never be used ! directly by application programmers. It is usually a shared library ! (or DLL), but might in some cases be statically linked with the Python ! interpreter. In addition to the Tk interface module, \refmodule{Tkinter} includes a --- 70,80 ---- \subsection{Tkinter Modules} ! Most of the time, the \refmodule{Tkinter} module is all you really ! need, but a number of additional modules are available as well. The ! Tk interface is located in a binary module named \module{_tkinter}. ! This module contains the low-level interface to Tk, and should never ! be used directly by application programmers. It is usually a shared ! library (or DLL), but might in some cases be statically linked with ! the Python interpreter. In addition to the Tk interface module, \refmodule{Tkinter} includes a *************** *** 307,311 **** will need to know how to read short passages of Tk and how to identify the various parts of a Tk command. ! (See \ref{tkinter-basic-mapping} for the \refmodule{Tkinter} equivalents of what's below.) --- 308,312 ---- will need to know how to read short passages of Tk and how to identify the various parts of a Tk command. ! (See section~\ref{tkinter-basic-mapping} for the \refmodule{Tkinter} equivalents of what's below.) *************** *** 393,398 **** keyword-arguments in the instance constructor, and keyword-args for configure calls or as instance indices, in dictionary style, for ! established instances. See \ref{tkinter-setting-options} ! on setting options. \begin{verbatim} --- 394,399 ---- keyword-arguments in the instance constructor, and keyword-args for configure calls or as instance indices, in dictionary style, for ! established instances. See section~\ref{tkinter-setting-options} on ! setting options. \begin{verbatim} *************** *** 427,430 **** --- 428,434 ---- \subsection{How Tk and Tkinter are Related} % Relationship.html + \note{This was derived from a graphical image; the image will be used + more directly in a subsequent version of this document.} + From the top down: \begin{description} *************** *** 860,875 **** text being displayed. You can use these \refmodule{Tkinter} functions to access these special points in text widgets: \begin{description} \item[AtEnd()] refers to the last position in the text \item[AtInsert()] refers to the point where the text cursor is \item[AtSelFirst()] indicates the beginning point of the selected text \item[AtSelLast()] denotes the last point of the selected text and finally ! \item[At(x, y=None)] ! refers to the character at pixel location x, y (with y not used ! in the case of a text entry widget, which is one line of text). \end{description} --- 864,885 ---- text being displayed. You can use these \refmodule{Tkinter} functions to access these special points in text widgets: + \begin{description} \item[AtEnd()] refers to the last position in the text + \item[AtInsert()] refers to the point where the text cursor is + \item[AtSelFirst()] indicates the beginning point of the selected text + \item[AtSelLast()] denotes the last point of the selected text and finally ! ! \item[At(x\optional{, y})] ! refers to the character at pixel location \var{x}, \var{y} (with ! \var{y} not used in the case of a text entry widget, which contains a ! single line of text). \end{description} *************** *** 950,962 **** \subsection{Using Tix} ! \begin{classdesc}{Tix}{screenName=None, baseName=None, className='Tix'} Toplevel widget of Tix which represents mostly the main window of an application. It has an associated Tcl interpreter. ! The \refmodule{Tix} interface module subclasses the \refmodule{Tkinter} ! module. The former imports the latter, so to use \refmodule{Tix} with ! Tkinter, all you need to do is to import one module. In general, you ! can just import Tix, and replace the toplevel call ! to \class{Tkinter.Tk} with \class{Tix.Tk}: \begin{verbatim} import Tix --- 960,972 ---- \subsection{Using Tix} ! \begin{classdesc}{Tix}{screenName\optional{, baseName\optional{, className}}} Toplevel widget of Tix which represents mostly the main window of an application. It has an associated Tcl interpreter. ! Classes in the \refmodule{Tix} module subclasses the classes in the ! \refmodule{Tkinter} module. The former imports the latter, so to use ! \refmodule{Tix} with Tkinter, all you need to do is to import one ! module. In general, you can just import \refmodule{Tix}, and replace ! the toplevel call to \class{Tkinter.Tk} with \class{Tix.Tk}: \begin{verbatim} import Tix *************** *** 1333,1339 **** \item \ulink{pixmap} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/pixmap.htm} capabilities ! to all \refmodule{Tix} and \refmodule{Tkinter} widgets to create color ! images from XPM files. % Python Demo of: \ulink{XPM Image In Button}{http://tix.sourceforge.net/dist/current/demos/samples/Xpm.tcl} --- 1343,1349 ---- \item \ulink{pixmap} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/pixmap.htm} ! capabilities to all \refmodule{Tix} and \refmodule{Tkinter} widgets to ! create color images from XPM files. % Python Demo of: \ulink{XPM Image In Button}{http://tix.sourceforge.net/dist/current/demos/samples/Xpm.tcl} *************** *** 1343,1348 **** \item \ulink{Compound} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/compound.html} image ! types can be used to create images that consists of multiple horizontal lines; each line is composed of a series of items (texts, bitmaps, images or spaces) arranged from left to right. For example, a --- 1353,1358 ---- \item \ulink{Compound} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/compound.html} ! image types can be used to create images that consists of multiple horizontal lines; each line is composed of a series of items (texts, bitmaps, images or spaces) arranged from left to right. For example, a *************** *** 1350,1360 **** simutaneously in a Tk \class{Button} widget. ! % Python Demo of: \ulink{Compound Image In Buttons}{http://tix.sourceforge.net/dist/current/demos/samples/CmpImg.tcl} ! % Python Demo of: \ulink{Compound Image In NoteBook}{http://tix.sourceforge.net/dist/current/demos/samples/CmpImg2.tcl} ! % Python Demo of: \ulink{Compound Image Notebook Color Tabs}{http://tix.sourceforge.net/dist/current/demos/samples/CmpImg4.tcl} ! % Python Demo of: \ulink{Compound Image Icons}{http://tix.sourceforge.net/dist/current/demos/samples/CmpImg3.tcl} \end{itemize} --- 1360,1374 ---- simutaneously in a Tk \class{Button} widget. ! % Python Demo of: ! % \ulink{Compound Image In Buttons}{http://tix.sourceforge.net/dist/current/demos/samples/CmpImg.tcl} ! % Python Demo of: ! % \ulink{Compound Image In NoteBook}{http://tix.sourceforge.net/dist/current/demos/samples/CmpImg2.tcl} ! % Python Demo of: ! % \ulink{Compound Image Notebook Color Tabs}{http://tix.sourceforge.net/dist/current/demos/samples/CmpImg4.tcl} ! % Python Demo of: ! % \ulink{Compound Image Icons}{http://tix.sourceforge.net/dist/current/demos/samples/CmpImg3.tcl} \end{itemize} *************** *** 1362,1371 **** \subsubsection{Miscellaneous Widgets} - \index{InputOnly widget} \begin{classdesc}{InputOnly}{} The \ulink{InputOnly} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixInputOnly.htm} widgets are ! to accept inputs from the user, which can be done with the \code{bind} ! command (\UNIX{} only). \end{classdesc} --- 1376,1384 ---- \subsubsection{Miscellaneous Widgets} \begin{classdesc}{InputOnly}{} The \ulink{InputOnly} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixInputOnly.htm} ! widgets are to accept inputs from the user, which can be done with the ! \code{bind} command (\UNIX{} only). \end{classdesc} *************** *** 1373,1381 **** In addition, \refmodule{Tix} augments \refmodule{Tkinter} by providing: ! \index{Form widget class} \begin{classdesc}{Form}{} The \ulink{Form} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixForm.htm} geometry ! manager based on attachment rules for all Tk widgets. \end{classdesc} --- 1386,1394 ---- In addition, \refmodule{Tix} augments \refmodule{Tkinter} by providing: ! \begin{classdesc}{Form}{} The \ulink{Form} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixForm.htm} ! geometry manager based on attachment rules for all Tk widgets. \end{classdesc} *************** *** 1554,1561 **** \begin{itemize} ! \item Alt-p retrieves previous command matching what you have typed ! \item Alt-n retrieves next \item \kbd{Return} while on any previous command retrieves that command ! \item Alt-/ (Expand word) is also useful here \end{itemize} --- 1567,1574 ---- \begin{itemize} ! \item \kbd{Alt-p} retrieves previous command matching what you have typed ! \item \kbd{Alt-n} retrieves next \item \kbd{Return} while on any previous command retrieves that command ! \item \kbd{Alt-/} (Expand word) is also useful here \end{itemize} *************** *** 1655,1659 **** ! \refmodule{Tkinter} is not the only GUI for Python, but is however the most commonly used one. --- 1668,1672 ---- ! Tk is not the only GUI for Python, but is however the most commonly used one. From fdrake@users.sourceforge.net Fri Nov 16 06:02:57 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 15 Nov 2001 22:02:57 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib tkinter.tex,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv15668/lib Modified Files: tkinter.tex Log Message: Clean up some markup a little bit more. Make this work with the PDF format, which is a little more strict than the other formats on some things (fixable, but not tonight). Index: tkinter.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/tkinter.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tkinter.tex 2001/11/16 01:05:27 1.2 --- tkinter.tex 2001/11/16 06:02:55 1.3 *************** *** 11,15 **** extension, the \refmodule{Tix} module. ! \refmodule{Tkinter} is a thin object--oriented layer on top of Tcl/Tk. To use \refmodule{Tkinter}, you don't need to write Tcl code, but you will need to consult the Tk documentation, and occasionally --- 11,15 ---- extension, the \refmodule{Tix} module. ! The \refmodule{Tkinter} module is a thin object--oriented layer on top of Tcl/Tk. To use \refmodule{Tkinter}, you don't need to write Tcl code, but you will need to consult the Tk documentation, and occasionally *************** *** 19,26 **** Python and Tcl to interact. ! \refmodule{Tkinter} is not the only GUI for Python, but is however the ! most commonly used one; see section~\ref{other-gui-modules}, ! ``Other User Interface Modules and Packages'' for more information on ! other GUI toolkits for Python. % Other sections I have in mind are --- 19,26 ---- Python and Tcl to interact. ! Tk is not the only GUI for Python, but is however the most commonly ! used one; see section~\ref{other-gui-modules}, ``Other User Interface ! Modules and Packages,'' for more information on other GUI toolkits for ! Python. % Other sections I have in mind are *************** *** 70,79 **** \subsection{Tkinter Modules} ! \refmodule{Tkinter} consists of a number of modules. The Tk interface ! is located in a binary module named \module{_tkinter}. This module ! contains the low-level interface to Tk, and should never be used ! directly by application programmers. It is usually a shared library ! (or DLL), but might in some cases be statically linked with the Python ! interpreter. In addition to the Tk interface module, \refmodule{Tkinter} includes a --- 70,80 ---- \subsection{Tkinter Modules} ! Most of the time, the \refmodule{Tkinter} module is all you really ! need, but a number of additional modules are available as well. The ! Tk interface is located in a binary module named \module{_tkinter}. ! This module contains the low-level interface to Tk, and should never ! be used directly by application programmers. It is usually a shared ! library (or DLL), but might in some cases be statically linked with ! the Python interpreter. In addition to the Tk interface module, \refmodule{Tkinter} includes a *************** *** 307,311 **** will need to know how to read short passages of Tk and how to identify the various parts of a Tk command. ! (See \ref{tkinter-basic-mapping} for the \refmodule{Tkinter} equivalents of what's below.) --- 308,312 ---- will need to know how to read short passages of Tk and how to identify the various parts of a Tk command. ! (See section~\ref{tkinter-basic-mapping} for the \refmodule{Tkinter} equivalents of what's below.) *************** *** 393,398 **** keyword-arguments in the instance constructor, and keyword-args for configure calls or as instance indices, in dictionary style, for ! established instances. See \ref{tkinter-setting-options} ! on setting options. \begin{verbatim} --- 394,399 ---- keyword-arguments in the instance constructor, and keyword-args for configure calls or as instance indices, in dictionary style, for ! established instances. See section~\ref{tkinter-setting-options} on ! setting options. \begin{verbatim} *************** *** 427,430 **** --- 428,434 ---- \subsection{How Tk and Tkinter are Related} % Relationship.html + \note{This was derived from a graphical image; the image will be used + more directly in a subsequent version of this document.} + From the top down: \begin{description} *************** *** 860,875 **** text being displayed. You can use these \refmodule{Tkinter} functions to access these special points in text widgets: \begin{description} \item[AtEnd()] refers to the last position in the text \item[AtInsert()] refers to the point where the text cursor is \item[AtSelFirst()] indicates the beginning point of the selected text \item[AtSelLast()] denotes the last point of the selected text and finally ! \item[At(x, y=None)] ! refers to the character at pixel location x, y (with y not used ! in the case of a text entry widget, which is one line of text). \end{description} --- 864,885 ---- text being displayed. You can use these \refmodule{Tkinter} functions to access these special points in text widgets: + \begin{description} \item[AtEnd()] refers to the last position in the text + \item[AtInsert()] refers to the point where the text cursor is + \item[AtSelFirst()] indicates the beginning point of the selected text + \item[AtSelLast()] denotes the last point of the selected text and finally ! ! \item[At(x\optional{, y})] ! refers to the character at pixel location \var{x}, \var{y} (with ! \var{y} not used in the case of a text entry widget, which contains a ! single line of text). \end{description} *************** *** 950,962 **** \subsection{Using Tix} ! \begin{classdesc}{Tix}{screenName=None, baseName=None, className='Tix'} Toplevel widget of Tix which represents mostly the main window of an application. It has an associated Tcl interpreter. ! The \refmodule{Tix} interface module subclasses the \refmodule{Tkinter} ! module. The former imports the latter, so to use \refmodule{Tix} with ! Tkinter, all you need to do is to import one module. In general, you ! can just import Tix, and replace the toplevel call ! to \class{Tkinter.Tk} with \class{Tix.Tk}: \begin{verbatim} import Tix --- 960,972 ---- \subsection{Using Tix} ! \begin{classdesc}{Tix}{screenName\optional{, baseName\optional{, className}}} Toplevel widget of Tix which represents mostly the main window of an application. It has an associated Tcl interpreter. ! Classes in the \refmodule{Tix} module subclasses the classes in the ! \refmodule{Tkinter} module. The former imports the latter, so to use ! \refmodule{Tix} with Tkinter, all you need to do is to import one ! module. In general, you can just import \refmodule{Tix}, and replace ! the toplevel call to \class{Tkinter.Tk} with \class{Tix.Tk}: \begin{verbatim} import Tix *************** *** 1333,1339 **** \item \ulink{pixmap} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/pixmap.htm} capabilities ! to all \refmodule{Tix} and \refmodule{Tkinter} widgets to create color ! images from XPM files. % Python Demo of: \ulink{XPM Image In Button}{http://tix.sourceforge.net/dist/current/demos/samples/Xpm.tcl} --- 1343,1349 ---- \item \ulink{pixmap} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/pixmap.htm} ! capabilities to all \refmodule{Tix} and \refmodule{Tkinter} widgets to ! create color images from XPM files. % Python Demo of: \ulink{XPM Image In Button}{http://tix.sourceforge.net/dist/current/demos/samples/Xpm.tcl} *************** *** 1343,1348 **** \item \ulink{Compound} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/compound.html} image ! types can be used to create images that consists of multiple horizontal lines; each line is composed of a series of items (texts, bitmaps, images or spaces) arranged from left to right. For example, a --- 1353,1358 ---- \item \ulink{Compound} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/compound.html} ! image types can be used to create images that consists of multiple horizontal lines; each line is composed of a series of items (texts, bitmaps, images or spaces) arranged from left to right. For example, a *************** *** 1350,1360 **** simutaneously in a Tk \class{Button} widget. ! % Python Demo of: \ulink{Compound Image In Buttons}{http://tix.sourceforge.net/dist/current/demos/samples/CmpImg.tcl} ! % Python Demo of: \ulink{Compound Image In NoteBook}{http://tix.sourceforge.net/dist/current/demos/samples/CmpImg2.tcl} ! % Python Demo of: \ulink{Compound Image Notebook Color Tabs}{http://tix.sourceforge.net/dist/current/demos/samples/CmpImg4.tcl} ! % Python Demo of: \ulink{Compound Image Icons}{http://tix.sourceforge.net/dist/current/demos/samples/CmpImg3.tcl} \end{itemize} --- 1360,1374 ---- simutaneously in a Tk \class{Button} widget. ! % Python Demo of: ! % \ulink{Compound Image In Buttons}{http://tix.sourceforge.net/dist/current/demos/samples/CmpImg.tcl} ! % Python Demo of: ! % \ulink{Compound Image In NoteBook}{http://tix.sourceforge.net/dist/current/demos/samples/CmpImg2.tcl} ! % Python Demo of: ! % \ulink{Compound Image Notebook Color Tabs}{http://tix.sourceforge.net/dist/current/demos/samples/CmpImg4.tcl} ! % Python Demo of: ! % \ulink{Compound Image Icons}{http://tix.sourceforge.net/dist/current/demos/samples/CmpImg3.tcl} \end{itemize} *************** *** 1362,1371 **** \subsubsection{Miscellaneous Widgets} - \index{InputOnly widget} \begin{classdesc}{InputOnly}{} The \ulink{InputOnly} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixInputOnly.htm} widgets are ! to accept inputs from the user, which can be done with the \code{bind} ! command (\UNIX{} only). \end{classdesc} --- 1376,1384 ---- \subsubsection{Miscellaneous Widgets} \begin{classdesc}{InputOnly}{} The \ulink{InputOnly} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixInputOnly.htm} ! widgets are to accept inputs from the user, which can be done with the ! \code{bind} command (\UNIX{} only). \end{classdesc} *************** *** 1373,1381 **** In addition, \refmodule{Tix} augments \refmodule{Tkinter} by providing: ! \index{Form widget class} \begin{classdesc}{Form}{} The \ulink{Form} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixForm.htm} geometry ! manager based on attachment rules for all Tk widgets. \end{classdesc} --- 1386,1394 ---- In addition, \refmodule{Tix} augments \refmodule{Tkinter} by providing: ! \begin{classdesc}{Form}{} The \ulink{Form} ! {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tixForm.htm} ! geometry manager based on attachment rules for all Tk widgets. \end{classdesc} *************** *** 1554,1561 **** \begin{itemize} ! \item Alt-p retrieves previous command matching what you have typed ! \item Alt-n retrieves next \item \kbd{Return} while on any previous command retrieves that command ! \item Alt-/ (Expand word) is also useful here \end{itemize} --- 1567,1574 ---- \begin{itemize} ! \item \kbd{Alt-p} retrieves previous command matching what you have typed ! \item \kbd{Alt-n} retrieves next \item \kbd{Return} while on any previous command retrieves that command ! \item \kbd{Alt-/} (Expand word) is also useful here \end{itemize} *************** *** 1655,1659 **** ! \refmodule{Tkinter} is not the only GUI for Python, but is however the most commonly used one. --- 1668,1672 ---- ! Tk is not the only GUI for Python, but is however the most commonly used one. From bwarsaw@users.sourceforge.net Fri Nov 16 15:07:13 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 16 Nov 2001 07:07:13 -0800 Subject: [Python-checkins] CVS: python/dist/src/Include patchlevel.h,2.58,2.58.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv9632 Modified Files: Tag: r22b2-branch patchlevel.h Log Message: Bumping version number to 2.2b2 Index: patchlevel.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/patchlevel.h,v retrieving revision 2.58 retrieving revision 2.58.2.1 diff -C2 -d -r2.58 -r2.58.2.1 *** patchlevel.h 2001/10/24 08:49:59 2.58 --- patchlevel.h 2001/11/16 15:07:10 2.58.2.1 *************** *** 24,31 **** #define PY_MICRO_VERSION 0 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_BETA ! #define PY_RELEASE_SERIAL 1 /* Version as a string */ ! #define PY_VERSION "2.2b1+" /* 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_BETA ! #define PY_RELEASE_SERIAL 2 /* Version as a string */ ! #define PY_VERSION "2.2b2" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. From bwarsaw@users.sourceforge.net Fri Nov 16 16:16:45 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 16 Nov 2001 08:16:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.315,1.315.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv2701 Modified Files: Tag: r22b2-branch NEWS Log Message: Updated NEWS for version 2.2beta2. Note that I added (guessed at ;) some items for the Mac platform. Jack should proofread and make any necessary corrections in both the branch (when he takes it over for the Mac release), and in the trunk so that it'll be updated for 2.2rc1. Corrections won't make it into the Windows or source releases for 2.2b2, so that'll have to be okay. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.315 retrieving revision 1.315.2.1 diff -C2 -d -r1.315 -r1.315.2.1 *** NEWS 2001/11/15 20:33:10 1.315 --- NEWS 2001/11/16 16:16:43 1.315.2.1 *************** *** 40,44 **** - Assignment to __debug__ raises SyntaxError at compile-time. This was promised when 2.1c1 was released as "What's New in Python 2.1c1" ! (below) says. - Clarified the error messages for unsupported operands to an operator --- 40,44 ---- - Assignment to __debug__ raises SyntaxError at compile-time. This was promised when 2.1c1 was released as "What's New in Python 2.1c1" ! (see below) says. - Clarified the error messages for unsupported operands to an operator *************** *** 79,84 **** example, the regexp r'(?P)(?P)' is not allowed, because a single name can't mean both "group 1" and "group 2" simultaneously. ! Python 2.2 detects this error at regexp compilation time; previously, ! the error went undetected, and results were unpredictable. - Tix exposes more commands through the classes DirSelectBox, --- 79,88 ---- example, the regexp r'(?P)(?P)' is not allowed, because a single name can't mean both "group 1" and "group 2" simultaneously. ! Python 2.2 detects this error at regexp compilation time; ! previously, the error went undetected, and results were ! unpredictable. Also in sre, the pattern.split(), pattern.sub(), and ! pattern.subn() methods have been rewritten in C. Also, an ! experimental function/method finditer() has been added, which works ! like findall() but returns an iterator. - Tix exposes more commands through the classes DirSelectBox, *************** *** 96,103 **** --- 100,132 ---- unless you have a masochistic desire to port your code to RISCOS. + - mimetypes.py has optional support for non-standard, but commonly + found types. guess_type() and guess_extension() now accept an + optional `strict' flag, defaulting to true, which controls whether + recognize non-standard types or not. A few non-standard types we + know about have been added. Also, when run as a script, there are + new -l and -e options. + + - statcache is now deprecated. + + - email.Utils.formatdate() now produces the preferred RFC 2822 style + dates with numeric timezones (it used to produce obsolete dates + hard coded to "GMT" timezone). An optional `localtime' flag is + added to produce dates in the local timezone, with daylight savings + time properly taken into account. + + - In pickle and cPickle, instead of masking errors in load() by + transforming them into SystemError, we let the original exception + propagate out. Also, implement support for __safe_for_unpickling__ + in pickle, as it already was supported in cPickle. + Tools/Demos Build + - The dbm module is built using libdb1 if available. The bsddb module + is built with libdb3 if available. + + - Misc/Makefile.pre.in has been removed by BDFL pronouncement. + C API *************** *** 106,109 **** --- 135,150 ---- PySequence_Size(). + - New argument unpacking function PyArg_UnpackTuple() added. + + - New functions PyObject_CallFunctionObjArgs() and + PyObject_CallMethodObjArgs() have been added to make it more + convenient and efficient to call functions and methods from C. + + - PyArg_ParseTupleAndKeywords() no longer masks errors, so it's + possible that this will propagate errors it didn't before. + + - New function PyObject_CheckReadBuffer(), which returns true if its + argument supports the single-segment readable buffer interface. + New platforms *************** *** 122,125 **** --- 163,179 ---- Windows + + Mac + + - PythonScript has been moved to unsupported and is slated to be + removed completely in the next release. + + - It should now be possible to build applets that work on both OS9 and + OSX. + + - The core is now linked with CoreServices not Carbon; as a side + result, default 8bit encoding on OSX is now ASCII. + + - Python should now build on OSX 10.1.1 From bwarsaw@users.sourceforge.net Fri Nov 16 16:17:30 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 16 Nov 2001 08:17:30 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.315,1.316 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv2971 Modified Files: NEWS Log Message: Merged in NEWS changes from the r22b2 branch. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.315 retrieving revision 1.316 diff -C2 -d -r1.315 -r1.316 *** NEWS 2001/11/15 20:33:10 1.315 --- NEWS 2001/11/16 16:17:27 1.316 *************** *** 40,44 **** - Assignment to __debug__ raises SyntaxError at compile-time. This was promised when 2.1c1 was released as "What's New in Python 2.1c1" ! (below) says. - Clarified the error messages for unsupported operands to an operator --- 40,44 ---- - Assignment to __debug__ raises SyntaxError at compile-time. This was promised when 2.1c1 was released as "What's New in Python 2.1c1" ! (see below) says. - Clarified the error messages for unsupported operands to an operator *************** *** 79,84 **** example, the regexp r'(?P)(?P)' is not allowed, because a single name can't mean both "group 1" and "group 2" simultaneously. ! Python 2.2 detects this error at regexp compilation time; previously, ! the error went undetected, and results were unpredictable. - Tix exposes more commands through the classes DirSelectBox, --- 79,88 ---- example, the regexp r'(?P)(?P)' is not allowed, because a single name can't mean both "group 1" and "group 2" simultaneously. ! Python 2.2 detects this error at regexp compilation time; ! previously, the error went undetected, and results were ! unpredictable. Also in sre, the pattern.split(), pattern.sub(), and ! pattern.subn() methods have been rewritten in C. Also, an ! experimental function/method finditer() has been added, which works ! like findall() but returns an iterator. - Tix exposes more commands through the classes DirSelectBox, *************** *** 96,103 **** --- 100,132 ---- unless you have a masochistic desire to port your code to RISCOS. + - mimetypes.py has optional support for non-standard, but commonly + found types. guess_type() and guess_extension() now accept an + optional `strict' flag, defaulting to true, which controls whether + recognize non-standard types or not. A few non-standard types we + know about have been added. Also, when run as a script, there are + new -l and -e options. + + - statcache is now deprecated. + + - email.Utils.formatdate() now produces the preferred RFC 2822 style + dates with numeric timezones (it used to produce obsolete dates + hard coded to "GMT" timezone). An optional `localtime' flag is + added to produce dates in the local timezone, with daylight savings + time properly taken into account. + + - In pickle and cPickle, instead of masking errors in load() by + transforming them into SystemError, we let the original exception + propagate out. Also, implement support for __safe_for_unpickling__ + in pickle, as it already was supported in cPickle. + Tools/Demos Build + - The dbm module is built using libdb1 if available. The bsddb module + is built with libdb3 if available. + + - Misc/Makefile.pre.in has been removed by BDFL pronouncement. + C API *************** *** 106,109 **** --- 135,150 ---- PySequence_Size(). + - New argument unpacking function PyArg_UnpackTuple() added. + + - New functions PyObject_CallFunctionObjArgs() and + PyObject_CallMethodObjArgs() have been added to make it more + convenient and efficient to call functions and methods from C. + + - PyArg_ParseTupleAndKeywords() no longer masks errors, so it's + possible that this will propagate errors it didn't before. + + - New function PyObject_CheckReadBuffer(), which returns true if its + argument supports the single-segment readable buffer interface. + New platforms *************** *** 122,125 **** --- 163,179 ---- Windows + + Mac + + - PythonScript has been moved to unsupported and is slated to be + removed completely in the next release. + + - It should now be possible to build applets that work on both OS9 and + OSX. + + - The core is now linked with CoreServices not Carbon; as a side + result, default 8bit encoding on OSX is now ASCII. + + - Python should now build on OSX 10.1.1 From fdrake@users.sourceforge.net Fri Nov 16 17:34:41 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 16 Nov 2001 09:34:41 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/texinputs boilerplate.tex,1.68,1.69 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory usw-pr-cvs1:/tmp/cvs-serv27523/texinputs Modified Files: boilerplate.tex Log Message: Post-release bumps. Do *NOT* merge into the 2.2b2 branch. Index: boilerplate.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/boilerplate.tex,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** boilerplate.tex 2001/11/14 22:28:26 1.68 --- boilerplate.tex 2001/11/16 17:34:38 1.69 *************** *** 6,11 **** } ! \date{November 16, 2001} % XXX update before release! \release{2.2} % software release, not documentation ! \setreleaseinfo{b2} % empty for final release \setshortversion{2.2} % major.minor only for software --- 6,11 ---- } ! \date{\today} % XXX update before release! \release{2.2} % software release, not documentation ! \setreleaseinfo{b2+} % empty for final release \setshortversion{2.2} % major.minor only for software From fdrake@users.sourceforge.net Fri Nov 16 17:34:40 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 16 Nov 2001 09:34:40 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc Makefile,1.232,1.233 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv27523 Modified Files: Makefile Log Message: Post-release bumps. Do *NOT* merge into the 2.2b2 branch. Index: Makefile =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/Makefile,v retrieving revision 1.232 retrieving revision 1.233 diff -C2 -d -r1.232 -r1.233 *** Makefile 2001/11/14 22:28:26 1.232 --- Makefile 2001/11/16 17:34:38 1.233 *************** *** 67,71 **** # This is the *documentation* release, and is used to construct the file # names of the downloadable tarballs. ! RELEASE=2.2b2 PYTHON= python --- 67,71 ---- # This is the *documentation* release, and is used to construct the file # names of the downloadable tarballs. ! RELEASE=2.2b2+ PYTHON= python From bwarsaw@users.sourceforge.net Fri Nov 16 21:12:27 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 16 Nov 2001 13:12:27 -0800 Subject: [Python-checkins] CVS: python/dist/src/Include patchlevel.h,2.58,2.59 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv8296 Modified Files: patchlevel.h Log Message: Bumping version number. Index: patchlevel.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/patchlevel.h,v retrieving revision 2.58 retrieving revision 2.59 diff -C2 -d -r2.58 -r2.59 *** patchlevel.h 2001/10/24 08:49:59 2.58 --- patchlevel.h 2001/11/16 21:12:25 2.59 *************** *** 24,31 **** #define PY_MICRO_VERSION 0 #define PY_RELEASE_LEVEL PY_RELEASE_LEVEL_BETA ! #define PY_RELEASE_SERIAL 1 /* Version as a string */ ! #define PY_VERSION "2.2b1+" /* 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_BETA ! #define PY_RELEASE_SERIAL 2 /* Version as a string */ ! #define PY_VERSION "2.2b2+" /* Version as a single 4-byte hex number, e.g. 0x010502B2 == 1.5.2b2. From bwarsaw@users.sourceforge.net Fri Nov 16 21:30:28 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 16 Nov 2001 13:30:28 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0101.txt,1.14,1.15 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv12383 Modified Files: pep-0101.txt Log Message: Just a few more minor updates based on the 2.2b2 release. Index: pep-0101.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0101.txt,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** pep-0101.txt 2001/10/29 15:53:04 1.14 --- pep-0101.txt 2001/11/16 21:30:25 1.15 *************** *** 148,151 **** --- 148,160 ---- about changes on the Mac. + This command should help you: + + % cvs log -rr22a2: | python Tools/scripts/logmerge.py > /tmp/news.txt + + You can then troll through the news.txt file looking for + interesting things to add to NEWS. + + ___ Check your NEWS changes into the branch and into the trunk. + ___ Once the branch is frozen, Fred Drake needs to create the HTML from the documentation. He does this and uploads the file to *************** *** 164,168 **** ___ 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 --- 173,178 ---- ___ 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. (Although, if you get there ! first, you should create the new release.) (Diversion: SF's file manager has "packages" and "releases". We *************** *** 453,460 **** ___ 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 --- 463,468 ---- ___ 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 \ ! > /tmp/diffcmd.sh ___ Edit diffcmd.sh to get rid of files that you know don't have From bwarsaw@users.sourceforge.net Fri Nov 16 22:16:06 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 16 Nov 2001 14:16:06 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib email.tex,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv25533 Modified Files: email.tex Log Message: Add a clarification that the email package always deals in native line endings, and that it is smtplib's job to convert those to RFC 2821 line endings when sending the message. Index: email.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/email.tex,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** email.tex 2001/11/05 17:50:53 1.8 --- email.tex 2001/11/16 22:16:04 1.9 *************** *** 18,22 **** such as \refmodule{rfc822}, \refmodule{mimetools}, \refmodule{multifile}, and other non-standard packages such as ! \module{mimecntl}. The primary distinguishing feature of the \module{email} package is --- 18,30 ---- such as \refmodule{rfc822}, \refmodule{mimetools}, \refmodule{multifile}, and other non-standard packages such as ! \module{mimecntl}. It is specifically \emph{not} designed to do any ! sending of email messages to SMTP (\rfc{2821}) servers; that is the ! function of the \refmodule{smtplib} module\footnote{For this reason, ! line endings in the \module{email} package are always native line ! endings. The \module{smtplib} module is responsible for converting ! from native line endings to \rfc{2821} line endings, just as your mail ! server would be responsible for converting from \rfc{2821} line ! endings to native line endings when it stores messages in a local ! mailbox.}. The primary distinguishing feature of the \module{email} package is *************** *** 50,53 **** --- 58,65 ---- \module{mimelib} package, from which the \module{email} package is descended, a section on differences and porting is provided. + + \begin{seealso} + \seemodule{smtplib}{SMTP protocol client} + \end{seealso} \subsection{Representing an email message} From bwarsaw@users.sourceforge.net Fri Nov 16 22:28:20 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 16 Nov 2001 14:28:20 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libcookie.tex,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv28181 Modified Files: libcookie.tex Log Message: Toughen up the security warnings a bit. Index: libcookie.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcookie.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** libcookie.tex 2001/06/29 16:21:47 1.6 --- libcookie.tex 2001/11/16 22:28:17 1.7 *************** *** 43,51 **** \function{pickle.loads()} and \function{pickle.dumps()}. ! Do not use this class. Reading pickled values from a cookie is a ! security hole, as arbitrary client-code can be run on ! \function{pickle.loads()}. It is supported for backwards ! compatibility. ! \end{classdesc} --- 43,50 ---- \function{pickle.loads()} and \function{pickle.dumps()}. ! \strong{Do not use this class!} Reading pickled values from untrusted ! cookie data is a huge security hole, as pickle strings can be crafted ! to cause arbitrary code to execute on your server. It is supported ! for backwards compatibility only, and may eventually go away. \end{classdesc} *************** *** 57,63 **** string, in which case it returns the value itself. ! The same security warning from \class{SerialCookie} applies here. \end{classdesc} \begin{seealso} --- 56,70 ---- string, in which case it returns the value itself. ! \strong{Note:} The same security warning from \class{SerialCookie} ! applies here. \end{classdesc} + A further security note is warranted. For backwards compatibility, + the \module{Cookie} module exports a class named \class{Cookie} which + is just an alias for \class{SmartCookie}. This is probably a mistake + and will likely be removed in a future version. You should not use + the \class{Cookie} class in your applications, for the same reason why + you should not use the \class{SerialCookie} class. + \begin{seealso} *************** *** 181,186 **** >>> C = Cookie.SimpleCookie() >>> C = Cookie.SerialCookie() - >>> C = Cookie.SmartCookie() - >>> C = Cookie.Cookie() # backwards-compatible alias for SmartCookie >>> C = Cookie.SmartCookie() >>> C["fig"] = "newton" --- 188,191 ---- From bwarsaw@users.sourceforge.net Sat Nov 17 00:19:40 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Fri, 16 Nov 2001 16:19:40 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0251.txt,1.7,1.8 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv19209 Modified Files: pep-0251.txt Log Message: 2.2b2 was just released. Index: pep-0251.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0251.txt,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** pep-0251.txt 2001/10/26 18:07:45 1.7 --- pep-0251.txt 2001/11/17 00:19:37 1.8 *************** *** 29,33 **** 19-Dec-2001: 2.2 (final release) 12-Dec-2001: 2.2c1 (release candidate) ! 14-Nov-2001: 2.2b2 19-Oct-2001: 2.2b1 [Released] 28-Sep-2001: 2.2a4 [Released] --- 29,33 ---- 19-Dec-2001: 2.2 (final release) 12-Dec-2001: 2.2c1 (release candidate) ! 14-Nov-2001: 2.2b2 [Released] 19-Oct-2001: 2.2b1 [Released] 28-Sep-2001: 2.2a4 [Released] From tim_one@users.sourceforge.net Sat Nov 17 00:21:59 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 16 Nov 2001 16:21:59 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.316,1.317 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv19634/python/Misc Modified Files: NEWS Log Message: Add skeleton for 2.2c1 news. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.316 retrieving revision 1.317 diff -C2 -d -r1.316 -r1.317 *** NEWS 2001/11/16 16:17:27 1.316 --- NEWS 2001/11/17 00:21:57 1.317 *************** *** 1,2 **** --- 1,29 ---- + What's New in Python 2.2c1? + XXX Release date: ??-Dec-2001 XXX + =========================== + + Type/class unification and new-style classes + + Core and builtins + + Extension modules + + Library + + Tools/Demos + + Build + + C API + + New platforms + + Tests + + Windows + + Mac + + What's New in Python 2.2b2? Release date: 16-Nov-2001 From tim_one@users.sourceforge.net Sat Nov 17 00:24:47 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Fri, 16 Nov 2001 16:24:47 -0800 Subject: [Python-checkins] CVS: python/dist/src/PCbuild python20.wse,1.96,1.97 Message-ID: Update of /cvsroot/python/python/dist/src/PCbuild In directory usw-pr-cvs1:/tmp/cvs-serv20118/python/PCbuild Modified Files: python20.wse Log Message: Update Windows installer for 2.2c1. Index: python20.wse =================================================================== RCS file: /cvsroot/python/python/dist/src/PCbuild/python20.wse,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** python20.wse 2001/11/07 04:42:04 1.96 --- python20.wse 2001/11/17 00:24:45 1.97 *************** *** 2,6 **** item: Global Version=8.14 ! Title=Python 2.2 beta 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 release candidate 1 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.2b2.exe Dialogs Version=8 ! Version File=2.2b2 Version Description=Python Programming Language Version Copyright=©2001 Python Software Foundation --- 19,25 ---- Patch Threshold=85 Patch Memory=4000 ! EXE Filename=Python-2.2c1.exe Dialogs Version=8 ! Version File=2.2c1 Version Description=Python Programming Language Version Copyright=©2001 Python Software Foundation *************** *** 65,69 **** item: Set Variable Variable=PYVER_STRING ! Value=2.2b2 end item: Remark --- 65,69 ---- item: Set Variable Variable=PYVER_STRING ! Value=2.2c1 end item: Remark From fdrake@users.sourceforge.net Sat Nov 17 06:28:10 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 16 Nov 2001 22:28:10 -0800 Subject: [Python-checkins] CVS: python/dist/src/Demo/embed Makefile,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/embed In directory usw-pr-cvs1:/tmp/cvs-serv26037 Modified Files: Makefile Log Message: Bump the version number; used to identify the Python runtime we link to. Index: Makefile =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/embed/Makefile,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Makefile 2001/06/02 06:16:02 1.10 --- Makefile 2001/11/17 06:28:08 1.11 *************** *** 11,15 **** # Python version ! VERSION= 2.1 # Compiler flags --- 11,15 ---- # Python version ! VERSION= 2.2 # Compiler flags From fdrake@users.sourceforge.net Sat Nov 17 06:30:22 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 16 Nov 2001 22:30:22 -0800 Subject: [Python-checkins] CVS: python/dist/src/Demo/embed demo.c,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/embed In directory usw-pr-cvs1:/tmp/cvs-serv26599 Modified Files: demo.c Log Message: Update to use more modern calling conventions; also avoid a magic number in the function table. Add a docstring for the function as well, since examples should show good form. Index: demo.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/embed/demo.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** demo.c 2001/01/10 17:09:00 1.6 --- demo.c 2001/11/17 06:30:20 1.7 *************** *** 49,59 **** xyzzy_foo(PyObject *self, PyObject* args) { - if (!PyArg_ParseTuple(args, "")) - return NULL; return PyInt_FromLong(42L); } static PyMethodDef xyzzy_methods[] = { ! {"foo", xyzzy_foo, 1}, {NULL, NULL} /* sentinel */ }; --- 49,58 ---- xyzzy_foo(PyObject *self, PyObject* args) { return PyInt_FromLong(42L); } static PyMethodDef xyzzy_methods[] = { ! {"foo", xyzzy_foo, METH_NOARGS, ! "Return the meaning of everything."}, {NULL, NULL} /* sentinel */ }; From fdrake@users.sourceforge.net Sat Nov 17 06:39:21 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 16 Nov 2001 22:39:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/api newtypes.tex,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv28552/api Modified Files: newtypes.tex Log Message: Add omitted word for clarity. Index: newtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/newtypes.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** newtypes.tex 2001/10/12 19:01:43 1.1 --- newtypes.tex 2001/11/17 06:39:18 1.2 *************** *** 159,163 **** 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{Py_InitModule4()} (or \NULL{} if --- 159,163 ---- This is the typical calling convention, where the methods have the type \ctype{PyMethodDef}. The function expects two ! \ctype{PyObject*} values. The first one is the \var{self} object for methods; for module functions, it has the value given to \cfunction{Py_InitModule4()} (or \NULL{} if From fdrake@users.sourceforge.net Sat Nov 17 06:50:44 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 16 Nov 2001 22:50:44 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/ext embedding.tex,1.2,1.3 extending.tex,1.4,1.5 newtypes.tex,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ext In directory usw-pr-cvs1:/tmp/cvs-serv30212 Modified Files: embedding.tex extending.tex newtypes.tex Log Message: Exhibit good form in C code: always provide docstrings in method tables, and always fill in all slots of table entries. Fixed a few minor markup errors. Index: embedding.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/embedding.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** embedding.tex 2001/09/06 16:17:24 1.2 --- embedding.tex 2001/11/17 06:50:42 1.3 *************** *** 232,238 **** } ! static PyMethodDef EmbMethods[]={ ! {"numargs", emb_numargs, METH_VARARGS}, ! {NULL, NULL} }; \end{verbatim} --- 232,239 ---- } ! static PyMethodDef EmbMethods[] = { ! {"numargs", emb_numargs, METH_VARARGS, ! "Return the number of arguments received by the process."}, ! {NULL, NULL, 0, NULL} }; \end{verbatim} Index: extending.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/extending.tex,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** extending.tex 2001/10/20 04:19:50 1.4 --- extending.tex 2001/11/17 06:50:42 1.5 *************** *** 216,220 **** \begin{verbatim} void ! initspam() { PyObject *m, *d; --- 216,220 ---- \begin{verbatim} void ! initspam(void) { PyObject *m, *d; *************** *** 309,315 **** static PyMethodDef SpamMethods[] = { ... ! {"system", spam_system, METH_VARARGS}, ... ! {NULL, NULL} /* Sentinel */ }; \end{verbatim} --- 309,316 ---- static PyMethodDef SpamMethods[] = { ... ! {"system", spam_system, METH_VARARGS, ! "Execute a shell command."}, ... ! {NULL, NULL, 0, NULL} /* Sentinel */ }; \end{verbatim} *************** *** 341,345 **** \begin{verbatim} void ! initspam() { (void) Py_InitModule("spam", SpamMethods); --- 342,346 ---- \begin{verbatim} void ! initspam(void) { (void) Py_InitModule("spam", SpamMethods); *************** *** 993,1002 **** * three. */ ! {"parrot", (PyCFunction)keywdarg_parrot, METH_VARARGS|METH_KEYWORDS}, ! {NULL, NULL} /* sentinel */ }; void ! initkeywdarg() { /* Create the module and add the functions */ --- 994,1004 ---- * three. */ ! {"parrot", (PyCFunction)keywdarg_parrot, METH_VARARGS|METH_KEYWORDS, ! "Print a lovely skit to standard output."}, ! {NULL, NULL, 0, NULL} /* sentinel */ }; void ! initkeywdarg(void) { /* Create the module and add the functions */ *************** *** 1591,1595 **** \begin{verbatim} void ! initspam() { PyObject *m; --- 1593,1597 ---- \begin{verbatim} void ! initspam(void) { PyObject *m; *************** *** 1615,1620 **** \end{verbatim} ! Note that \code{PySpam_API} is declared \code{static}; otherwise ! the pointer array would disappear when \code{initspam} terminates! The bulk of the work is in the header file \file{spammodule.h}, --- 1617,1622 ---- \end{verbatim} ! Note that \code{PySpam_API} is declared \keyword{static}; otherwise ! the pointer array would disappear when \function{initspam()} terminates! The bulk of the work is in the header file \file{spammodule.h}, *************** *** 1680,1684 **** \begin{verbatim} void ! initclient() { PyObject *m; --- 1682,1686 ---- \begin{verbatim} void ! initclient(void) { PyObject *m; Index: newtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/newtypes.tex,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** newtypes.tex 2001/10/16 20:32:05 1.4 --- newtypes.tex 2001/11/17 06:50:42 1.5 *************** *** 78,83 **** static PyMethodDef noddy_methods[] = { ! { "new_noddy", noddy_new_noddy, METH_VARARGS }, ! {NULL, NULL} }; --- 78,84 ---- static PyMethodDef noddy_methods[] = { ! {"new_noddy", noddy_new_noddy, METH_VARARGS, ! "Create a new Noddy object."}, ! {NULL, NULL, 0, NULL} }; *************** *** 582,588 **** \begin{verbatim} static PyMethodDef newdatatype_methods[] = { ! {"getSize", (PyCFunction)newdatatype_getSize, METH_VARARGS}, ! {"setSize", (PyCFunction)newdatatype_setSize, METH_VARARGS}, ! {NULL, NULL} /* sentinel */ }; --- 583,591 ---- \begin{verbatim} static PyMethodDef newdatatype_methods[] = { ! {"getSize", (PyCFunction)newdatatype_getSize, METH_VARARGS, ! "Return the current size."}, ! {"setSize", (PyCFunction)newdatatype_setSize, METH_VARARGS, ! "Set the size."}, ! {NULL, NULL, 0, NULL} /* sentinel */ }; From jackjansen@users.sourceforge.net Sun Nov 18 01:59:48 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 17 Nov 2001 17:59:48 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test regrtest.py,1.66,1.66.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv2743/Python/Lib/test Modified Files: Tag: r22b2-branch regrtest.py Log Message: test_curses is 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.66 retrieving revision 1.66.2.1 diff -C2 -d -r1.66 -r1.66.2.1 *** regrtest.py 2001/10/30 05:56:40 1.66 --- regrtest.py 2001/11/18 01:59:45 1.66.2.1 *************** *** 525,528 **** --- 525,529 ---- test_commands test_crypt + test_curses test_dbm test_dl From jackjansen@users.sourceforge.net Sun Nov 18 02:00:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 17 Nov 2001 18:00:38 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/mkcwproject/template-carbon template.prj.xml,1.3,1.3.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-carbon In directory usw-pr-cvs1:/tmp/cvs-serv2997/Python/Mac/Lib/mkcwproject/template-carbon Modified Files: Tag: r22b2-branch template.prj.xml Log Message: Adapted for new "unified" GUSI. Index: template.prj.xml =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-carbon/template.prj.xml,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** template.prj.xml 2001/11/10 23:21:55 1.3 --- template.prj.xml 2001/11/18 02:00:36 1.3.2.1 *************** *** 102,106 **** SearchPath ! Path%(sysprefix)s:GUSI2Carbon:include: PathFormatMacOS PathRoot%(mac_sysprefixtype)s --- 102,106 ---- SearchPath ! Path%(sysprefix)s:GUSI2:include: PathFormatMacOS PathRoot%(mac_sysprefixtype)s From jackjansen@users.sourceforge.net Sun Nov 18 02:01:26 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 17 Nov 2001 18:01:26 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCore.mcp,1.29,1.29.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv3169/Python/Mac/Build Modified Files: Tag: r22b2-branch PythonCore.mcp Log Message: Adapted for new unified GUSI. Upped CFM version numbers. Index: PythonCore.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.mcp,v retrieving revision 1.29 retrieving revision 1.29.2.1 diff -C2 -d -r1.29 -r1.29.2.1 Binary files /tmp/cvs5XPoAh and /tmp/cvs2e81Qq differ From jackjansen@users.sourceforge.net Sun Nov 18 02:02:10 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 17 Nov 2001 18:02:10 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonStandSmall.mcp,1.31,1.31.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv3235/Python/Mac/Build Modified Files: Tag: r22b2-branch PythonStandSmall.mcp Log Message: Adapted for new unified GUSI. Index: PythonStandSmall.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonStandSmall.mcp,v retrieving revision 1.31 retrieving revision 1.31.2.1 diff -C2 -d -r1.31 -r1.31.2.1 Binary files /tmp/cvstXcKN9 and /tmp/cvsirV4Ra differ From jackjansen@users.sourceforge.net Sun Nov 18 02:02:29 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 17 Nov 2001 18:02:29 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCore.exp,1.21,1.21.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv3376/Python/Mac/Build Modified Files: Tag: r22b2-branch PythonCore.exp Log Message: Regenerated Index: PythonCore.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.exp,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -C2 -d -r1.21 -r1.21.2.1 *** PythonCore.exp 2001/11/06 15:55:15 1.21 --- PythonCore.exp 2001/11/18 02:02:27 1.21.2.1 *************** *** 314,317 **** --- 314,318 ---- PyObject_AsWriteBuffer PyObject_AsReadBuffer + PyObject_CheckReadBuffer PyObject_AsCharBuffer PyObject_DelItem *************** *** 1153,1156 **** --- 1154,1158 ---- sError__11GUSIContext # GUSIContext::sError sHasThreading__11GUSIContext # GUSIContext::sHasThreading + sCreatingCurrentContext__11GUSIContext # GUSIContext::sCreatingCurrentContext sCurrentContext__11GUSIContext # GUSIContext::sCurrentContext sContexts__11GUSIContext # GUSIContext::sContexts *************** *** 1187,1193 **** __dt__18GUSIContextFactoryFv # GUSIContextFactory::~GUSIContextFactory() __ct__18GUSIContextFactoryFv # GUSIContextFactory::GUSIContextFactory() ! __dt__Q23std68auto_ptr<18GUSIContextFactory,Q23std29_Single<18GUSIContextFactory>>Fv # std::auto_ptr>::~auto_ptr() SetInstance__18GUSIContextFactoryFP18GUSIContextFactory # GUSIContextFactory::SetInstance(GUSIContextFactory*) Instance__18GUSIContextFactoryFv # GUSIContextFactory::Instance() GUSINewThread Wakeup__11GUSIProcessFv # GUSIProcess::Wakeup() --- 1189,1196 ---- __dt__18GUSIContextFactoryFv # GUSIContextFactory::~GUSIContextFactory() __ct__18GUSIContextFactoryFv # GUSIContextFactory::GUSIContextFactory() ! DeleteInstance__18GUSIContextFactoryFv # GUSIContextFactory::DeleteInstance() SetInstance__18GUSIContextFactoryFP18GUSIContextFactory # GUSIContextFactory::SetInstance(GUSIContextFactory*) Instance__18GUSIContextFactoryFv # GUSIContextFactory::Instance() + GUSISetupContextFactory GUSINewThread Wakeup__11GUSIProcessFv # GUSIProcess::Wakeup() *************** *** 1238,1241 **** --- 1241,1247 ---- SetInstance__19GUSIDescriptorTableFP19GUSIDescriptorTable # GUSIDescriptorTable::SetInstance(GUSIDescriptorTable*) Instance__19GUSIDescriptorTableFv # GUSIDescriptorTable::Instance() + GUSISetupDescriptorTable + __ct__10GUSIDeviceFv # GUSIDevice::GUSIDevice() + __ct__14GUSINullDeviceFv # GUSINullDevice::GUSINullDevice() Instance__14GUSINullDeviceFv # GUSINullDevice::Instance() GUSIDefaultSetupConsole *************** *** 1367,1370 **** --- 1373,1377 ---- CScratch__12GUSIFileSpecFb # GUSIFileSpec::CScratch(bool) ReadHex__FPCciPc # ReadHex(const char*,int,char*) + GUSIFSXGetVolInfo__FP31GUSIIOPBWrapper<12XVolumeParam> # GUSIFSXGetVolInfo(GUSIIOPBWrapper*) GUSIFSMoveRename GUSIFSCatMove *************** *** 1594,1657 **** Want__14GUSINullDeviceFR13GUSIFileToken # GUSINullDevice::Want(GUSIFileToken&) GUSIwithNullSockets - __vt__13GUSIScatterer # GUSIScatterer::__vt - __vt__20GUSIOTDatagramSocket # GUSIOTDatagramSocket::__vt - __vt__18GUSIOTStreamSocket # GUSIOTStreamSocket::__vt - __vt__12GUSIOTSocket # GUSIOTSocket::__vt - __vt__14GUSIOTStrategy # GUSIOTStrategy::__vt - __vt__21GUSIOTDatagramFactory # GUSIOTDatagramFactory::__vt - __vt__13GUSIOTFactory # GUSIOTFactory::__vt - __vt__19GUSIOTStreamFactory # GUSIOTStreamFactory::__vt - sOK__13GUSIOTFactory # GUSIOTFactory::sOK - __dt__19GUSIOTStreamFactoryFv # GUSIOTStreamFactory::~GUSIOTStreamFactory() - __dt__13GUSIOTFactoryFv # GUSIOTFactory::~GUSIOTFactory() - __dt__21GUSIOTDatagramFactoryFv # GUSIOTDatagramFactory::~GUSIOTDatagramFactory() - select__20GUSIOTDatagramSocketFPbPbPb # GUSIOTDatagramSocket::select(bool*,bool*,bool*) - __dt__Q23std80auto_ptr<24GUSIOTAddr<9TUnitData,5>,Q23std35_Single<24GUSIOTAddr<9TUnitData,5>>>Fv # std::auto_ptr, std::_Single>>::~auto_ptr() - sendto__20GUSIOTDatagramSocketFRC12GUSIGathereriPCvUi # GUSIOTDatagramSocket::sendto(const GUSIGatherer&,int,const void*,unsigned int) - __dt__13GUSIScattererFv # GUSIScatterer::~GUSIScatterer() - recvfrom__20GUSIOTDatagramSocketFRC13GUSIScattereriPvPUi # GUSIOTDatagramSocket::recvfrom(const GUSIScatterer&,int,void*,unsigned int*) - connect__20GUSIOTDatagramSocketFPvUi # GUSIOTDatagramSocket::connect(void*,unsigned int) - getpeername__20GUSIOTDatagramSocketFPvPUi # GUSIOTDatagramSocket::getpeername(void*,unsigned int*) - BindIfUnbound__20GUSIOTDatagramSocketFv # GUSIOTDatagramSocket::BindIfUnbound() - __dt__20GUSIOTDatagramSocketFv # GUSIOTDatagramSocket::~GUSIOTDatagramSocket() - Clone__20GUSIOTDatagramSocketFv # GUSIOTDatagramSocket::Clone() - __ct__20GUSIOTDatagramSocketFP14GUSIOTStrategy # GUSIOTDatagramSocket::GUSIOTDatagramSocket(GUSIOTStrategy*) - shutdown__18GUSIOTStreamSocketFi # GUSIOTStreamSocket::shutdown(int) - select__18GUSIOTStreamSocketFPbPbPb # GUSIOTStreamSocket::select(bool*,bool*,bool*) - sendto__18GUSIOTStreamSocketFRC12GUSIGathereriPCvUi # GUSIOTStreamSocket::sendto(const GUSIGatherer&,int,const void*,unsigned int) - __dt__Q210GUSISocket17AddContextInScopeFv # GUSISocket::AddContextInScope::~AddContextInScope() - recvfrom__18GUSIOTStreamSocketFRC13GUSIScattereriPvPUi # GUSIOTStreamSocket::recvfrom(const GUSIScatterer&,int,void*,unsigned int*) - connect__18GUSIOTStreamSocketFPvUi # GUSIOTStreamSocket::connect(void*,unsigned int) - accept__18GUSIOTStreamSocketFPvPUi # GUSIOTStreamSocket::accept(void*,unsigned int*) - getpeername__18GUSIOTStreamSocketFPvPUi # GUSIOTStreamSocket::getpeername(void*,unsigned int*) - listen__18GUSIOTStreamSocketFi # GUSIOTStreamSocket::listen(int) - MopupEvents__18GUSIOTStreamSocketFv # GUSIOTStreamSocket::MopupEvents() - Close__18GUSIOTStreamSocketFUl # GUSIOTStreamSocket::Close(unsigned long) - __dt__18GUSIOTStreamSocketFv # GUSIOTStreamSocket::~GUSIOTStreamSocket() - close__18GUSIOTStreamSocketFv # GUSIOTStreamSocket::close() - Clone__18GUSIOTStreamSocketFv # GUSIOTStreamSocket::Clone() - __ct__18GUSIOTStreamSocketFP14GUSIOTStrategy # GUSIOTStreamSocket::GUSIOTStreamSocket(GUSIOTStrategy*) - Supports__12GUSIOTSocketFQ210GUSISocket12ConfigOption # GUSIOTSocket::Supports(GUSISocket::ConfigOption) - setsockopt__12GUSIOTSocketFiiPvUi # GUSIOTSocket::setsockopt(int,int,void*,unsigned int) - getsockopt__12GUSIOTSocketFiiPvPUi # GUSIOTSocket::getsockopt(int,int,void*,unsigned int*) - ioctl__12GUSIOTSocketFUiPc # GUSIOTSocket::ioctl(unsigned int,char*) - fcntl__12GUSIOTSocketFiPc # GUSIOTSocket::fcntl(int,char*) - shutdown__12GUSIOTSocketFi # GUSIOTSocket::shutdown(int) - getsockname__12GUSIOTSocketFPvPUi # GUSIOTSocket::getsockname(void*,unsigned int*) - Unbind__12GUSIOTSocketFv # GUSIOTSocket::Unbind() - BindToAddress__12GUSIOTSocketFP20GUSIOTAddr<5TBind,1> # GUSIOTSocket::BindToAddress(GUSIOTAddr*) - bind__12GUSIOTSocketFPvUi # GUSIOTSocket::bind(void*,unsigned int) - __dt__12GUSIOTSocketFv # GUSIOTSocket::~GUSIOTSocket() - close__12GUSIOTSocketFv # GUSIOTSocket::close() - __ct__12GUSIOTSocketFP14GUSIOTStrategy # GUSIOTSocket::GUSIOTSocket(GUSIOTStrategy*) - __dt__Q212GUSIOTSocket4LockFv # GUSIOTSocket::Lock::~Lock() - MopupEvents__12GUSIOTSocketFv # GUSIOTSocket::MopupEvents() - CopyAddress__14GUSIOTStrategyFRC7TNetbufR7TNetbuf # GUSIOTStrategy::CopyAddress(const TNetbuf&,TNetbuf&) - __dt__14GUSIOTStrategyFv # GUSIOTStrategy::~GUSIOTStrategy() - CreateConfiguration__14GUSIOTStrategyFv # GUSIOTStrategy::CreateConfiguration() - socket__21GUSIOTDatagramFactoryFiii # GUSIOTDatagramFactory::socket(int,int,int) - socket__19GUSIOTStreamFactoryFiii # GUSIOTStreamFactory::socket(int,int,int) - Initialize__13GUSIOTFactoryFv # GUSIOTFactory::Initialize() - GUSIOTNotify __vt__15GUSIOTUdpSocket # GUSIOTUdpSocket::__vt __vt__17GUSIOTUdpStrategy # GUSIOTUdpStrategy::__vt --- 1601,1604 ---- *************** *** 1661,1664 **** --- 1608,1612 ---- __vt__16GUSIOTUdpFactory # GUSIOTUdpFactory::__vt __vt__16GUSIOTTcpFactory # GUSIOTTcpFactory::__vt + __vt__13GUSIOTFactory # GUSIOTFactory::__vt sInstance__16GUSIOTUdpFactory # GUSIOTUdpFactory::sInstance sInstance__16GUSIOTTcpFactory # GUSIOTTcpFactory::sInstance *************** *** 1689,1696 **** --- 1637,1647 ---- socket__16GUSIOTUdpFactoryFiii # GUSIOTUdpFactory::socket(int,int,int) Strategy__16GUSIOTUdpFactoryFiii # GUSIOTUdpFactory::Strategy(int,int,int) + __dt__21GUSIOTDatagramFactoryFv # GUSIOTDatagramFactory::~GUSIOTDatagramFactory() Instance__16GUSIOTUdpFactoryFv # GUSIOTUdpFactory::Instance() socket__16GUSIOTTcpFactoryFiii # GUSIOTTcpFactory::socket(int,int,int) __dt__18GUSIOTInetStrategyFv # GUSIOTInetStrategy::~GUSIOTInetStrategy() Strategy__16GUSIOTTcpFactoryFiii # GUSIOTTcpFactory::Strategy(int,int,int) + __dt__13GUSIOTFactoryFv # GUSIOTFactory::~GUSIOTFactory() + __dt__19GUSIOTStreamFactoryFv # GUSIOTStreamFactory::~GUSIOTStreamFactory() Instance__16GUSIOTTcpFactoryFv # GUSIOTTcpFactory::Instance() __vt__11GUSIOTNetDB # GUSIOTNetDB::__vt *************** *** 1721,1726 **** GUSIwithLocalSockets __vt__12GUSIGatherer # GUSIGatherer::__vt get__40GUSISpecificDataFP17GUSISpecificTable # GUSISpecificData::get(GUSISpecificTable*) ! faccess__FPCcPUiPv # faccess(const char*,unsigned int*,void*) fsetfileinfo fgetfileinfo --- 1672,1678 ---- GUSIwithLocalSockets __vt__12GUSIGatherer # GUSIGatherer::__vt + __vt__13GUSIScatterer # GUSIScatterer::__vt get__40GUSISpecificDataFP17GUSISpecificTable # GUSISpecificData::get(GUSISpecificTable*) ! faccess fsetfileinfo fgetfileinfo *************** *** 1805,1808 **** --- 1757,1761 ---- __dt__12GUSIGathererFv # GUSIGatherer::~GUSIGatherer() write + __dt__13GUSIScattererFv # GUSIScatterer::~GUSIScatterer() read close *************** *** 1834,1841 **** bind__13GUSIPPCSocketFPvUi # GUSIPPCSocket::bind(void*,unsigned int) __ct__13GUSIPPCSocketFv # GUSIPPCSocket::GUSIPPCSocket() ! GUSIPPCDone__FP16PPCParamBlockRec # GUSIPPCDone(PPCParamBlockRec*) ! GUSIPPCListenDone__FP16PPCParamBlockRec # GUSIPPCListenDone(PPCParamBlockRec*) ! GUSIPPCRecvDone__FP16PPCParamBlockRec # GUSIPPCRecvDone(PPCParamBlockRec*) ! GUSIPPCSendDone__FP16PPCParamBlockRec # GUSIPPCSendDone(PPCParamBlockRec*) SetupListener__13GUSIPPCSocketFRQ213GUSIPPCSocket8Listener # GUSIPPCSocket::SetupListener(GUSIPPCSocket::Listener&) socket__14GUSIPPCFactoryFiii # GUSIPPCFactory::socket(int,int,int) --- 1787,1794 ---- bind__13GUSIPPCSocketFPvUi # GUSIPPCSocket::bind(void*,unsigned int) __ct__13GUSIPPCSocketFv # GUSIPPCSocket::GUSIPPCSocket() ! GUSIPPCDone ! GUSIPPCListenDone ! GUSIPPCRecvDone ! GUSIPPCSendDone SetupListener__13GUSIPPCSocketFRQ213GUSIPPCSocket8Listener # GUSIPPCSocket::SetupListener(GUSIPPCSocket::Listener&) socket__14GUSIPPCFactoryFiii # GUSIPPCFactory::socket(int,int,int) *************** *** 2004,2007 **** --- 1957,2015 ---- __dt__14GUSISigContextFv # GUSISigContext::~GUSISigContext() __ct__14GUSISigContextFPC14GUSISigContext # GUSISigContext::GUSISigContext(const GUSISigContext*) + __vt__20GUSIOTDatagramSocket # GUSIOTDatagramSocket::__vt + __vt__18GUSIOTStreamSocket # GUSIOTStreamSocket::__vt + __vt__12GUSIOTSocket # GUSIOTSocket::__vt + __vt__14GUSIOTStrategy # GUSIOTStrategy::__vt + __vt__21GUSIOTDatagramFactory # GUSIOTDatagramFactory::__vt + __vt__19GUSIOTStreamFactory # GUSIOTStreamFactory::__vt + sOK__13GUSIOTFactory # GUSIOTFactory::sOK + select__20GUSIOTDatagramSocketFPbPbPb # GUSIOTDatagramSocket::select(bool*,bool*,bool*) + __dt__Q23std80auto_ptr<24GUSIOTAddr<9TUnitData,5>,Q23std35_Single<24GUSIOTAddr<9TUnitData,5>>>Fv # std::auto_ptr, std::_Single>>::~auto_ptr() + sendto__20GUSIOTDatagramSocketFRC12GUSIGathereriPCvUi # GUSIOTDatagramSocket::sendto(const GUSIGatherer&,int,const void*,unsigned int) + recvfrom__20GUSIOTDatagramSocketFRC13GUSIScattereriPvPUi # GUSIOTDatagramSocket::recvfrom(const GUSIScatterer&,int,void*,unsigned int*) + connect__20GUSIOTDatagramSocketFPvUi # GUSIOTDatagramSocket::connect(void*,unsigned int) + getpeername__20GUSIOTDatagramSocketFPvPUi # GUSIOTDatagramSocket::getpeername(void*,unsigned int*) + BindIfUnbound__20GUSIOTDatagramSocketFv # GUSIOTDatagramSocket::BindIfUnbound() + __dt__20GUSIOTDatagramSocketFv # GUSIOTDatagramSocket::~GUSIOTDatagramSocket() + Clone__20GUSIOTDatagramSocketFv # GUSIOTDatagramSocket::Clone() + __ct__20GUSIOTDatagramSocketFP14GUSIOTStrategy # GUSIOTDatagramSocket::GUSIOTDatagramSocket(GUSIOTStrategy*) + shutdown__18GUSIOTStreamSocketFi # GUSIOTStreamSocket::shutdown(int) + select__18GUSIOTStreamSocketFPbPbPb # GUSIOTStreamSocket::select(bool*,bool*,bool*) + sendto__18GUSIOTStreamSocketFRC12GUSIGathereriPCvUi # GUSIOTStreamSocket::sendto(const GUSIGatherer&,int,const void*,unsigned int) + __dt__Q210GUSISocket17AddContextInScopeFv # GUSISocket::AddContextInScope::~AddContextInScope() + recvfrom__18GUSIOTStreamSocketFRC13GUSIScattereriPvPUi # GUSIOTStreamSocket::recvfrom(const GUSIScatterer&,int,void*,unsigned int*) + connect__18GUSIOTStreamSocketFPvUi # GUSIOTStreamSocket::connect(void*,unsigned int) + accept__18GUSIOTStreamSocketFPvPUi # GUSIOTStreamSocket::accept(void*,unsigned int*) + getpeername__18GUSIOTStreamSocketFPvPUi # GUSIOTStreamSocket::getpeername(void*,unsigned int*) + listen__18GUSIOTStreamSocketFi # GUSIOTStreamSocket::listen(int) + MopupEvents__18GUSIOTStreamSocketFv # GUSIOTStreamSocket::MopupEvents() + Close__18GUSIOTStreamSocketFUl # GUSIOTStreamSocket::Close(unsigned long) + __dt__18GUSIOTStreamSocketFv # GUSIOTStreamSocket::~GUSIOTStreamSocket() + close__18GUSIOTStreamSocketFv # GUSIOTStreamSocket::close() + Clone__18GUSIOTStreamSocketFv # GUSIOTStreamSocket::Clone() + __ct__18GUSIOTStreamSocketFP14GUSIOTStrategy # GUSIOTStreamSocket::GUSIOTStreamSocket(GUSIOTStrategy*) + Supports__12GUSIOTSocketFQ210GUSISocket12ConfigOption # GUSIOTSocket::Supports(GUSISocket::ConfigOption) + setsockopt__12GUSIOTSocketFiiPvUi # GUSIOTSocket::setsockopt(int,int,void*,unsigned int) + getsockopt__12GUSIOTSocketFiiPvPUi # GUSIOTSocket::getsockopt(int,int,void*,unsigned int*) + pre_select__12GUSIOTSocketFbbb # GUSIOTSocket::pre_select(bool,bool,bool) + ioctl__12GUSIOTSocketFUiPc # GUSIOTSocket::ioctl(unsigned int,char*) + fcntl__12GUSIOTSocketFiPc # GUSIOTSocket::fcntl(int,char*) + shutdown__12GUSIOTSocketFi # GUSIOTSocket::shutdown(int) + getsockname__12GUSIOTSocketFPvPUi # GUSIOTSocket::getsockname(void*,unsigned int*) + Unbind__12GUSIOTSocketFv # GUSIOTSocket::Unbind() + BindToAddress__12GUSIOTSocketFP20GUSIOTAddr<5TBind,1> # GUSIOTSocket::BindToAddress(GUSIOTAddr*) + bind__12GUSIOTSocketFPvUi # GUSIOTSocket::bind(void*,unsigned int) + __dt__12GUSIOTSocketFv # GUSIOTSocket::~GUSIOTSocket() + close__12GUSIOTSocketFv # GUSIOTSocket::close() + __ct__12GUSIOTSocketFP14GUSIOTStrategy # GUSIOTSocket::GUSIOTSocket(GUSIOTStrategy*) + __dt__Q212GUSIOTSocket4LockFv # GUSIOTSocket::Lock::~Lock() + MopupEvents__12GUSIOTSocketFv # GUSIOTSocket::MopupEvents() + CopyAddress__14GUSIOTStrategyFRC7TNetbufR7TNetbuf # GUSIOTStrategy::CopyAddress(const TNetbuf&,TNetbuf&) + __dt__14GUSIOTStrategyFv # GUSIOTStrategy::~GUSIOTStrategy() + CreateConfiguration__14GUSIOTStrategyFv # GUSIOTStrategy::CreateConfiguration() + socket__21GUSIOTDatagramFactoryFiii # GUSIOTDatagramFactory::socket(int,int,int) + socket__19GUSIOTStreamFactoryFiii # GUSIOTStreamFactory::socket(int,int,int) + Initialize__13GUSIOTFactoryFv # GUSIOTFactory::Initialize() + GUSIOTNotify atan atan2 *************** *** 2107,2110 **** --- 2115,2119 ---- __dt__Q23std9bad_allocFv # std::bad_alloc::~bad_alloc() qd + exit __console_exit __stdio_exit From jackjansen@users.sourceforge.net Sun Nov 18 02:02:37 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 17 Nov 2001 18:02:37 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCoreCarbon.exp,1.21,1.21.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv3401/Python/Mac/Build Modified Files: Tag: r22b2-branch PythonCoreCarbon.exp Log Message: Regenerated Index: PythonCoreCarbon.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCoreCarbon.exp,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -C2 -d -r1.21 -r1.21.2.1 *** PythonCoreCarbon.exp 2001/11/06 15:55:23 1.21 --- PythonCoreCarbon.exp 2001/11/18 02:02:34 1.21.2.1 *************** *** 314,317 **** --- 314,318 ---- PyObject_AsWriteBuffer PyObject_AsReadBuffer + PyObject_CheckReadBuffer PyObject_AsCharBuffer PyObject_DelItem *************** *** 1078,1082 **** GUSIStdioFlush GUSIStdioClose ! _fdopen __close_console __close_file --- 1079,1083 ---- GUSIStdioFlush GUSIStdioClose ! _fdopen__FiPCc # _fdopen(int,const char*) __close_console __close_file *************** *** 1147,1150 **** --- 1148,1152 ---- sError__11GUSIContext # GUSIContext::sError sHasThreading__11GUSIContext # GUSIContext::sHasThreading + sCreatingCurrentContext__11GUSIContext # GUSIContext::sCreatingCurrentContext sCurrentContext__11GUSIContext # GUSIContext::sCurrentContext sContexts__11GUSIContext # GUSIContext::sContexts *************** *** 1155,1161 **** __dt__Q23std76auto_ptr<22GUSIThreadManagerProxy,Q23std33_Single<22GUSIThreadManagerProxy>>Fv # std::auto_ptr>::~auto_ptr() Instance__22GUSIThreadManagerProxyFv # GUSIThreadManagerProxy::Instance() ! SetThreadTerminator__22GUSIThreadManagerProxyFUlPFUlPv_vPv # GUSIThreadManagerProxy::SetThreadTerminator(unsigned long,void (*)(unsigned long, void*),void*) ! SetThreadSwitcher__22GUSIThreadManagerProxyFUlPFUlPv_vPvUc # GUSIThreadManagerProxy::SetThreadSwitcher(unsigned long,void (*)(unsigned long, void*),void*,unsigned char) ! NewThread__22GUSIThreadManagerProxyFUlPFPv_PvPvlUlPPvPUl # GUSIThreadManagerProxy::NewThread(unsigned long,void* (*)(void*),void*,long,unsigned long,void**,unsigned long*) GUSIControl__FP7IOParam # GUSIControl(IOParam*) GUSIFinishIO__FP7IOParam # GUSIFinishIO(IOParam*) --- 1157,1163 ---- __dt__Q23std76auto_ptr<22GUSIThreadManagerProxy,Q23std33_Single<22GUSIThreadManagerProxy>>Fv # std::auto_ptr>::~auto_ptr() Instance__22GUSIThreadManagerProxyFv # GUSIThreadManagerProxy::Instance() ! SetThreadTerminator__22GUSIThreadManagerProxyFUlP30OpaqueThreadTerminationProcPtrPv # GUSIThreadManagerProxy::SetThreadTerminator(unsigned long,OpaqueThreadTerminationProcPtr*,void*) ! SetThreadSwitcher__22GUSIThreadManagerProxyFUlP25OpaqueThreadSwitchProcPtrPvUc # GUSIThreadManagerProxy::SetThreadSwitcher(unsigned long,OpaqueThreadSwitchProcPtr*,void*,unsigned char) ! NewThread__22GUSIThreadManagerProxyFUlP24OpaqueThreadEntryProcPtrPvlUlPPvPUl # GUSIThreadManagerProxy::NewThread(unsigned long,OpaqueThreadEntryProcPtr*,void*,long,unsigned long,void**,unsigned long*) GUSIControl__FP7IOParam # GUSIControl(IOParam*) GUSIFinishIO__FP7IOParam # GUSIFinishIO(IOParam*) *************** *** 1172,1187 **** SwitchOut__11GUSIContextFv # GUSIContext::SwitchOut() SwitchIn__11GUSIContextFv # GUSIContext::SwitchIn() ! SetTerminator__11GUSIContextFPFUlPv_vPv # GUSIContext::SetTerminator(void (*)(unsigned long, void*),void*) GUSISetThreadTerminator ! SetSwitchOut__11GUSIContextFPFUlPv_vPv # GUSIContext::SetSwitchOut(void (*)(unsigned long, void*),void*) ! SetSwitchIn__11GUSIContextFPFUlPv_vPv # GUSIContext::SetSwitchIn(void (*)(unsigned long, void*),void*) GUSISetThreadSwitcher CreateContext__18GUSIContextFactoryFUl # GUSIContextFactory::CreateContext(unsigned long) ! CreateContext__18GUSIContextFactoryFPFPv_PvPvlUlPPvPUl # GUSIContextFactory::CreateContext(void* (*)(void*),void*,long,unsigned long,void**,unsigned long*) __dt__18GUSIContextFactoryFv # GUSIContextFactory::~GUSIContextFactory() __ct__18GUSIContextFactoryFv # GUSIContextFactory::GUSIContextFactory() ! __dt__Q23std68auto_ptr<18GUSIContextFactory,Q23std29_Single<18GUSIContextFactory>>Fv # std::auto_ptr>::~auto_ptr() SetInstance__18GUSIContextFactoryFP18GUSIContextFactory # GUSIContextFactory::SetInstance(GUSIContextFactory*) Instance__18GUSIContextFactoryFv # GUSIContextFactory::Instance() GUSINewThread Wakeup__11GUSIProcessFv # GUSIProcess::Wakeup() --- 1174,1190 ---- SwitchOut__11GUSIContextFv # GUSIContext::SwitchOut() SwitchIn__11GUSIContextFv # GUSIContext::SwitchIn() ! SetTerminator__11GUSIContextFP30OpaqueThreadTerminationProcPtrPv # GUSIContext::SetTerminator(OpaqueThreadTerminationProcPtr*,void*) GUSISetThreadTerminator ! SetSwitchOut__11GUSIContextFP25OpaqueThreadSwitchProcPtrPv # GUSIContext::SetSwitchOut(OpaqueThreadSwitchProcPtr*,void*) ! SetSwitchIn__11GUSIContextFP25OpaqueThreadSwitchProcPtrPv # GUSIContext::SetSwitchIn(OpaqueThreadSwitchProcPtr*,void*) GUSISetThreadSwitcher CreateContext__18GUSIContextFactoryFUl # GUSIContextFactory::CreateContext(unsigned long) ! CreateContext__18GUSIContextFactoryFP24OpaqueThreadEntryProcPtrPvlUlPPvPUl # GUSIContextFactory::CreateContext(OpaqueThreadEntryProcPtr*,void*,long,unsigned long,void**,unsigned long*) __dt__18GUSIContextFactoryFv # GUSIContextFactory::~GUSIContextFactory() __ct__18GUSIContextFactoryFv # GUSIContextFactory::GUSIContextFactory() ! DeleteInstance__18GUSIContextFactoryFv # GUSIContextFactory::DeleteInstance() SetInstance__18GUSIContextFactoryFP18GUSIContextFactory # GUSIContextFactory::SetInstance(GUSIContextFactory*) Instance__18GUSIContextFactoryFv # GUSIContextFactory::Instance() + GUSISetupContextFactory GUSINewThread Wakeup__11GUSIProcessFv # GUSIProcess::Wakeup() *************** *** 1191,1195 **** __dt__11GUSIContextFv # GUSIContext::~GUSIContext() Lookup__11GUSIContextFUl # GUSIContext::Lookup(unsigned long) ! __ct__11GUSIContextFPFPv_PvPvlUlPPvPUl # GUSIContext::GUSIContext(void* (*)(void*),void*,long,unsigned long,void**,unsigned long*) __ct__11GUSIContextFUl # GUSIContext::GUSIContext(unsigned long) FinishSetup__11GUSIContextFv # GUSIContext::FinishSetup() --- 1194,1198 ---- __dt__11GUSIContextFv # GUSIContext::~GUSIContext() Lookup__11GUSIContextFUl # GUSIContext::Lookup(unsigned long) ! __ct__11GUSIContextFP24OpaqueThreadEntryProcPtrPvlUlPPvPUl # GUSIContext::GUSIContext(OpaqueThreadEntryProcPtr*,void*,long,unsigned long,void**,unsigned long*) __ct__11GUSIContextFUl # GUSIContext::GUSIContext(unsigned long) FinishSetup__11GUSIContextFv # GUSIContext::FinishSetup() *************** *** 1232,1235 **** --- 1235,1241 ---- SetInstance__19GUSIDescriptorTableFP19GUSIDescriptorTable # GUSIDescriptorTable::SetInstance(GUSIDescriptorTable*) Instance__19GUSIDescriptorTableFv # GUSIDescriptorTable::Instance() + GUSISetupDescriptorTable + __ct__10GUSIDeviceFv # GUSIDevice::GUSIDevice() + __ct__14GUSINullDeviceFv # GUSINullDevice::GUSINullDevice() Instance__14GUSINullDeviceFv # GUSINullDevice::Instance() GUSIDefaultSetupConsole *************** *** 1361,1364 **** --- 1367,1371 ---- CScratch__12GUSIFileSpecFb # GUSIFileSpec::CScratch(bool) ReadHex__FPCciPc # ReadHex(const char*,int,char*) + GUSIFSXGetVolInfo__FP31GUSIIOPBWrapper<12XVolumeParam> # GUSIFSXGetVolInfo(GUSIIOPBWrapper*) GUSIFSMoveRename GUSIFSCatMove *************** *** 1522,1526 **** __vt__13GUSIScatterer # GUSIScatterer::__vt get__40GUSISpecificDataFP17GUSISpecificTable # GUSISpecificData::get(GUSISpecificTable*) ! faccess__FPCcPUiPv # faccess(const char*,unsigned int*,void*) fsetfileinfo fgetfileinfo --- 1529,1533 ---- __vt__13GUSIScatterer # GUSIScatterer::__vt get__40GUSISpecificDataFP17GUSISpecificTable # GUSISpecificData::get(GUSISpecificTable*) ! faccess fsetfileinfo fgetfileinfo *************** *** 1812,1815 **** --- 1819,1823 ---- setsockopt__12GUSIOTSocketFiiPvUi # GUSIOTSocket::setsockopt(int,int,void*,unsigned int) getsockopt__12GUSIOTSocketFiiPvPUi # GUSIOTSocket::getsockopt(int,int,void*,unsigned int*) + pre_select__12GUSIOTSocketFbbb # GUSIOTSocket::pre_select(bool,bool,bool) ioctl__12GUSIOTSocketFUiPc # GUSIOTSocket::ioctl(unsigned int,char*) fcntl__12GUSIOTSocketFiPc # GUSIOTSocket::fcntl(int,char*) *************** *** 2224,2227 **** --- 2232,2236 ---- _fcreator _chmod + _fdopen __gettype __getcreator From jackjansen@users.sourceforge.net Sun Nov 18 02:03:24 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 17 Nov 2001 18:03:24 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macmodule.c,1.48,1.48.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv3561/Python/Mac/Modules Modified Files: Tag: r22b2-branch macmodule.c Log Message: For obscure historical reasons mac.error was not the same as OSError. Fixed. Index: macmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macmodule.c,v retrieving revision 1.48 retrieving revision 1.48.2.1 diff -C2 -d -r1.48 -r1.48.2.1 *** macmodule.c 2001/11/06 12:10:05 1.48 --- macmodule.c 2001/11/18 02:03:22 1.48.2.1 *************** *** 115,120 **** - static PyObject *MacError; /* Exception mac.error */ - /* Set a MAC-specific error from errno, and return NULL */ --- 115,118 ---- *************** *** 122,126 **** mac_error() { ! return PyErr_SetFromErrno(MacError); } --- 120,124 ---- mac_error() { ! return PyErr_SetFromErrno(PyExc_OSError); } *************** *** 296,301 **** Py_END_ALLOW_THREADS if (res == NULL) { ! PyErr_SetString(MacError, path); ! return NULL; } return PyString_FromString(res); --- 294,298 ---- Py_END_ALLOW_THREADS if (res == NULL) { ! return mac_error(); } return PyString_FromString(res); *************** *** 840,845 **** /* Initialize mac.error exception */ ! MacError = PyErr_NewException("mac.error", NULL, NULL); ! PyDict_SetItemString(d, "error", MacError); PyStructSequence_InitType(&StatResultType, &stat_result_desc); --- 837,841 ---- /* Initialize mac.error exception */ ! PyDict_SetItemString(d, "error", PyExc_OSError); PyStructSequence_InitType(&StatResultType, &stat_result_desc); From jackjansen@users.sourceforge.net Sun Nov 18 02:04:39 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 17 Nov 2001 18:04:39 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects fileobject.c,2.139,2.139.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv3742/Python/Objects Modified Files: Tag: r22b2-branch fileobject.c Log Message: Make the mwerks-specific error in case of a failing fopen() use a 0 as the errno parameter, so we pass test_file. Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.139 retrieving revision 2.139.2.1 diff -C2 -d -r2.139 -r2.139.2.1 *** fileobject.c 2001/11/09 20:59:14 2.139 --- fileobject.c 2001/11/18 02:04:37 2.139.2.1 *************** *** 122,128 **** if (f->f_fp == NULL) { #ifdef NO_FOPEN_ERRNO ! /* Metroworks only, not testable, so unchanged */ if (errno == 0) { ! PyErr_SetString(PyExc_IOError, "Cannot open file"); return NULL; } --- 122,133 ---- if (f->f_fp == NULL) { #ifdef NO_FOPEN_ERRNO ! /* Metroworks only, wich does not always sets errno */ if (errno == 0) { ! PyObject *v; ! v = Py_BuildValue("(is)", 0, "Cannot open file"); ! if (v != NULL) { ! PyErr_SetObject(PyExc_IOError, v); ! Py_DECREF(v); ! } return NULL; } From jackjansen@users.sourceforge.net Sun Nov 18 02:05:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 17 Nov 2001 18:05:36 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Python macglue.c,1.107,1.107.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv3916/Python/Mac/Python Modified Files: Tag: r22b2-branch macglue.c Log Message: Removed debug output and fixed silly compile error in classic. Index: macglue.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macglue.c,v retrieving revision 1.107 retrieving revision 1.107.2.1 diff -C2 -d -r1.107 -r1.107.2.1 *** macglue.c 2001/11/10 00:41:43 1.107 --- macglue.c 2001/11/18 02:05:34 1.107.2.1 *************** *** 506,511 **** (char)q->evtQMessage == '.' && (q->evtQModifiers & cmdKey) != 0) { ! if ( flush ) ! FlushEvents(keyDownMask, 0); interrupted = 1; break; --- 506,510 ---- (char)q->evtQMessage == '.' && (q->evtQModifiers & cmdKey) != 0) { ! FlushEvents(keyDownMask, 0); interrupted = 1; break; *************** *** 518,523 **** PyErr_CheckSignals() { - int xxx, xxx_old; - if (schedparams.enabled) { if ( interrupted || (unsigned long)LMGetTicks() > schedparams.next_check ) { --- 517,520 ---- *************** *** 530,535 **** if ( PyMac_Yield() < 0) return -1; - xxx = LMGetTicks(); - xxx_old = schedparams.next_check; schedparams.next_check = (unsigned long)LMGetTicks() + schedparams.check_interval; --- 527,530 ---- From jackjansen@users.sourceforge.net Sun Nov 18 02:06:00 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Sat, 17 Nov 2001 18:06:00 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build _dummy_tkinter.mcp,1.4,1.4.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv3966/Python/Mac/Build Modified Files: Tag: r22b2-branch _dummy_tkinter.mcp Log Message: Use new unified GUSI. Index: _dummy_tkinter.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/_dummy_tkinter.mcp,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -C2 -d -r1.4 -r1.4.8.1 Binary files /tmp/cvsJC4RHm and /tmp/cvssAeh9y differ From fdrake@users.sourceforge.net Sun Nov 18 02:36:10 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Sat, 17 Nov 2001 18:36:10 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules pyexpat.c,2.54,2.55 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv8291 Modified Files: pyexpat.c Log Message: assert.h was not always included by Python.h; make sure we import it for older versions. (Thanks to Martijn Faassen.) Index: pyexpat.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pyexpat.c,v retrieving revision 2.54 retrieving revision 2.55 diff -C2 -d -r2.54 -r2.55 *** pyexpat.c 2001/11/10 13:59:16 2.54 --- pyexpat.c 2001/11/18 02:36:07 2.55 *************** *** 1,3 **** --- 1,6 ---- #include "Python.h" + #if PY_VERSION_HEX < 0x020000B1 + #include + #endif #include From tim_one@users.sourceforge.net Sun Nov 18 04:06:32 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 17 Nov 2001 20:06:32 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python import.c,2.191,2.192 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv21711/python/Python Modified Files: import.c Log Message: Since the MAGIC number scheme is going to break on January 1st, document what it is more carefully and point out some of the subtleties. Index: import.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/import.c,v retrieving revision 2.191 retrieving revision 2.192 diff -C2 -d -r2.191 -r2.192 *** import.c 2001/10/30 13:08:39 2.191 --- import.c 2001/11/18 04:06:29 2.192 *************** *** 31,38 **** /* The value of CR and LF is incorporated so if you ever read or write a .pyc file in text mode the magic number will be wrong; also, the ! Apple MPW compiler swaps their values, botching string constants */ /* XXX Perhaps the magic number should be frozen and a version field 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)) --- 31,50 ---- /* The value of CR and LF is incorporated so if you ever read or write a .pyc file in text mode the magic number will be wrong; also, the ! Apple MPW compiler swaps their values, botching string constants. ! XXX That probably isn't important anymore. ! */ /* XXX Perhaps the magic number should be frozen and a version field added to the .pyc file header? */ ! /* New way to come up with the low 16 bits of the magic number: ! (YEAR-1995) * 10000 + MONTH * 100 + DAY ! where MONTH and DAY are 1-based. ! XXX Whatever the "old way" may have been isn't documented. ! XXX This scheme breaks in 2002, as (2002-1995)*10000 = 70000 doesn't ! fit in 16 bits. ! XXX Later, sometimes 1 gets added to MAGIC in order to record that ! the Unicode -U option is in use. IMO (Tim's), that's a Bad Idea ! (quite apart from that the -U option doesn't work so isn't used ! anyway). ! */ #define MAGIC (60717 | ((long)'\r'<<16) | ((long)'\n'<<24)) *************** *** 64,68 **** #ifdef MS_WIN32 {".pyw", "r", PY_SOURCE}, ! #endif {".pyc", "rb", PY_COMPILED}, {0, 0} --- 76,80 ---- #ifdef MS_WIN32 {".pyw", "r", PY_SOURCE}, ! #endif {".pyc", "rb", PY_COMPILED}, {0, 0} *************** *** 740,744 **** } #endif ! cpathname = make_compiled_pathname(pathname, buf, (size_t)MAXPATHLEN + 1); if (cpathname != NULL && --- 752,756 ---- } #endif ! cpathname = make_compiled_pathname(pathname, buf, (size_t)MAXPATHLEN + 1); if (cpathname != NULL && From tim_one@users.sourceforge.net Sun Nov 18 04:51:19 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sat, 17 Nov 2001 20:51:19 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libgc.tex,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv27414/python/Doc/lib Modified Files: libgc.tex Log Message: Relatively large expansion of the docs for gc.garbage. Index: libgc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libgc.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** libgc.tex 2001/11/03 19:57:21 1.6 --- libgc.tex 2001/11/18 04:51:17 1.7 *************** *** 80,84 **** ! The following variable is provided for read-only access: \begin{datadesc}{garbage} --- 80,85 ---- ! The following variable is provided for read-only access (you can ! mutate its value but should not rebind it): \begin{datadesc}{garbage} *************** *** 89,95 **** cycles, not only those with \method{__del__()} methods.} Objects that have ! \method{__del__()} methods and create part of a reference cycle cause ! the entire reference cycle to be uncollectable. If ! \constant{DEBUG_SAVEALL} is set, then all unreachable objects will be added to this list rather than freed. \end{datadesc} --- 90,109 ---- cycles, not only those with \method{__del__()} methods.} Objects that have ! \method{__del__()} methods and are part of a reference cycle cause ! the entire reference cycle to be uncollectable, including objects ! not necessarily in the cycle but reachable only from it. Python doesn't ! collect such cycles automatically because, in general, it isn't possible ! for Python to guess a safe order in which to run the \method{__del__()} ! methods. If you know a safe order, you can force the issue by examining ! the \var{garbage} list, and explicitly breaking cycles due to your ! objects within the list. Note that these objects are kept alive even ! so by virtue of being in the \var{garbage} list, so they should be ! removed from \var{garbage} too. For example, after breaking cycles, do ! \code{del gc.garbage[:]} to empty the list. It's generally better ! to avoid the issue by not creating cycles containing objects with ! \method{__del__()} methods, and \var{garbage} can be examined in that ! case to verify that no such are being created. ! ! If \constant{DEBUG_SAVEALL} is set, then all unreachable objects will be added to this list rather than freed. \end{datadesc} *************** *** 133,136 **** The debugging flags necessary for the collector to print information about a leaking program (equal to \code{DEBUG_COLLECTABLE | ! DEBUG_UNCOLLECTABLE | DEBUG_INSTANCES | DEBUG_OBJECTS | DEBUG_SAVEALL}). \end{datadesc} --- 147,150 ---- The debugging flags necessary for the collector to print information about a leaking program (equal to \code{DEBUG_COLLECTABLE | ! DEBUG_UNCOLLECTABLE | DEBUG_INSTANCES | DEBUG_OBJECTS | DEBUG_SAVEALL}). \end{datadesc} From fdrake@users.sourceforge.net Sun Nov 18 04:58:30 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Sat, 17 Nov 2001 20:58:30 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib xmlsaxhandler.tex,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv28291/lib Modified Files: xmlsaxhandler.tex Log Message: Clarified a couple of issues for the startElement*() handlers: - the attrs value may be re-used by the parser, so the implementation cannot rely on owning the object. - an element with no namespace encountered in namespace mode will have a URI of None, not "" (startElementNS() only). Fixed a couple of minor markup issues as well. Index: xmlsaxhandler.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/xmlsaxhandler.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** xmlsaxhandler.tex 2001/11/06 22:13:19 1.6 --- xmlsaxhandler.tex 2001/11/18 04:58:28 1.7 *************** *** 201,207 **** properly nested relative to each-other: all \method{startPrefixMapping()} events will occur before the ! corresponding startElement event, and all \method{endPrefixMapping()} ! events will occur after the corresponding \method{endElement()} event, ! but their order is not guaranteed. \end{methoddesc} --- 201,208 ---- properly nested relative to each-other: all \method{startPrefixMapping()} events will occur before the ! corresponding \method{startElement()} event, and all ! \method{endPrefixMapping()} events will occur after the ! corresponding \method{endElement()} event, but their order is not ! guaranteed. \end{methoddesc} *************** *** 220,224 **** element type as a string and the \var{attrs} parameter holds an instance of the \class{Attributes} class containing the attributes ! of the element. \end{methoddesc} --- 221,228 ---- element type as a string and the \var{attrs} parameter holds an instance of the \class{Attributes} class containing the attributes ! of the element. The object passed as \var{attrs} may be re-used by ! the parser; holding on to a reference to it is not a reliable way to ! keep a copy of the attributes. To keep a copy of the attributes, ! use the \method{copy()} method of the \var{attrs} object. \end{methoddesc} *************** *** 234,241 **** The \var{name} parameter contains the name of the element type as a ! (uri, localname) tuple, the \var{qname} parameter the raw XML 1.0 ! name used in the source document, and the \var{attrs} parameter ! holds an instance of the \class{AttributesNS} class containing the ! attributes of the element. Parsers may set the \var{qname} parameter to \code{None}, unless the --- 238,251 ---- The \var{name} parameter contains the name of the element type as a ! \code{(\var{uri}, \var{localname})} tuple, the \var{qname} parameter ! contains the raw XML 1.0 name used in the source document, and the ! \var{attrs} parameter holds an instance of the \class{AttributesNS} ! class containing the attributes of the element. If no namespace is ! associated with the element, the \var{uri} component of \var{name} ! will be \code{None}. The object passed as \var{attrs} may be ! re-used by the parser; holding on to a reference to it is not a ! reliable way to keep a copy of the attributes. To keep a copy of ! the attributes, use the \method{copy()} method of the \var{attrs} ! object. Parsers may set the \var{qname} parameter to \code{None}, unless the From jvr@users.sourceforge.net Sun Nov 18 14:12:46 2001 From: jvr@users.sourceforge.net (Just van Rossum) Date: Sun, 18 Nov 2001 06:12:46 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PyBrowser.py,1.11,1.12 PyDebugger.py,1.7,1.8 PyEdit.py,1.25,1.26 W.py,1.3,1.4 Wapplication.py,1.13,1.14 Wbase.py,1.7,1.8 Wcontrols.py,1.10,1.11 Widgets.rsrc,1.1,1.2 Wlists.py,1.7,1.8 Wtext.py,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv14578 Modified Files: PyBrowser.py PyDebugger.py PyEdit.py W.py Wapplication.py Wbase.py Wcontrols.py Widgets.rsrc Wlists.py Wtext.py Log Message: a whole bunch of OSX tweaks Index: PyBrowser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyBrowser.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** PyBrowser.py 2001/11/02 19:21:34 1.11 --- PyBrowser.py 2001/11/18 14:12:43 1.12 *************** *** 144,147 **** --- 144,148 ---- #W.SetCursor('fist') while Evt.Button(): + Evt.WaitNextEvent(0, 1, None) # needed for OSX (x, y) = Evt.GetMouse() if (x, y) <> lastpoint: *************** *** 308,312 **** self.w = w = W.Window((300, 400), title, minsize = (100, 100)) w.info = W.TextBox((18, 8, -70, 15)) ! w.updatebutton = W.Button((-64, 4, 50, 16), 'Update', self.update) w.browser = BrowserWidget((-1, 24, 1, -14), None) w.bind('cmdu', w.updatebutton.push) --- 309,313 ---- self.w = w = W.Window((300, 400), title, minsize = (100, 100)) w.info = W.TextBox((18, 8, -70, 15)) ! w.updatebutton = W.BevelButton((-64, 4, 50, 16), 'Update', self.update) w.browser = BrowserWidget((-1, 24, 1, -14), None) w.bind('cmdu', w.updatebutton.push) Index: PyDebugger.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyDebugger.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyDebugger.py 2001/08/25 12:09:39 1.7 --- PyDebugger.py 2001/11/18 14:12:43 1.8 *************** *** 682,686 **** def __init__(self, debugger): self.debugger = debugger - import Lists self.w = W.Window((300, 250), 'Breakpoints', minsize = (200, 200)) self.w.panes = W.HorizontalPanes((8, 8, -8, -32), (0.3, 0.7)) --- 682,685 ---- Index: PyEdit.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyEdit.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** PyEdit.py 2001/11/02 22:55:15 1.25 --- PyEdit.py 2001/11/18 14:12:43 1.26 *************** *** 175,179 **** def setupwidgets(self, text): ! topbarheight = 28 popfieldwidth = 80 self.lastlineno = None --- 175,179 ---- def setupwidgets(self, text): ! topbarheight = 24 popfieldwidth = 80 self.lastlineno = None *************** *** 198,204 **** self.bevelbox = W.BevelBox((0, 0, 0, topbarheight)) self.hline = W.HorizontalLine((0, topbarheight, 0, 0)) ! self.infotext = W.TextBox((175, 7, -4, 14), backgroundcolor = (0xe000, 0xe000, 0xe000)) ! self.runbutton = W.Button((6, 5, 60, 16), runButtonLabels[0], self.run) ! self.runselbutton = W.Button((78, 5, 90, 16), runSelButtonLabels[0], self.runselection) # bind some keys --- 198,204 ---- self.bevelbox = W.BevelBox((0, 0, 0, topbarheight)) self.hline = W.HorizontalLine((0, topbarheight, 0, 0)) ! self.infotext = W.TextBox((175, 6, -4, 14), backgroundcolor = (0xe000, 0xe000, 0xe000)) ! self.runbutton = W.BevelButton((6, 4, 80, 16), runButtonLabels[0], self.run) ! self.runselbutton = W.BevelButton((90, 4, 80, 16), runSelButtonLabels[0], self.runselection) # bind some keys *************** *** 801,804 **** --- 801,805 ---- pattern = pattern + notwordcharspat return re.compile(pattern) + class SearchEngine: Index: W.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/W.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** W.py 2001/11/02 19:22:55 1.3 --- W.py 2001/11/18 14:12:43 1.4 *************** *** 32,36 **** def Message(text): ! import EasyDialogs, Qd, string Qd.InitCursor() text = string.replace(text, "\n", "\r") --- 32,37 ---- def Message(text): ! import EasyDialogs, string ! from Carbon import Qd Qd.InitCursor() text = string.replace(text, "\n", "\r") Index: Wapplication.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wapplication.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Wapplication.py 2001/08/27 10:55:41 1.13 --- Wapplication.py 2001/11/18 14:12:43 1.14 *************** *** 10,14 **** from Carbon import Menu; MenuToolbox = Menu; del Menu ! KILLUNKNOWNWINDOWS=1 # Set to 0 for debugging. class Application(FrameWork.Application): --- 10,14 ---- from Carbon import Menu; MenuToolbox = Menu; del Menu ! KILLUNKNOWNWINDOWS = 0 # Set to 0 for debugging. class Application(FrameWork.Application): Index: Wbase.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wbase.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Wbase.py 2001/11/02 19:09:34 1.7 --- Wbase.py 2001/11/18 14:12:43 1.8 *************** *** 1,3 **** ! from Carbon import Evt, Qd, QuickDraw, Win import string from types import * --- 1,3 ---- ! from Carbon import App, Evt, Qd, QuickDraw, Win import string from types import * *************** *** 330,342 **** if not self._parentwindow._hasselframes: return ! thickrect = Qd.InsetRect(self._bounds, -3, -3) ! state = Qd.GetPenState() ! Qd.PenSize(2, 2) ! if onoff: ! Qd.PenPat(Qd.qd.black) ! else: ! Qd.PenPat(Qd.qd.white) ! Qd.FrameRect(thickrect) ! Qd.SetPenState(state) def adjust(self, oldbounds): --- 330,334 ---- if not self._parentwindow._hasselframes: return ! App.DrawThemeFocusRect(self._bounds, onoff) def adjust(self, oldbounds): Index: Wcontrols.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wcontrols.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Wcontrols.py 2001/11/02 22:51:42 1.10 --- Wcontrols.py 2001/11/18 14:12:43 1.11 *************** *** 18,21 **** --- 18,22 ---- self._max = max self._enabled = 1 + self._viewsize = 0 def open(self): *************** *** 30,35 **** self._procID, 0) ! self.SetPort() ! #self.GetWindow().ValidWindowRect(self._bounds) self.enable(self._enabled) --- 31,36 ---- self._procID, 0) ! if self._viewsize: ! self._control.SetControlViewSize(self._viewsize) self.enable(self._enabled) *************** *** 76,82 **** def test(self, point): ! ctltype, control = Ctl.FindControl(point, self._parentwindow.wid) ! if self._enabled and control == self._control: return 1 def click(self, point, modifiers): --- 77,85 ---- def test(self, point): ! if Qd.PtInRect(point, self._bounds) and self._enabled: return 1 + #ctltype, control = Ctl.FindControl(point, self._parentwindow.wid) + #if self._enabled and control == self._control: + # return 1 def click(self, point, modifiers): *************** *** 113,119 **** """Standard push button.""" def __init__(self, possize, title = "Button", callback = None): ! procID = Controls.pushButProc | Controls.useWFont ! ControlWidget.__init__(self, possize, title, procID, callback, 0, 0, 1) self._isdefault = 0 --- 116,123 ---- """Standard push button.""" + procID = Controls.pushButProc | Controls.useWFont + def __init__(self, possize, title = "Button", callback = None): ! ControlWidget.__init__(self, possize, title, self.procID, callback, 0, 0, 1) self._isdefault = 0 *************** *** 121,126 **** --- 125,132 ---- if not self._enabled: return + # emulate the pushing of the button import time self._control.HiliteControl(Controls.kControlButtonPart) + Qd.QDFlushPortBuffer(self._parentwindow.wid, None) # needed under OSX time.sleep(0.1) self._control.HiliteControl(0) *************** *** 140,144 **** --- 146,168 ---- self._control.Draw1Control() + def open(self): + ControlWidget.open(self) + if self._isdefault: + self._setdefault(self._isdefault) + def _setdefault(self, onoff): + c = self._control + if c is not None: + if onoff: + data = "\xFF" + else: + data = "\0" + # hide before changing state, otherwise the button isn't always + # redrawn correctly, although it's quite different under Aqua + # and Classic... + c.HideControl() + c.SetControlData(Controls.kControlNoPart, + Controls.kControlPushButtonDefaultTag, data) + c.ShowControl() self._isdefault = onoff *************** *** 153,156 **** --- 177,184 ---- + class BevelButton(Button): + procID = Controls.kControlBevelButtonNormalBevelProc | Controls.useWFont + + class CheckBox(ControlWidget): *************** *** 251,261 **** def setmin(self, min): ! self._control.SetControl32BitMinimum(min) def setmax(self, max): ! self._control.SetControl32BitMaximum(max) ! def setviewsize(self, view): ! self._control.SetControlViewSize(view) def getmin(self): --- 279,298 ---- def setmin(self, min): ! if self._control is not None: ! self._control.SetControl32BitMinimum(min) ! else: ! self._min = min def setmax(self, max): ! if self._control is not None: ! self._control.SetControl32BitMaximum(max) ! else: ! self._max = max ! def setviewsize(self, viewsize): ! if self._control is not None: ! self._control.SetControlViewSize(viewsize) ! else: ! self._viewsize = viewsize def getmin(self): *************** *** 313,317 **** if self._visible: self._control.Draw1Control() ! Qd.FrameRect(self._bounds) def adjust(self, oldbounds): --- 350,354 ---- if self._visible: self._control.Draw1Control() ! #Qd.FrameRect(self._bounds) def adjust(self, oldbounds): Index: Widgets.rsrc =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Widgets.rsrc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsDCwtci and /tmp/cvsgmxi2p differ Index: Wlists.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wlists.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Wlists.py 2001/11/05 08:51:24 1.7 --- Wlists.py 2001/11/18 14:12:43 1.8 *************** *** 6,9 **** --- 6,11 ---- from Carbon.Lists import kListDefUserProcType, lInitMsg, lDrawMsg, lHiliteMsg, lCloseMsg from Carbon.QuickDraw import hilitetransfermode + from Carbon import App + from Carbon.Appearance import kThemeStateActive, kThemeStateInactive, kThemeStatePressed *************** *** 254,260 **** visRgn = self._parentwindow.wid.GetWindowPort().visRgn self._list.LUpdate(visRgn) ! Qd.FrameRect(self._bounds) ! if self._selected and self._activated: ! self.drawselframe(1) def select(self, onoff, isclick = 0): --- 256,262 ---- visRgn = self._parentwindow.wid.GetWindowPort().visRgn self._list.LUpdate(visRgn) ! App.DrawThemeListBoxFrame(self._bounds, kThemeStateActive) ! #if self._selected and self._activated: ! # self.drawselframe(1) def select(self, onoff, isclick = 0): *************** *** 262,266 **** return self.SetPort() ! self.drawselframe(onoff) def activate(self, onoff): --- 264,270 ---- return self.SetPort() ! state = [kThemeStateActive, kThemeStatePressed][onoff] ! App.DrawThemeListBoxFrame(self._bounds, kThemeStateActive) ! #self.drawselframe(onoff) def activate(self, onoff): *************** *** 268,273 **** if self._visible: self._list.LActivate(onoff) ! if self._selected: ! self.drawselframe(onoff) def get(self): --- 272,277 ---- if self._visible: self._list.LActivate(onoff) ! #if self._selected: ! # self.drawselframe(onoff) def get(self): *************** *** 450,453 **** --- 454,458 ---- Qd.DrawText(line2, 0, len(line2)) Qd.PenPat("\x11\x11\x11\x11\x11\x11\x11\x11") + bottom = top + theList.cellSize[1] Qd.MoveTo(left, bottom - 1) Qd.LineTo(right, bottom - 1) Index: Wtext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wtext.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Wtext.py 2001/11/02 19:24:41 1.14 --- Wtext.py 2001/11/18 14:12:43 1.15 *************** *** 2,5 **** --- 2,7 ---- from Carbon import Qd, Res, Scrap from Carbon import TE, TextEdit, Win + from Carbon import App + from Carbon.Appearance import kThemeStateActive, kThemeStateInactive import waste import WASTEconst *************** *** 56,78 **** # to be overridden ! def getscrollbarvalues(self): return None, None # internal method def updatescrollbars(self): ! vx, vy = self.getscrollbarvalues() if self._parent._barx: ! if vx <> None: ! self._parent._barx.enable(1) ! self._parent._barx.set(vx) ! else: ! self._parent._barx.enable(0) if self._parent._bary: ! if vy <> None: ! self._parent._bary.enable(1) ! self._parent._bary.set(vy) ! else: ! self._parent._bary.enable(0) ! UNDOLABELS = [ # Indexed by WEGetUndoInfo() value --- 58,84 ---- # to be overridden ! def getscrollrects(self): ! """Return (destrect, viewrect).""" return None, None # internal method + def updatescrollbars(self): ! (dl, dt, dr, db), (vl, vt, vr, vb) = self.getscrollrects() if self._parent._barx: ! viewwidth = vr - vl ! destwidth = dr - dl ! bar = self._parent._barx ! bar.setmax(destwidth - viewwidth) ! bar.setviewsize(viewwidth) ! bar.set(vl - dl) if self._parent._bary: ! viewheight = vb - vt ! destheight = db - dt ! bar = self._parent._bary ! bar.setmax(destheight - viewheight) ! bar.setviewsize(viewheight) ! bar.set(vt - dt) ! UNDOLABELS = [ # Indexed by WEGetUndoInfo() value *************** *** 374,377 **** --- 380,384 ---- self.drawselframe(1) Qd.FrameRect(self._bounds) + #App.DrawThemeEditTextFrame(self._bounds, kThemeStateActive) # scrolling *************** *** 386,396 **** def scrolltop(self): if self._parent._bary and self._parent._bary._enabled: ! self.vscroll(0) if self._parent._barx and self._parent._barx._enabled: ! self.hscroll(0) def scrollbottom(self): if self._parent._bary and self._parent._bary._enabled: ! self.vscroll(32767) # menu handlers --- 393,403 ---- def scrolltop(self): if self._parent._bary and self._parent._bary._enabled: ! self.vscroll(self._parent._bary.getmin()) if self._parent._barx and self._parent._barx._enabled: ! self.hscroll(self._parent._barx.getmin()) def scrollbottom(self): if self._parent._bary and self._parent._bary._enabled: ! self.vscroll(self._parent._bary.getmax()) # menu handlers *************** *** 470,479 **** # private ! def getscrollbarvalues(self): ! dr = self.ted.WEGetDestRect() ! vr = self.ted.WEGetViewRect() ! vx = Wcontrols._scalebarvalue(dr[0], dr[2], vr[0], vr[2]) ! vy = Wcontrols._scalebarvalue(dr[1], dr[3], vr[1], vr[3]) ! return vx, vy def vscroll(self, value): --- 477,482 ---- # private ! def getscrollrects(self): ! return self.ted.WEGetDestRect(), self.ted.WEGetViewRect() def vscroll(self, value): *************** *** 481,487 **** dr = self.ted.WEGetDestRect() vr = self.ted.WEGetViewRect() - destheight = dr[3] - dr[1] viewheight = vr[3] - vr[1] ! viewoffset = maxdelta = vr[1] - dr[1] mindelta = vr[3] - dr[3] if value == "+": --- 484,489 ---- dr = self.ted.WEGetDestRect() vr = self.ted.WEGetViewRect() viewheight = vr[3] - vr[1] ! maxdelta = vr[1] - dr[1] mindelta = vr[3] - dr[3] if value == "+": *************** *** 494,502 **** delta = lineheight - viewheight else: # in thumb ! cur = (32767L * viewoffset) / (destheight - viewheight) ! delta = (cur-value)*(destheight - viewheight)/32767 ! if abs(delta - viewoffset) <=2: ! # compensate for irritating rounding error ! delta = viewoffset delta = min(maxdelta, delta) delta = max(mindelta, delta) --- 496,500 ---- delta = lineheight - viewheight else: # in thumb ! delta = vr[1] - dr[1] - value delta = min(maxdelta, delta) delta = max(mindelta, delta) *************** *** 520,528 **** delta = 0.5 * (vr[0] - vr[2]) else: # in thumb ! cur = (32767 * viewoffset) / (destwidth - viewwidth) ! delta = (cur-value)*(destwidth - viewwidth)/32767 ! if abs(delta - viewoffset) <=2: ! # compensate for irritating rounding error ! delta = viewoffset delta = min(maxdelta, delta) delta = max(mindelta, delta) --- 518,527 ---- delta = 0.5 * (vr[0] - vr[2]) else: # in thumb ! delta = vr[0] - dr[0] - value ! #cur = (32767 * viewoffset) / (destwidth - viewwidth) ! #delta = (cur-value)*(destwidth - viewwidth)/32767 ! #if abs(delta - viewoffset) <=2: ! # # compensate for irritating rounding error ! # delta = viewoffset delta = min(maxdelta, delta) delta = max(mindelta, delta) *************** *** 924,927 **** --- 923,927 ---- self.ted.WEFeatureFlag(WASTEconst.weFAutoScroll, 0) self.ted.WESetSelection(count, count + 1) + Qd.QDFlushPortBuffer(self._parentwindow.wid, None) # needed under OSX time.sleep(0.2) self.ted.WESetSelection(selstart, selend) From bwarsaw@users.sourceforge.net Sun Nov 18 16:24:03 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Sun, 18 Nov 2001 08:24:03 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libpickle.tex,1.31,1.32 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv12688 Modified Files: libpickle.tex Log Message: Paul Rubin reminds me that of course a class's constructor /could/ get called, if the pickler found a __getinitargs__() method. Index: libpickle.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpickle.tex,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** libpickle.tex 2001/11/15 23:39:07 1.31 --- libpickle.tex 2001/11/18 16:24:01 1.32 *************** *** 605,612 **** For safely unpickling class instances, you need to control exactly ! which classes will get created. The issue here is usually not that a ! class's constructor will get called --- it won't by the unpickler --- ! but that the class's destructor (i.e. its \method{__del__()} method) ! might get called when the object is garbage collected. The way to control the classes that are safe to instantiate differs in \module{pickle} and \module{cPickle}\footnote{A word of caution: the --- 605,614 ---- For safely unpickling class instances, you need to control exactly ! which classes will get created. Be aware that a class's constructor ! could be called (if the pickler found a \method{__getinitargs__()} ! method) and the the class's destructor (i.e. its \method{__del__()} method) ! might get called when the object is garbage collected. Depending on ! the class, it isn't very heard to trick either method into doing bad ! things, such as removing a file. The way to control the classes that are safe to instantiate differs in \module{pickle} and \module{cPickle}\footnote{A word of caution: the From bwarsaw@users.sourceforge.net Sun Nov 18 23:16:00 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Sun, 18 Nov 2001 15:16:00 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_email.py,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv2567 Modified Files: test_email.py Log Message: test_formatdate(): A test that has a mild hope of working on Mac, which has a different epoch than *nix. Jack may need to twiddle the details. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** test_email.py 2001/11/13 18:01:37 1.18 --- test_email.py 2001/11/18 23:15:58 1.19 *************** *** 922,928 **** def test_formatdate(self): now = 1005327232.109884 gdate = Utils.formatdate(now) ldate = Utils.formatdate(now, localtime=1) ! self.assertEqual(gdate, 'Fri, 09 Nov 2001 17:33:52 -0000') # It's a little tougher to test for localtime, but we'll try. Skip if # we don't have strptime(). --- 922,938 ---- def test_formatdate(self): now = 1005327232.109884 + time0 = time.ctime(0) + # When does the epoch start? + if time0 == 'Wed Dec 31 19:00:00 1969': + # traditional Unix epoch + matchdate = 'Fri, 09 Nov 2001 17:33:52 -0000' + elif time0 == 'Fri Jan 1 00:00:00 1904': + # Mac epoch + matchdate = 'Sat, 09 Nov 1935 16:33:52 -0000' + else: + matchdate = "I don't understand your epoch" gdate = Utils.formatdate(now) ldate = Utils.formatdate(now, localtime=1) ! self.assertEqual(gdate, matchdate) # It's a little tougher to test for localtime, but we'll try. Skip if # we don't have strptime(). From fdrake@users.sourceforge.net Mon Nov 19 04:34:52 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Sun, 18 Nov 2001 20:34:52 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib xmlsaxhandler.tex,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv11019/lib Modified Files: xmlsaxhandler.tex Log Message: Fix the default value for feature_namespaces, per discussions on the XML-SIG mailing list. This causes the docs to match the default implementation. Index: xmlsaxhandler.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/xmlsaxhandler.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** xmlsaxhandler.tex 2001/11/18 04:58:28 1.7 --- xmlsaxhandler.tex 2001/11/19 04:34:50 1.8 *************** *** 50,56 **** \begin{datadesc}{feature_namespaces} Value: \code{"http://xml.org/sax/features/namespaces"}\\ ! true: Perform Namespace processing (default).\\ false: Optionally do not perform Namespace processing ! (implies namespace-prefixes).\\ access: (parsing) read-only; (not parsing) read/write \end{datadesc} --- 50,56 ---- \begin{datadesc}{feature_namespaces} Value: \code{"http://xml.org/sax/features/namespaces"}\\ ! true: Perform Namespace processing.\\ false: Optionally do not perform Namespace processing ! (implies namespace-prefixes; default).\\ access: (parsing) read-only; (not parsing) read/write \end{datadesc} From fdrake@users.sourceforge.net Mon Nov 19 04:36:00 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Sun, 18 Nov 2001 20:36:00 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc ACKS,1.29,1.30 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv11352 Modified Files: ACKS Log Message: Another name... Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ACKS,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** ACKS 2001/11/15 17:26:10 1.29 --- ACKS 2001/11/19 04:35:58 1.30 *************** *** 61,64 **** --- 61,65 ---- Nadim Ghaznavi Jonathan Giddy + Shelley Gooch Nathaniel Gray Grant Griffin From fdrake@users.sourceforge.net Mon Nov 19 05:16:37 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Sun, 18 Nov 2001 21:16:37 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libcgihttp.tex,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv20419/lib Modified Files: libcgihttp.tex Log Message: Update the platform notes for the CGIHTTPServer module; it works on more platforms now, and has since Python 2.0. This closes SF bug #482943. Index: libcgihttp.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcgihttp.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** libcgihttp.tex 2001/10/20 04:24:09 1.6 --- libcgihttp.tex 2001/11/19 05:16:35 1.7 *************** *** 4,8 **** \declaremodule{standard}{CGIHTTPServer} - \platform{Unix} \sectionauthor{Moshe Zadka}{moshez@zadka.site.co.il} \modulesynopsis{This module provides a request handler for HTTP servers --- 4,7 ---- *************** *** 16,21 **** run CGI scripts. ! \note{This module is \UNIX{} dependent since it creates the ! CGI process using \function{os.fork()} and \function{os.exec()}.} The \module{CGIHTTPServer} module defines the following class: --- 15,21 ---- run CGI scripts. ! \note{This module can run CGI scripts on \UNIX{} and Windows systems; ! on Mac OS it will only be able to run Python scripts within the same ! process as itself.} The \module{CGIHTTPServer} module defines the following class: From fdrake@users.sourceforge.net Mon Nov 19 05:17:02 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Sun, 18 Nov 2001 21:17:02 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libcgihttp.tex,1.6,1.6.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv20486/lib Modified Files: Tag: r22b2-branch libcgihttp.tex Log Message: Update the platform notes for the CGIHTTPServer module; it works on more platforms now, and has since Python 2.0. This closes SF bug #482943. Index: libcgihttp.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcgihttp.tex,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -C2 -d -r1.6 -r1.6.2.1 *** libcgihttp.tex 2001/10/20 04:24:09 1.6 --- libcgihttp.tex 2001/11/19 05:17:00 1.6.2.1 *************** *** 4,8 **** \declaremodule{standard}{CGIHTTPServer} - \platform{Unix} \sectionauthor{Moshe Zadka}{moshez@zadka.site.co.il} \modulesynopsis{This module provides a request handler for HTTP servers --- 4,7 ---- *************** *** 16,21 **** run CGI scripts. ! \note{This module is \UNIX{} dependent since it creates the ! CGI process using \function{os.fork()} and \function{os.exec()}.} The \module{CGIHTTPServer} module defines the following class: --- 15,21 ---- run CGI scripts. ! \note{This module can run CGI scripts on \UNIX{} and Windows systems; ! on Mac OS it will only be able to run Python scripts within the same ! process as itself.} The \module{CGIHTTPServer} module defines the following class: From fdrake@acm.org Mon Nov 19 06:13:01 2001 From: fdrake@acm.org (Fred L. Drake, Jr.) Date: Mon, 19 Nov 2001 01:13:01 -0500 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libcgihttp.tex,1.6,1.6.2.1 In-Reply-To: References: Message-ID: <15352.41709.842057.424531@grendel.zope.com> Fred L. Drake writes: > Modified Files: > Tag: r22b2-branch > libcgihttp.tex Oops, wrong branch! Don't use this version for anything. -Fred -- Fred L. Drake, Jr. PythonLabs at Zope Corporation From fdrake@users.sourceforge.net Mon Nov 19 05:22:46 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Sun, 18 Nov 2001 21:22:46 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libcgihttp.tex,1.5,1.5.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv22081/lib Modified Files: Tag: release21-maint libcgihttp.tex Log Message: Update the platform notes for the CGIHTTPServer module; it works on more platforms now, and has since Python 2.0. This closes SF bug #482943. Index: libcgihttp.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcgihttp.tex,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -C2 -d -r1.5 -r1.5.4.1 *** libcgihttp.tex 2000/12/01 15:25:23 1.5 --- libcgihttp.tex 2001/11/19 05:22:44 1.5.4.1 *************** *** 4,8 **** \declaremodule{standard}{CGIHTTPServer} - \platform{Unix} \sectionauthor{Moshe Zadka}{moshez@zadka.site.co.il} \modulesynopsis{This module provides a request handler for HTTP servers --- 4,7 ---- *************** *** 16,21 **** run CGI scripts. ! \strong{Note:} This module is \UNIX{} dependent since it creates the ! CGI process using \function{os.fork()} and \function{os.exec()}. The \module{CGIHTTPServer} module defines the following class: --- 15,21 ---- run CGI scripts. ! \strong{Note:} This module can run CGI scripts on \UNIX{} and Windows ! systems; on Mac OS it will only be able to run Python scripts within ! the same process as itself.} The \module{CGIHTTPServer} module defines the following class: From fdrake@users.sourceforge.net Mon Nov 19 05:27:42 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Sun, 18 Nov 2001 21:27:42 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/tools/sgmlconv latex2esis.py,1.26,1.27 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools/sgmlconv In directory usw-pr-cvs1:/tmp/cvs-serv23117 Modified Files: latex2esis.py Log Message: Adjust input pre-processing so that a comment on the last line does not break the processor; this will do the right thing. Index: latex2esis.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/sgmlconv/latex2esis.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** latex2esis.py 2001/09/28 16:26:13 1.26 --- latex2esis.py 2001/11/19 05:27:40 1.27 *************** *** 110,114 **** self.ofp = ofp self.table = table ! self.line = string.join([s.rstrip() for s in ifp.readlines()], "\n") self.preamble = 1 --- 110,116 ---- self.ofp = ofp self.table = table ! L = [s.rstrip() for s in ifp.readlines()] ! L.append("") ! self.line = string.join(L, "\n") self.preamble = 1 From fdrake@users.sourceforge.net Mon Nov 19 05:28:31 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Sun, 18 Nov 2001 21:28:31 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/tools/sgmlconv docfixer.py,1.34,1.35 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools/sgmlconv In directory usw-pr-cvs1:/tmp/cvs-serv23292 Modified Files: docfixer.py Log Message: Avoid trailing blank lines in the output. Index: docfixer.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/sgmlconv/docfixer.py,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** docfixer.py 2001/09/29 19:07:22 1.34 --- docfixer.py 2001/11/19 05:28:29 1.35 *************** *** 1023,1026 **** --- 1023,1030 ---- # LaTeX2HTML screwing with GNU-style long options (the '--' problem). join_adjacent_elements(fragment, "option") + # Attempt to avoid trailing blank lines: + fragment.normalize() + if fragment.lastChild.data[-1:] == "\n": + fragment.lastChild.data = fragment.lastChild.data.rstrip() + "\n" # d = {} From loewis@users.sourceforge.net Mon Nov 19 10:41:28 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Mon, 19 Nov 2001 02:41:28 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.195,1.196 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv2337 Modified Files: socketmodule.c Log Message: Test for negative buffer sizes. Fixes #482871. Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.195 retrieving revision 1.196 diff -C2 -d -r1.195 -r1.196 *** socketmodule.c 2001/11/09 10:06:23 1.195 --- socketmodule.c 2001/11/19 10:41:26 1.196 *************** *** 1482,1485 **** --- 1482,1490 ---- if (!PyArg_ParseTuple(args, "i|i:recv", &len, &flags)) return NULL; + if (len < 0) { + PyErr_SetString(PyExc_ValueError, + "negative buffersize in connect"); + return NULL; + } buf = PyString_FromStringAndSize((char *) 0, len); if (buf == NULL) From bwarsaw@users.sourceforge.net Mon Nov 19 16:28:09 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 19 Nov 2001 08:28:09 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/email Utils.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv2163 Modified Files: Utils.py Log Message: formatdate(): The calculation of the minutes part of the zone was incorrect for "uneven" timezones. This algorithm should work for even timezones (e.g. America/New_York) and uneven timezones (e.g. Australia/Adelaide and America/St_Johns). Closes SF bug #483231. Index: Utils.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Utils.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Utils.py 2001/11/09 17:45:48 1.6 --- Utils.py 2001/11/19 16:28:07 1.7 *************** *** 131,135 **** else: offset = time.timezone ! zone = '%+03d%02d' % (offset / -3600, offset % 60) else: now = time.gmtime(timeval) --- 131,136 ---- else: offset = time.timezone ! hours, minutes = divmod(offset, -3600) ! zone = '%+03d%02d' % (hours, minutes / -60) else: now = time.gmtime(timeval) From bwarsaw@users.sourceforge.net Mon Nov 19 16:31:08 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 19 Nov 2001 08:31:08 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_email.py,1.19,1.20 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv2952 Modified Files: test_email.py Log Message: test_formatdate(), test_formatdate_zoneoffsets(): Two changes. First, use the correct way to test for epoch, by looking at the year component of gmtime(0). Add clause for Unix epoch and Mac epoch (Tim, what is Windows epoch?). Also, get rid of the strptime() test, it was way too problematic given that strptime() is missing on many platforms and issues with locales. Instead, simply test that formatdate() gets the numeric timezone calculation correct for the altzone and timezone. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** test_email.py 2001/11/18 23:15:58 1.19 --- test_email.py 2001/11/19 16:31:06 1.20 *************** *** 922,931 **** def test_formatdate(self): now = 1005327232.109884 ! time0 = time.ctime(0) # When does the epoch start? ! if time0 == 'Wed Dec 31 19:00:00 1969': # traditional Unix epoch matchdate = 'Fri, 09 Nov 2001 17:33:52 -0000' ! elif time0 == 'Fri Jan 1 00:00:00 1904': # Mac epoch matchdate = 'Sat, 09 Nov 1935 16:33:52 -0000' --- 922,931 ---- def test_formatdate(self): now = 1005327232.109884 ! epoch = time.gmtime(0)[0] # When does the epoch start? ! if epoch == 1970: # traditional Unix epoch matchdate = 'Fri, 09 Nov 2001 17:33:52 -0000' ! elif epoch == 1904: # Mac epoch matchdate = 'Sat, 09 Nov 1935 16:33:52 -0000' *************** *** 935,952 **** ldate = Utils.formatdate(now, localtime=1) self.assertEqual(gdate, matchdate) - # It's a little tougher to test for localtime, but we'll try. Skip if - # we don't have strptime(). - if hasattr(time, 'strptime'): - gtime = time.strptime(gdate.split()[4], '%H:%M:%S') - ltime = time.strptime(ldate.split()[4], '%H:%M:%S') - zone = ldate.split()[5] - offset = int(zone[:3]) * -3600 + int(zone[-2:]) - if time.daylight and time.localtime(now)[-1]: - toff = time.altzone - else: - toff = time.timezone - self.assertEqual(offset, toff) ! def test_parsedate(self): self.assertEqual(Utils.parsedate(''), None) --- 935,951 ---- ldate = Utils.formatdate(now, localtime=1) self.assertEqual(gdate, matchdate) ! def test_formatdate_zoneoffsets(self): ! now = 1005327232.109884 ! ldate = Utils.formatdate(now, localtime=1) ! zone = ldate.split()[5] ! offset = int(zone[:3]) * -3600 + int(zone[-2:]) * -60 ! if time.daylight and time.localtime(now)[-1]: ! toff = time.altzone ! else: ! toff = time.timezone ! self.assertEqual(offset, toff) ! ! def test_parsedate_none(self): self.assertEqual(Utils.parsedate(''), None) From bwarsaw@users.sourceforge.net Mon Nov 19 18:36:46 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 19 Nov 2001 10:36:46 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/email Utils.py,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv8196/Lib/email Modified Files: Utils.py Log Message: formatdate(): Jason Mastaler correctly points out that divmod with a negative modulus won't return the right values. So always do positive modulus on an absolute value and twiddle the sign as appropriate after the fact. Index: Utils.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Utils.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Utils.py 2001/11/19 16:28:07 1.7 --- Utils.py 2001/11/19 18:36:43 1.8 *************** *** 131,136 **** else: offset = time.timezone ! hours, minutes = divmod(offset, -3600) ! zone = '%+03d%02d' % (hours, minutes / -60) else: now = time.gmtime(timeval) --- 131,142 ---- else: offset = time.timezone ! hours, minutes = divmod(abs(offset), 3600) ! # Remember offset is in seconds west of UTC, but the timezone is in ! # minutes east of UTC, so the signs differ. ! if offset > 0: ! sign = '-' ! else: ! sign = '+' ! zone = '%s%02d%02d' % (sign, hours, minutes / 60) else: now = time.gmtime(timeval) From bwarsaw@users.sourceforge.net Mon Nov 19 18:38:44 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 19 Nov 2001 10:38:44 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_email.py,1.20,1.21 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv8765/Lib/test Modified Files: test_email.py Log Message: test_formatdate(): Remove the unnecessary ldate calculation. test_formatdate_zoneoffsets() => test_formatdate_localtime(): Do the sign corrected calculation of the zone offset. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** test_email.py 2001/11/19 16:31:06 1.20 --- test_email.py 2001/11/19 18:38:42 1.21 *************** *** 933,944 **** matchdate = "I don't understand your epoch" gdate = Utils.formatdate(now) - ldate = Utils.formatdate(now, localtime=1) self.assertEqual(gdate, matchdate) ! def test_formatdate_zoneoffsets(self): now = 1005327232.109884 ldate = Utils.formatdate(now, localtime=1) zone = ldate.split()[5] ! offset = int(zone[:3]) * -3600 + int(zone[-2:]) * -60 if time.daylight and time.localtime(now)[-1]: toff = time.altzone --- 933,947 ---- matchdate = "I don't understand your epoch" gdate = Utils.formatdate(now) self.assertEqual(gdate, matchdate) ! def test_formatdate_localtime(self): now = 1005327232.109884 ldate = Utils.formatdate(now, localtime=1) zone = ldate.split()[5] ! offset = int(zone[1:3]) * 3600 + int(zone[-2:]) * 60 ! # Remember offset is in seconds west of UTC, but the timezone is in ! # minutes east of UTC, so the signs differ. ! if zone[0] == '+': ! offset = -offset if time.daylight and time.localtime(now)[-1]: toff = time.altzone From lemburg@users.sourceforge.net Tue Nov 20 15:17:27 2001 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Tue, 20 Nov 2001 07:17:27 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_unicode.py,1.42,1.43 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv15987/Lib/test Modified Files: test_unicode.py Log Message: Fix for bug #480188: printing unicode objects Index: test_unicode.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** test_unicode.py 2001/10/19 12:02:28 1.42 --- test_unicode.py 2001/11/20 15:17:25 1.43 *************** *** 645,646 **** --- 645,659 ---- verify(("abc" "def" u"ghi") == u"abcdefghi") print 'done.' + + print 'Testing Unicode printing...', + print u'abc' + print u'abc', u'def' + print u'abc', 'def' + print 'abc', u'def' + print u'abc\n' + print u'abc\n', + print u'abc\n', + print u'def\n' + print u'def\n' + print 'done.' + From lemburg@users.sourceforge.net Tue Nov 20 15:17:28 2001 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Tue, 20 Nov 2001 07:17:28 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.289,2.290 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv15987/Python Modified Files: ceval.c Log Message: Fix for bug #480188: printing unicode objects Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.289 retrieving revision 2.290 diff -C2 -d -r2.289 -r2.290 *** ceval.c 2001/11/08 08:34:43 2.289 --- ceval.c 2001/11/20 15:17:25 2.290 *************** *** 1350,1361 **** if (err == 0) err = PyFile_WriteObject(v, w, Py_PRINT_RAW); ! if (err == 0 && PyString_Check(v)) { /* XXX move into writeobject() ? */ ! char *s = PyString_AsString(v); ! int len = PyString_Size(v); if (len > 0 && isspace(Py_CHARMASK(s[len-1])) && s[len-1] != ' ') PyFile_SoftSpace(w, 0); } Py_DECREF(v); --- 1350,1371 ---- if (err == 0) err = PyFile_WriteObject(v, w, Py_PRINT_RAW); ! if (err == 0) { /* XXX move into writeobject() ? */ ! if (PyString_Check(v)) { ! char *s = PyString_AS_STRING(v); ! int len = PyString_GET_SIZE(v); if (len > 0 && isspace(Py_CHARMASK(s[len-1])) && s[len-1] != ' ') PyFile_SoftSpace(w, 0); + } + else if (PyUnicode_Check(v)) { + Py_UNICODE *s = PyUnicode_AS_UNICODE(v); + int len = PyUnicode_GET_SIZE(v); + if (len > 0 && + Py_UNICODE_ISSPACE(s[len-1]) && + s[len-1] != ' ') + PyFile_SoftSpace(w, 0); + } } Py_DECREF(v); From lemburg@users.sourceforge.net Tue Nov 20 15:17:27 2001 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Tue, 20 Nov 2001 07:17:27 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test/output test_unicode,1.13,1.14 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test/output In directory usw-pr-cvs1:/tmp/cvs-serv15987/Lib/test/output Modified Files: test_unicode Log Message: Fix for bug #480188: printing unicode objects Index: test_unicode =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/output/test_unicode,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** test_unicode 2001/10/19 12:02:28 1.13 --- test_unicode 2001/11/20 15:17:25 1.14 *************** *** 7,8 **** --- 7,21 ---- Testing standard mapping codecs... 0-127... 128-255... done. Testing Unicode string concatenation... done. + Testing Unicode printing... abc + abc def + abc def + abc def + abc + + abc + abc + def + + def + + done. From lemburg@users.sourceforge.net Tue Nov 20 15:18:51 2001 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Tue, 20 Nov 2001 07:18:51 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_unicode.py,1.43,1.44 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv16750/Lib/test Modified Files: test_unicode.py Log Message: Fix for bug #438164: %-formatting using Unicode objects. This patch also does away with an incompatibility between Jython and CPython. Index: test_unicode.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** test_unicode.py 2001/11/20 15:17:25 1.43 --- test_unicode.py 2001/11/20 15:18:49 1.44 *************** *** 363,370 **** verify(u"%(x)s, %(y)s" % {'x':u"abc", 'y':"def"} == u'abc, def') try: ! if sys.platform[:4] != 'java': ! value = u"%(x)s, %(ä)s" % {'x':u"abc", u'ä'.encode('utf-8'):"def"} ! else: ! value = u"%(x)s, %(ä)s" % {'x':u"abc", u'ä':"def"} except KeyError: print '*** formatting failed for "%s"' % "u'abc, def'" --- 363,367 ---- verify(u"%(x)s, %(y)s" % {'x':u"abc", 'y':"def"} == u'abc, def') try: ! value = u"%(x)s, %(ä)s" % {'x':u"abc", u'ä':"def"} except KeyError: print '*** formatting failed for "%s"' % "u'abc, def'" From lemburg@users.sourceforge.net Tue Nov 20 15:18:51 2001 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Tue, 20 Nov 2001 07:18:51 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.120,2.121 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv16750/Objects Modified Files: unicodeobject.c Log Message: Fix for bug #438164: %-formatting using Unicode objects. This patch also does away with an incompatibility between Jython and CPython. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.120 retrieving revision 2.121 diff -C2 -d -r2.120 -r2.121 *** unicodeobject.c 2001/10/19 12:02:29 2.120 --- unicodeobject.c 2001/11/20 15:18:49 2.121 *************** *** 5301,5304 **** --- 5301,5305 ---- goto onError; } + #if 0 /* keys are converted to strings using UTF-8 and then looked up since Python uses strings to hold *************** *** 5308,5311 **** --- 5309,5315 ---- keylen, NULL); + #else + key = PyUnicode_FromUnicode(keystart, keylen); + #endif if (key == NULL) goto onError; From jackjansen@users.sourceforge.net Tue Nov 20 20:13:45 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 12:13:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_email.py,1.18,1.18.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv20970/Python/Lib/test Modified Files: Tag: r22b2-branch test_email.py Log Message: Merged trunk changes. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v retrieving revision 1.18 retrieving revision 1.18.2.1 diff -C2 -d -r1.18 -r1.18.2.1 *** test_email.py 2001/11/13 18:01:37 1.18 --- test_email.py 2001/11/20 20:13:42 1.18.2.1 *************** *** 922,942 **** def test_formatdate(self): now = 1005327232.109884 gdate = Utils.formatdate(now) ldate = Utils.formatdate(now, localtime=1) ! self.assertEqual(gdate, 'Fri, 09 Nov 2001 17:33:52 -0000') ! # It's a little tougher to test for localtime, but we'll try. Skip if ! # we don't have strptime(). ! if hasattr(time, 'strptime'): ! gtime = time.strptime(gdate.split()[4], '%H:%M:%S') ! ltime = time.strptime(ldate.split()[4], '%H:%M:%S') ! zone = ldate.split()[5] ! offset = int(zone[:3]) * -3600 + int(zone[-2:]) ! if time.daylight and time.localtime(now)[-1]: ! toff = time.altzone ! else: ! toff = time.timezone ! self.assertEqual(offset, toff) ! def test_parsedate(self): self.assertEqual(Utils.parsedate(''), None) --- 922,954 ---- def test_formatdate(self): now = 1005327232.109884 + epoch = time.gmtime(0)[0] + # When does the epoch start? + if epoch == 1970: + # traditional Unix epoch + matchdate = 'Fri, 09 Nov 2001 17:33:52 -0000' + elif epoch == 1904: + # Mac epoch + matchdate = 'Sat, 09 Nov 1935 16:33:52 -0000' + else: + matchdate = "I don't understand your epoch" gdate = Utils.formatdate(now) + self.assertEqual(gdate, matchdate) + + def test_formatdate_localtime(self): + now = 1005327232.109884 ldate = Utils.formatdate(now, localtime=1) ! zone = ldate.split()[5] ! offset = int(zone[1:3]) * 3600 + int(zone[-2:]) * 60 ! # Remember offset is in seconds west of UTC, but the timezone is in ! # minutes east of UTC, so the signs differ. ! if zone[0] == '+': ! offset = -offset ! if time.daylight and time.localtime(now)[-1]: ! toff = time.altzone ! else: ! toff = time.timezone ! self.assertEqual(offset, toff) ! def test_parsedate_none(self): self.assertEqual(Utils.parsedate(''), None) From jackjansen@users.sourceforge.net Tue Nov 20 20:17:43 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 12:17:43 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_email.py,1.18.2.1,1.18.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv22356/Python/Lib/test Modified Files: Tag: r22b2-branch test_email.py Log Message: More changes to the formatdate epoch test: the Mac epoch is in localtime, so east of GMT it falls in 1903:-( Changed the test to obtain the epoch in both local time and GMT, and do the right thing in the comparisons. As a sanity measure also check that day/month is Jan 1. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v retrieving revision 1.18.2.1 retrieving revision 1.18.2.2 diff -C2 -d -r1.18.2.1 -r1.18.2.2 *** test_email.py 2001/11/20 20:13:42 1.18.2.1 --- test_email.py 2001/11/20 20:17:40 1.18.2.2 *************** *** 922,931 **** def test_formatdate(self): now = 1005327232.109884 ! epoch = time.gmtime(0)[0] # When does the epoch start? ! if epoch == 1970: # traditional Unix epoch matchdate = 'Fri, 09 Nov 2001 17:33:52 -0000' ! elif epoch == 1904: # Mac epoch matchdate = 'Sat, 09 Nov 1935 16:33:52 -0000' --- 922,932 ---- def test_formatdate(self): now = 1005327232.109884 ! gm_epoch = time.gmtime(0)[0:3] ! loc_epoch = time.localtime(0)[0:3] # When does the epoch start? ! if gm_epoch == (1970, 1, 1): # traditional Unix epoch matchdate = 'Fri, 09 Nov 2001 17:33:52 -0000' ! elif loc_epoch == (1904, 1, 1): # Mac epoch matchdate = 'Sat, 09 Nov 1935 16:33:52 -0000' From jackjansen@users.sourceforge.net Tue Nov 20 23:11:54 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:11:54 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/mkcwproject/template-carbon template.prj.xml,1.3.2.1,1.3.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-carbon In directory usw-pr-cvs1:/tmp/cvs-serv5990/Python/Mac/Lib/mkcwproject/template-carbon Modified Files: Tag: r22b2-branch template.prj.xml Log Message: Reverted inclusion of MSL C in generated plugin projects: it breaks extension modules that use stdio. This may be a CodeWarrior bug, need to investigate this. Index: template.prj.xml =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-carbon/template.prj.xml,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** template.prj.xml 2001/11/18 02:00:36 1.3.2.1 --- template.prj.xml 2001/11/20 23:11:52 1.3.2.2 *************** *** 978,988 **** Name - MSL C.Carbon.Lib - MacOS - Library - - - - Name CarbonLib MacOS --- 978,981 ---- *************** *** 1014,1022 **** MacOS - - Name - MSL C.Carbon.Lib - MacOS - --- 1007,1010 ---- *************** *** 1049,1058 **** Name PythonCoreCarbon - MacOS - - - %(mac_targetname)s - Name - MSL C.Carbon.Lib MacOS --- 1037,1040 ---- From jackjansen@users.sourceforge.net Tue Nov 20 23:12:03 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:12:03 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/mkcwproject/template-ppc template.prj.xml,1.2,1.2.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-ppc In directory usw-pr-cvs1:/tmp/cvs-serv6041/Python/Mac/Lib/mkcwproject/template-ppc Modified Files: Tag: r22b2-branch template.prj.xml Log Message: Reverted inclusion of MSL C in generated plugin projects: it breaks extension modules that use stdio. This may be a CodeWarrior bug, need to investigate this. Index: template.prj.xml =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-ppc/template.prj.xml,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -d -r1.2 -r1.2.2.1 *** template.prj.xml 2001/11/10 23:21:47 1.2 --- template.prj.xml 2001/11/20 23:12:01 1.2.2.1 *************** *** 713,723 **** Name - MSL C.PPC.Lib - MacOS - Library - Debug - - - Name MathLib MacOS --- 713,716 ---- *************** *** 753,761 **** Name - MSL C.PPC.Lib - MacOS - - - Name MathLib MacOS --- 746,749 ---- *************** *** 796,805 **** Name PythonCore - MacOS - - - %(mac_targetname)s - Name - MSL C.PPC.Lib MacOS --- 784,787 ---- From jackjansen@users.sourceforge.net Tue Nov 20 23:19:27 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:19:27 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts fullbuild.py,1.76,1.76.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv7761/Python/Mac/scripts Modified Files: Tag: r22b2-branch fullbuild.py Log Message: The hfsplus project is called hfsplus.carbon.mcp. Index: fullbuild.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/fullbuild.py,v retrieving revision 1.76 retrieving revision 1.76.2.1 diff -C2 -d -r1.76 -r1.76.2.1 *** fullbuild.py 2001/11/06 15:56:49 1.76 --- fullbuild.py 2001/11/20 23:19:24 1.76.2.1 *************** *** 293,297 **** (":Mac:Build:zlib.carbon.mcp", "zlib.carbon"), (":Mac:Build:_dummy_tkinter.mcp", "_tkinter.carbon"), ! (":Mac:Build:hfsplus.mcp", "hfsplus.carbon"), ## (":Extensions:Imaging:_tkinter.carbon.mcp", "_tkinter.carbon"), (":Mac:Build:ColorPicker.carbon.mcp", "ColorPicker.carbon"), --- 293,297 ---- (":Mac:Build:zlib.carbon.mcp", "zlib.carbon"), (":Mac:Build:_dummy_tkinter.mcp", "_tkinter.carbon"), ! (":Mac:Build:hfsplus.carbon.mcp", "hfsplus.carbon"), ## (":Extensions:Imaging:_tkinter.carbon.mcp", "_tkinter.carbon"), (":Mac:Build:ColorPicker.carbon.mcp", "ColorPicker.carbon"), From jackjansen@users.sourceforge.net Tue Nov 20 23:20:42 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:20:42 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonStandSmall.mcp,1.31.2.1,1.31.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv7992/Python/Mac/Build Modified Files: Tag: r22b2-branch PythonStandSmall.mcp Log Message: Optionally include _hotshot in small Pythons, for debugging purposes. Index: PythonStandSmall.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonStandSmall.mcp,v retrieving revision 1.31.2.1 retrieving revision 1.31.2.2 diff -C2 -d -r1.31.2.1 -r1.31.2.2 Binary files /tmp/cvsBqrbEQ and /tmp/cvs2CEPwz differ From jackjansen@users.sourceforge.net Tue Nov 20 23:20:47 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:20:47 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_small_config.h,1.14,1.14.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv8101/Python/Mac/mwerks Modified Files: Tag: r22b2-branch mwerks_small_config.h Log Message: Optionally include _hotshot in small Pythons, for debugging purposes. Index: mwerks_small_config.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/mwerks/mwerks_small_config.h,v retrieving revision 1.14 retrieving revision 1.14.10.1 diff -C2 -d -r1.14 -r1.14.10.1 *** mwerks_small_config.h 2001/08/07 15:14:28 1.14 --- mwerks_small_config.h 2001/11/20 23:20:45 1.14.10.1 *************** *** 26,29 **** --- 26,30 ---- #define USE_APPEARANCE /* Enable Appearance support */ #define WITHOUT_FRAMEWORKS /* Use old-style Universal Header includes, not Carbon/Carbon.h */ + #define WITH_HOTSHOT /* Enable hotshot profiler */ #define USE_MSL_MALLOC /* Disable private malloc. Also disables next two defines */ From jackjansen@users.sourceforge.net Tue Nov 20 23:20:51 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:20:51 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macconfig.c,1.29,1.29.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv8118/Python/Mac/Modules Modified Files: Tag: r22b2-branch macconfig.c Log Message: Optionally include _hotshot in small Pythons, for debugging purposes. Index: macconfig.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macconfig.c,v retrieving revision 1.29 retrieving revision 1.29.2.1 diff -C2 -d -r1.29 -r1.29.2.1 *** macconfig.c 2001/11/06 15:56:41 1.29 --- macconfig.c 2001/11/20 23:20:49 1.29.2.1 *************** *** 159,162 **** --- 159,165 ---- extern void initthread(); #endif + #ifdef WITH_HOTSHOT + extern void init_hotshot(); + #endif #ifdef USE_PYEXPAT extern void initpyexpat(); *************** *** 288,291 **** --- 291,297 ---- #ifdef WITH_THREAD {"thread", initthread}, + #endif + #ifdef WITH_HOTSHOT + {"_hotshot", init_hotshot}, #endif #ifdef USE_PYEXPAT From jackjansen@users.sourceforge.net Tue Nov 20 23:20:57 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:20:57 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_carbon_config.h,1.8,1.8.10.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv8159/Python/Mac/mwerks Modified Files: Tag: r22b2-branch mwerks_carbon_config.h Log Message: Optionally include _hotshot in small Pythons, for debugging purposes. Index: mwerks_carbon_config.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/mwerks/mwerks_carbon_config.h,v retrieving revision 1.8 retrieving revision 1.8.10.1 diff -C2 -d -r1.8 -r1.8.10.1 *** mwerks_carbon_config.h 2001/08/07 15:13:16 1.8 --- mwerks_carbon_config.h 2001/11/20 23:20:55 1.8.10.1 *************** *** 30,33 **** --- 30,34 ---- /* #define USE_ZLIB /* Include the zlib module */ #define USE_APPEARANCE /* Enable Appearance support */ + #define WITH_HOTSHOT /* Enable hotshot profiler */ #define USE_MSL_MALLOC /* Disable private malloc. Also disables next two defines */ From jackjansen@users.sourceforge.net Tue Nov 20 23:21:17 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:21:17 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wtext.py,1.14,1.14.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv8232/Python/Mac/Tools/IDE Modified Files: Tag: r22b2-branch Wtext.py Log Message: Merged Just's trunk changes. Index: Wtext.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wtext.py,v retrieving revision 1.14 retrieving revision 1.14.2.1 diff -C2 -d -r1.14 -r1.14.2.1 *** Wtext.py 2001/11/02 19:24:41 1.14 --- Wtext.py 2001/11/20 23:21:15 1.14.2.1 *************** *** 2,5 **** --- 2,7 ---- from Carbon import Qd, Res, Scrap from Carbon import TE, TextEdit, Win + from Carbon import App + from Carbon.Appearance import kThemeStateActive, kThemeStateInactive import waste import WASTEconst *************** *** 56,78 **** # to be overridden ! def getscrollbarvalues(self): return None, None # internal method def updatescrollbars(self): ! vx, vy = self.getscrollbarvalues() if self._parent._barx: ! if vx <> None: ! self._parent._barx.enable(1) ! self._parent._barx.set(vx) ! else: ! self._parent._barx.enable(0) if self._parent._bary: ! if vy <> None: ! self._parent._bary.enable(1) ! self._parent._bary.set(vy) ! else: ! self._parent._bary.enable(0) ! UNDOLABELS = [ # Indexed by WEGetUndoInfo() value --- 58,84 ---- # to be overridden ! def getscrollrects(self): ! """Return (destrect, viewrect).""" return None, None # internal method + def updatescrollbars(self): ! (dl, dt, dr, db), (vl, vt, vr, vb) = self.getscrollrects() if self._parent._barx: ! viewwidth = vr - vl ! destwidth = dr - dl ! bar = self._parent._barx ! bar.setmax(destwidth - viewwidth) ! bar.setviewsize(viewwidth) ! bar.set(vl - dl) if self._parent._bary: ! viewheight = vb - vt ! destheight = db - dt ! bar = self._parent._bary ! bar.setmax(destheight - viewheight) ! bar.setviewsize(viewheight) ! bar.set(vt - dt) ! UNDOLABELS = [ # Indexed by WEGetUndoInfo() value *************** *** 374,377 **** --- 380,384 ---- self.drawselframe(1) Qd.FrameRect(self._bounds) + #App.DrawThemeEditTextFrame(self._bounds, kThemeStateActive) # scrolling *************** *** 386,396 **** def scrolltop(self): if self._parent._bary and self._parent._bary._enabled: ! self.vscroll(0) if self._parent._barx and self._parent._barx._enabled: ! self.hscroll(0) def scrollbottom(self): if self._parent._bary and self._parent._bary._enabled: ! self.vscroll(32767) # menu handlers --- 393,403 ---- def scrolltop(self): if self._parent._bary and self._parent._bary._enabled: ! self.vscroll(self._parent._bary.getmin()) if self._parent._barx and self._parent._barx._enabled: ! self.hscroll(self._parent._barx.getmin()) def scrollbottom(self): if self._parent._bary and self._parent._bary._enabled: ! self.vscroll(self._parent._bary.getmax()) # menu handlers *************** *** 470,479 **** # private ! def getscrollbarvalues(self): ! dr = self.ted.WEGetDestRect() ! vr = self.ted.WEGetViewRect() ! vx = Wcontrols._scalebarvalue(dr[0], dr[2], vr[0], vr[2]) ! vy = Wcontrols._scalebarvalue(dr[1], dr[3], vr[1], vr[3]) ! return vx, vy def vscroll(self, value): --- 477,482 ---- # private ! def getscrollrects(self): ! return self.ted.WEGetDestRect(), self.ted.WEGetViewRect() def vscroll(self, value): *************** *** 481,487 **** dr = self.ted.WEGetDestRect() vr = self.ted.WEGetViewRect() - destheight = dr[3] - dr[1] viewheight = vr[3] - vr[1] ! viewoffset = maxdelta = vr[1] - dr[1] mindelta = vr[3] - dr[3] if value == "+": --- 484,489 ---- dr = self.ted.WEGetDestRect() vr = self.ted.WEGetViewRect() viewheight = vr[3] - vr[1] ! maxdelta = vr[1] - dr[1] mindelta = vr[3] - dr[3] if value == "+": *************** *** 494,502 **** delta = lineheight - viewheight else: # in thumb ! cur = (32767L * viewoffset) / (destheight - viewheight) ! delta = (cur-value)*(destheight - viewheight)/32767 ! if abs(delta - viewoffset) <=2: ! # compensate for irritating rounding error ! delta = viewoffset delta = min(maxdelta, delta) delta = max(mindelta, delta) --- 496,500 ---- delta = lineheight - viewheight else: # in thumb ! delta = vr[1] - dr[1] - value delta = min(maxdelta, delta) delta = max(mindelta, delta) *************** *** 520,528 **** delta = 0.5 * (vr[0] - vr[2]) else: # in thumb ! cur = (32767 * viewoffset) / (destwidth - viewwidth) ! delta = (cur-value)*(destwidth - viewwidth)/32767 ! if abs(delta - viewoffset) <=2: ! # compensate for irritating rounding error ! delta = viewoffset delta = min(maxdelta, delta) delta = max(mindelta, delta) --- 518,527 ---- delta = 0.5 * (vr[0] - vr[2]) else: # in thumb ! delta = vr[0] - dr[0] - value ! #cur = (32767 * viewoffset) / (destwidth - viewwidth) ! #delta = (cur-value)*(destwidth - viewwidth)/32767 ! #if abs(delta - viewoffset) <=2: ! # # compensate for irritating rounding error ! # delta = viewoffset delta = min(maxdelta, delta) delta = max(mindelta, delta) *************** *** 924,927 **** --- 923,927 ---- self.ted.WEFeatureFlag(WASTEconst.weFAutoScroll, 0) self.ted.WESetSelection(count, count + 1) + Qd.QDFlushPortBuffer(self._parentwindow.wid, None) # needed under OSX time.sleep(0.2) self.ted.WESetSelection(selstart, selend) From jackjansen@users.sourceforge.net Tue Nov 20 23:21:23 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:21:23 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wlists.py,1.7,1.7.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv8251/Python/Mac/Tools/IDE Modified Files: Tag: r22b2-branch Wlists.py Log Message: Merged Just's trunk changes. Index: Wlists.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wlists.py,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** Wlists.py 2001/11/05 08:51:24 1.7 --- Wlists.py 2001/11/20 23:21:21 1.7.2.1 *************** *** 6,9 **** --- 6,11 ---- from Carbon.Lists import kListDefUserProcType, lInitMsg, lDrawMsg, lHiliteMsg, lCloseMsg from Carbon.QuickDraw import hilitetransfermode + from Carbon import App + from Carbon.Appearance import kThemeStateActive, kThemeStateInactive, kThemeStatePressed *************** *** 254,260 **** visRgn = self._parentwindow.wid.GetWindowPort().visRgn self._list.LUpdate(visRgn) ! Qd.FrameRect(self._bounds) ! if self._selected and self._activated: ! self.drawselframe(1) def select(self, onoff, isclick = 0): --- 256,262 ---- visRgn = self._parentwindow.wid.GetWindowPort().visRgn self._list.LUpdate(visRgn) ! App.DrawThemeListBoxFrame(self._bounds, kThemeStateActive) ! #if self._selected and self._activated: ! # self.drawselframe(1) def select(self, onoff, isclick = 0): *************** *** 262,266 **** return self.SetPort() ! self.drawselframe(onoff) def activate(self, onoff): --- 264,270 ---- return self.SetPort() ! state = [kThemeStateActive, kThemeStatePressed][onoff] ! App.DrawThemeListBoxFrame(self._bounds, kThemeStateActive) ! #self.drawselframe(onoff) def activate(self, onoff): *************** *** 268,273 **** if self._visible: self._list.LActivate(onoff) ! if self._selected: ! self.drawselframe(onoff) def get(self): --- 272,277 ---- if self._visible: self._list.LActivate(onoff) ! #if self._selected: ! # self.drawselframe(onoff) def get(self): *************** *** 450,453 **** --- 454,458 ---- Qd.DrawText(line2, 0, len(line2)) Qd.PenPat("\x11\x11\x11\x11\x11\x11\x11\x11") + bottom = top + theList.cellSize[1] Qd.MoveTo(left, bottom - 1) Qd.LineTo(right, bottom - 1) From jackjansen@users.sourceforge.net Tue Nov 20 23:21:27 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:21:27 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Widgets.rsrc,1.1,1.1.14.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv8266/Python/Mac/Tools/IDE Modified Files: Tag: r22b2-branch Widgets.rsrc Log Message: Merged Just's trunk changes. Index: Widgets.rsrc =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Widgets.rsrc,v retrieving revision 1.1 retrieving revision 1.1.14.1 diff -C2 -d -r1.1 -r1.1.14.1 Binary files /tmp/cvsorIu7h and /tmp/cvsWeimSp differ From jackjansen@users.sourceforge.net Tue Nov 20 23:21:32 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:21:32 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wcontrols.py,1.10,1.10.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv8289/Python/Mac/Tools/IDE Modified Files: Tag: r22b2-branch Wcontrols.py Log Message: Merged Just's trunk changes. Index: Wcontrols.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wcontrols.py,v retrieving revision 1.10 retrieving revision 1.10.2.1 diff -C2 -d -r1.10 -r1.10.2.1 *** Wcontrols.py 2001/11/02 22:51:42 1.10 --- Wcontrols.py 2001/11/20 23:21:30 1.10.2.1 *************** *** 18,21 **** --- 18,22 ---- self._max = max self._enabled = 1 + self._viewsize = 0 def open(self): *************** *** 30,35 **** self._procID, 0) ! self.SetPort() ! #self.GetWindow().ValidWindowRect(self._bounds) self.enable(self._enabled) --- 31,36 ---- self._procID, 0) ! if self._viewsize: ! self._control.SetControlViewSize(self._viewsize) self.enable(self._enabled) *************** *** 76,82 **** def test(self, point): ! ctltype, control = Ctl.FindControl(point, self._parentwindow.wid) ! if self._enabled and control == self._control: return 1 def click(self, point, modifiers): --- 77,85 ---- def test(self, point): ! if Qd.PtInRect(point, self._bounds) and self._enabled: return 1 + #ctltype, control = Ctl.FindControl(point, self._parentwindow.wid) + #if self._enabled and control == self._control: + # return 1 def click(self, point, modifiers): *************** *** 113,119 **** """Standard push button.""" def __init__(self, possize, title = "Button", callback = None): ! procID = Controls.pushButProc | Controls.useWFont ! ControlWidget.__init__(self, possize, title, procID, callback, 0, 0, 1) self._isdefault = 0 --- 116,123 ---- """Standard push button.""" + procID = Controls.pushButProc | Controls.useWFont + def __init__(self, possize, title = "Button", callback = None): ! ControlWidget.__init__(self, possize, title, self.procID, callback, 0, 0, 1) self._isdefault = 0 *************** *** 121,126 **** --- 125,132 ---- if not self._enabled: return + # emulate the pushing of the button import time self._control.HiliteControl(Controls.kControlButtonPart) + Qd.QDFlushPortBuffer(self._parentwindow.wid, None) # needed under OSX time.sleep(0.1) self._control.HiliteControl(0) *************** *** 140,144 **** --- 146,168 ---- self._control.Draw1Control() + def open(self): + ControlWidget.open(self) + if self._isdefault: + self._setdefault(self._isdefault) + def _setdefault(self, onoff): + c = self._control + if c is not None: + if onoff: + data = "\xFF" + else: + data = "\0" + # hide before changing state, otherwise the button isn't always + # redrawn correctly, although it's quite different under Aqua + # and Classic... + c.HideControl() + c.SetControlData(Controls.kControlNoPart, + Controls.kControlPushButtonDefaultTag, data) + c.ShowControl() self._isdefault = onoff *************** *** 153,156 **** --- 177,184 ---- + class BevelButton(Button): + procID = Controls.kControlBevelButtonNormalBevelProc | Controls.useWFont + + class CheckBox(ControlWidget): *************** *** 251,261 **** def setmin(self, min): ! self._control.SetControl32BitMinimum(min) def setmax(self, max): ! self._control.SetControl32BitMaximum(max) ! def setviewsize(self, view): ! self._control.SetControlViewSize(view) def getmin(self): --- 279,298 ---- def setmin(self, min): ! if self._control is not None: ! self._control.SetControl32BitMinimum(min) ! else: ! self._min = min def setmax(self, max): ! if self._control is not None: ! self._control.SetControl32BitMaximum(max) ! else: ! self._max = max ! def setviewsize(self, viewsize): ! if self._control is not None: ! self._control.SetControlViewSize(viewsize) ! else: ! self._viewsize = viewsize def getmin(self): *************** *** 313,317 **** if self._visible: self._control.Draw1Control() ! Qd.FrameRect(self._bounds) def adjust(self, oldbounds): --- 350,354 ---- if self._visible: self._control.Draw1Control() ! #Qd.FrameRect(self._bounds) def adjust(self, oldbounds): From jackjansen@users.sourceforge.net Tue Nov 20 23:21:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:21:38 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wbase.py,1.7,1.7.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv8315/Python/Mac/Tools/IDE Modified Files: Tag: r22b2-branch Wbase.py Log Message: Merged Just's trunk changes. Index: Wbase.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wbase.py,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** Wbase.py 2001/11/02 19:09:34 1.7 --- Wbase.py 2001/11/20 23:21:36 1.7.2.1 *************** *** 1,3 **** ! from Carbon import Evt, Qd, QuickDraw, Win import string from types import * --- 1,3 ---- ! from Carbon import App, Evt, Qd, QuickDraw, Win import string from types import * *************** *** 330,342 **** if not self._parentwindow._hasselframes: return ! thickrect = Qd.InsetRect(self._bounds, -3, -3) ! state = Qd.GetPenState() ! Qd.PenSize(2, 2) ! if onoff: ! Qd.PenPat(Qd.qd.black) ! else: ! Qd.PenPat(Qd.qd.white) ! Qd.FrameRect(thickrect) ! Qd.SetPenState(state) def adjust(self, oldbounds): --- 330,334 ---- if not self._parentwindow._hasselframes: return ! App.DrawThemeFocusRect(self._bounds, onoff) def adjust(self, oldbounds): From jackjansen@users.sourceforge.net Tue Nov 20 23:21:44 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:21:44 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PyEdit.py,1.25,1.25.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv8354/Python/Mac/Tools/IDE Modified Files: Tag: r22b2-branch PyEdit.py Log Message: Merged Just's trunk changes. Index: PyEdit.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyEdit.py,v retrieving revision 1.25 retrieving revision 1.25.2.1 diff -C2 -d -r1.25 -r1.25.2.1 *** PyEdit.py 2001/11/02 22:55:15 1.25 --- PyEdit.py 2001/11/20 23:21:42 1.25.2.1 *************** *** 175,179 **** def setupwidgets(self, text): ! topbarheight = 28 popfieldwidth = 80 self.lastlineno = None --- 175,179 ---- def setupwidgets(self, text): ! topbarheight = 24 popfieldwidth = 80 self.lastlineno = None *************** *** 198,204 **** self.bevelbox = W.BevelBox((0, 0, 0, topbarheight)) self.hline = W.HorizontalLine((0, topbarheight, 0, 0)) ! self.infotext = W.TextBox((175, 7, -4, 14), backgroundcolor = (0xe000, 0xe000, 0xe000)) ! self.runbutton = W.Button((6, 5, 60, 16), runButtonLabels[0], self.run) ! self.runselbutton = W.Button((78, 5, 90, 16), runSelButtonLabels[0], self.runselection) # bind some keys --- 198,204 ---- self.bevelbox = W.BevelBox((0, 0, 0, topbarheight)) self.hline = W.HorizontalLine((0, topbarheight, 0, 0)) ! self.infotext = W.TextBox((175, 6, -4, 14), backgroundcolor = (0xe000, 0xe000, 0xe000)) ! self.runbutton = W.BevelButton((6, 4, 80, 16), runButtonLabels[0], self.run) ! self.runselbutton = W.BevelButton((90, 4, 80, 16), runSelButtonLabels[0], self.runselection) # bind some keys *************** *** 801,804 **** --- 801,805 ---- pattern = pattern + notwordcharspat return re.compile(pattern) + class SearchEngine: From jackjansen@users.sourceforge.net Tue Nov 20 23:21:49 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:21:49 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE W.py,1.3,1.3.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv8398/Python/Mac/Tools/IDE Modified Files: Tag: r22b2-branch W.py Log Message: Merged Just's trunk changes. Index: W.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/W.py,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -C2 -d -r1.3 -r1.3.2.1 *** W.py 2001/11/02 19:22:55 1.3 --- W.py 2001/11/20 23:21:47 1.3.2.1 *************** *** 32,36 **** def Message(text): ! import EasyDialogs, Qd, string Qd.InitCursor() text = string.replace(text, "\n", "\r") --- 32,37 ---- def Message(text): ! import EasyDialogs, string ! from Carbon import Qd Qd.InitCursor() text = string.replace(text, "\n", "\r") From jackjansen@users.sourceforge.net Tue Nov 20 23:21:54 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:21:54 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Wapplication.py,1.13,1.13.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv8419/Python/Mac/Tools/IDE Modified Files: Tag: r22b2-branch Wapplication.py Log Message: Merged Just's trunk changes. Index: Wapplication.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Wapplication.py,v retrieving revision 1.13 retrieving revision 1.13.8.1 diff -C2 -d -r1.13 -r1.13.8.1 *** Wapplication.py 2001/08/27 10:55:41 1.13 --- Wapplication.py 2001/11/20 23:21:52 1.13.8.1 *************** *** 10,14 **** from Carbon import Menu; MenuToolbox = Menu; del Menu ! KILLUNKNOWNWINDOWS=1 # Set to 0 for debugging. class Application(FrameWork.Application): --- 10,14 ---- from Carbon import Menu; MenuToolbox = Menu; del Menu ! KILLUNKNOWNWINDOWS = 0 # Set to 0 for debugging. class Application(FrameWork.Application): From jackjansen@users.sourceforge.net Tue Nov 20 23:22:35 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:22:35 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules _hotshot.c,1.9,1.9.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv8604/Python/Modules Modified Files: Tag: r22b2-branch _hotshot.c Log Message: Use #include "", not #include <>, to get at Python include files. Index: _hotshot.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_hotshot.c,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -C2 -d -r1.9 -r1.9.2.1 *** _hotshot.c 2001/11/09 15:59:36 1.9 --- _hotshot.c 2001/11/20 23:22:33 1.9.2.1 *************** *** 3,11 **** */ ! #include ! #include ! #include ! #include ! #include #ifdef HAVE_UNISTD_H --- 3,11 ---- */ ! #include "Python.h" ! #include "compile.h" ! #include "eval.h" ! #include "frameobject.h" ! #include "structmember.h" #ifdef HAVE_UNISTD_H From jackjansen@users.sourceforge.net Tue Nov 20 23:22:00 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:22:00 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PyDebugger.py,1.7,1.7.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv8446/Python/Mac/Tools/IDE Modified Files: Tag: r22b2-branch PyDebugger.py Log Message: Merged Just's trunk changes. Index: PyDebugger.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyDebugger.py,v retrieving revision 1.7 retrieving revision 1.7.8.1 diff -C2 -d -r1.7 -r1.7.8.1 *** PyDebugger.py 2001/08/25 12:09:39 1.7 --- PyDebugger.py 2001/11/20 23:21:58 1.7.8.1 *************** *** 682,686 **** def __init__(self, debugger): self.debugger = debugger - import Lists self.w = W.Window((300, 250), 'Breakpoints', minsize = (200, 200)) self.w.panes = W.HorizontalPanes((8, 8, -8, -32), (0.3, 0.7)) --- 682,685 ---- From jackjansen@users.sourceforge.net Tue Nov 20 23:22:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Tue, 20 Nov 2001 15:22:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE PyBrowser.py,1.11,1.11.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv8500/Python/Mac/Tools/IDE Modified Files: Tag: r22b2-branch PyBrowser.py Log Message: Merged Just's trunk changes. Index: PyBrowser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/PyBrowser.py,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** PyBrowser.py 2001/11/02 19:21:34 1.11 --- PyBrowser.py 2001/11/20 23:22:03 1.11.2.1 *************** *** 144,147 **** --- 144,148 ---- #W.SetCursor('fist') while Evt.Button(): + Evt.WaitNextEvent(0, 1, None) # needed for OSX (x, y) = Evt.GetMouse() if (x, y) <> lastpoint: *************** *** 308,312 **** self.w = w = W.Window((300, 400), title, minsize = (100, 100)) w.info = W.TextBox((18, 8, -70, 15)) ! w.updatebutton = W.Button((-64, 4, 50, 16), 'Update', self.update) w.browser = BrowserWidget((-1, 24, 1, -14), None) w.bind('cmdu', w.updatebutton.push) --- 309,313 ---- self.w = w = W.Window((300, 400), title, minsize = (100, 100)) w.info = W.TextBox((18, 8, -70, 15)) ! w.updatebutton = W.BevelButton((-64, 4, 50, 16), 'Update', self.update) w.browser = BrowserWidget((-1, 24, 1, -14), None) w.bind('cmdu', w.updatebutton.push) From anthonybaxter@users.sourceforge.net Wed Nov 21 03:51:22 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Tue, 20 Nov 2001 19:51:22 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python sysmodule.c,2.85,2.85.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv31094 Modified Files: Tag: release21-maint sysmodule.c Log Message: backport of 2.90: Patch number #422106 by Greg Ball, to fix segmentation fault in sys.displayhook. Index: sysmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v retrieving revision 2.85 retrieving revision 2.85.2.1 diff -C2 -d -r2.85 -r2.85.2.1 *** sysmodule.c 2001/04/10 22:07:43 2.85 --- sysmodule.c 2001/11/21 03:51:20 2.85.2.1 *************** *** 76,79 **** --- 76,84 ---- PyObject *builtins = PyDict_GetItemString(modules, "__builtin__"); + if (builtins == NULL) { + PyErr_SetString(PyExc_RuntimeError, "lost __builtin__"); + return NULL; + } + /* parse arguments */ if (!PyArg_ParseTuple(args, "O:displayhook", &o)) From anthonybaxter@users.sourceforge.net Wed Nov 21 04:49:21 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Tue, 20 Nov 2001 20:49:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.238.2.3,2.238.2.4 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv9431 Modified Files: Tag: release21-maint ceval.c Log Message: backport of 2.242: improved error message-- names the type of the unexpected object Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.238.2.3 retrieving revision 2.238.2.4 diff -C2 -d -r2.238.2.3 -r2.238.2.4 *** ceval.c 2001/10/21 05:57:28 2.238.2.3 --- ceval.c 2001/11/21 04:49:19 2.238.2.4 *************** *** 2471,2476 **** /* Not something you can raise. You get an exception anyway, just not what you specified :-) */ ! PyErr_SetString(PyExc_TypeError, ! "exceptions must be strings, classes, or instances"); goto raise_error; } --- 2471,2477 ---- /* Not something you can raise. You get an exception anyway, just not what you specified :-) */ ! PyErr_Format(PyExc_TypeError, ! "exceptions must be strings, classes, or " ! "instances, not %s", type->ob_type->tp_name); goto raise_error; } From anthonybaxter@users.sourceforge.net Wed Nov 21 04:58:39 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Tue, 20 Nov 2001 20:58:39 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python dynload_next.c,2.7,2.7.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv11381 Modified Files: Tag: release21-maint dynload_next.c Log Message: backport of 2.8 by jack: Patch by Jonathan Wight (slightly reformatted) to forestall loading the same module twice, which apparently crashes Python. I could not test the error condition, but in normal life it seems to have no adverse effects. Also removed an unsued variable, and corrected 2 glaring errors (missing 'case' in front of a label). Index: dynload_next.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_next.c,v retrieving revision 2.7 retrieving revision 2.7.6.1 diff -C2 -d -r2.7 -r2.7.6.1 *** dynload_next.c 2000/09/01 23:29:28 2.7 --- dynload_next.c 2001/11/21 04:58:37 2.7.6.1 *************** *** 120,131 **** NSModule newModule; NSSymbol theSym; - void *symaddr; const char *errString; rc = NSCreateObjectFileImageFromFile(pathname, &image); switch(rc) { default: case NSObjectFileImageFailure: ! NSObjectFileImageFormat: /* for these a message is printed on stderr by dyld */ errString = "Can't create object file image"; --- 120,135 ---- NSModule newModule; NSSymbol theSym; const char *errString; + if (NSIsSymbolNameDefined(funcname)) { + theSym = NSLookupAndBindSymbol(funcname); + p = (dl_funcptr)NSAddressOfSymbol(theSym); + return p; + } rc = NSCreateObjectFileImageFromFile(pathname, &image); switch(rc) { default: case NSObjectFileImageFailure: ! case NSObjectFileImageFormat: /* for these a message is printed on stderr by dyld */ errString = "Can't create object file image"; *************** *** 140,144 **** errString = "Wrong CPU type in object file"; break; ! NSObjectFileImageAccess: errString = "Can't read object file (no access)"; break; --- 144,148 ---- errString = "Wrong CPU type in object file"; break; ! case NSObjectFileImageAccess: errString = "Can't read object file (no access)"; break; From anthonybaxter@users.sourceforge.net Wed Nov 21 05:01:46 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Tue, 20 Nov 2001 21:01:46 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python dynload_shlib.c,2.8,2.8.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv11878 Modified Files: Tag: release21-maint dynload_shlib.c Log Message: backport of patches 2.10, 2.11, 2.12, by MvL. . Patch #455231: Support ELF properly on OpenBSD. . Patch to bug #472202: Correctly recognize NetBSD before 199712. . Move dlfcn.h block out of NetBSD block, assuming that NetBSD before 199712 didn't have dlfcn.h, or that it wouldn't conflict with the other stuff defined. Index: dynload_shlib.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_shlib.c,v retrieving revision 2.8 retrieving revision 2.8.4.1 diff -C2 -d -r2.8 -r2.8.4.1 *** dynload_shlib.c 2001/01/10 21:17:27 2.8 --- dynload_shlib.c 2001/11/21 05:01:44 2.8.4.1 *************** *** 7,21 **** #include #include ! #if defined(__NetBSD__) && (NetBSD < 199712) #include #include #define dlerror() "error in dynamic linking" ! #else #ifdef HAVE_DLFCN_H #include #endif - #endif ! #ifdef __OpenBSD__ #define LEAD_UNDERSCORE "_" #else --- 7,25 ---- #include #include ! ! #if defined(__NetBSD__) ! #include ! #if (NetBSD < 199712) #include #include #define dlerror() "error in dynamic linking" ! #endif ! #endif /* NetBSD */ ! #ifdef HAVE_DLFCN_H #include #endif ! #if (defined(__OpenBSD__) || defined(__NetBSD__)) && !defined(__ELF__) #define LEAD_UNDERSCORE "_" #else From anthonybaxter@users.sourceforge.net Wed Nov 21 05:37:34 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Tue, 20 Nov 2001 21:37:34 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python dynload_win.c,2.7,2.7.6.1 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv17734 Modified Files: Tag: release21-maint dynload_win.c Log Message: backport of 2.8, after checking with MarkH . Always pass a full path name to LoadLibraryEx(). Fixes some Windows 9x problems. As discussed on python-dev Index: dynload_win.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_win.c,v retrieving revision 2.7 retrieving revision 2.7.6.1 diff -C2 -d -r2.7 -r2.7.6.1 *** dynload_win.c 2000/10/05 10:54:45 2.7 --- dynload_win.c 2001/11/21 05:37:32 2.7.6.1 *************** *** 164,185 **** #ifdef MS_WIN32 { ! HINSTANCE hDLL; char pathbuf[260]; ! if (strchr(pathname, '\\') == NULL && ! strchr(pathname, '/') == NULL) ! { ! /* Prefix bare filename with ".\" */ ! char *p = pathbuf; ! *p = '\0'; ! _getcwd(pathbuf, sizeof pathbuf); ! if (*p != '\0' && p[1] == ':') ! p += 2; ! sprintf(p, ".\\%-.255s", pathname); ! pathname = pathbuf; ! } ! /* Look for dependent DLLs in directory of pathname first */ ! /* XXX This call doesn't exist in Windows CE */ ! hDLL = LoadLibraryEx(pathname, NULL, ! LOAD_WITH_ALTERED_SEARCH_PATH); if (hDLL==NULL){ char errBuf[256]; --- 164,182 ---- #ifdef MS_WIN32 { ! HINSTANCE hDLL = NULL; char pathbuf[260]; ! LPTSTR dummy; ! /* We use LoadLibraryEx so Windows looks for dependent DLLs ! in directory of pathname first. However, Windows95 ! can sometimes not work correctly unless the absolute ! path is used. If GetFullPathName() fails, the LoadLibrary ! will certainly fail too, so use its error code */ ! if (GetFullPathName(pathname, ! sizeof(pathbuf), ! pathbuf, ! &dummy)) ! /* XXX This call doesn't exist in Windows CE */ ! hDLL = LoadLibraryEx(pathname, NULL, ! LOAD_WITH_ALTERED_SEARCH_PATH); if (hDLL==NULL){ char errBuf[256]; From anthonybaxter@users.sourceforge.net Wed Nov 21 05:41:05 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Tue, 20 Nov 2001 21:41:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python errors.c,2.62,2.62.4.1 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv18250 Modified Files: Tag: release21-maint errors.c Log Message: backport of tim's 2.66: . SF bug [#467265] Compile errors on SuSe Linux on IBM/s390. - errors.c, PyErr_Format: add a va_end() to balance the va_start(). Index: errors.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/errors.c,v retrieving revision 2.62 retrieving revision 2.62.4.1 diff -C2 -d -r2.62 -r2.62.4.1 *** errors.c 2001/03/06 12:12:02 2.62 --- errors.c 2001/11/21 05:41:03 2.62.4.1 *************** *** 510,514 **** PyErr_SetObject(exception, string); Py_XDECREF(string); ! return NULL; } --- 510,514 ---- PyErr_SetObject(exception, string); Py_XDECREF(string); ! va_end(vargs); return NULL; } From anthonybaxter@users.sourceforge.net Wed Nov 21 06:21:20 2001 From: anthonybaxter@users.sourceforge.net (Anthony Baxter) Date: Tue, 20 Nov 2001 22:21:20 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python compile.c,2.196.2.2,2.196.2.3 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv24579 Modified Files: Tag: release21-maint compile.c Log Message: backport of jeremy's 2.227: Fix for SF bug [ #471928 ] global made w/nested list comprehensions . Initially I was going to just rip out the bits of this that fixed this bug, but the rest of the code looks (after a fair amount of staring at it) like it's ok - variable renames, that sort of thing. flames and "hey, no way!" to me, or to python-dev. It felt safer to just go with the full patch, rather than butchering it. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.196.2.2 retrieving revision 2.196.2.3 diff -C2 -d -r2.196.2.2 -r2.196.2.3 *** compile.c 2001/06/27 14:04:03 2.196.2.2 --- compile.c 2001/11/21 06:21:18 2.196.2.3 *************** *** 4824,4828 **** symtable_node(struct symtable *st, node *n) { ! int i, start = 0; loop: --- 4824,4828 ---- symtable_node(struct symtable *st, node *n) { ! int i; loop: *************** *** 4930,4939 **** } goto loop; ! /* watchout for fall-through logic below */ case argument: ! if (NCH(n) == 3) { n = CHILD(n, 2); goto loop; } case listmaker: if (NCH(n) > 1 && TYPE(CHILD(n, 1)) == list_for) { --- 4930,4965 ---- } goto loop; ! case list_iter: ! n = CHILD(n, 0); ! if (TYPE(n) == list_for) { ! st->st_tmpname++; ! symtable_list_comprehension(st, n); ! st->st_tmpname--; ! } else { ! REQ(n, list_if); ! symtable_node(st, CHILD(n, 1)); ! if (NCH(n) == 3) { ! n = CHILD(n, 2); ! goto loop; ! } ! } ! break; ! case for_stmt: ! symtable_assign(st, CHILD(n, 1), 0); ! for (i = 3; i < NCH(n); ++i) ! if (TYPE(CHILD(n, i)) >= single_input) ! symtable_node(st, CHILD(n, i)); ! break; ! /* The remaining cases fall through to default except in ! special circumstances. This requires the individual cases ! to be coded with great care, even though they look like ! rather innocuous. Each case must double-check TYPE(n). ! */ case argument: ! if (TYPE(n) == argument && NCH(n) == 3) { n = CHILD(n, 2); goto loop; } + /* fall through */ case listmaker: if (NCH(n) > 1 && TYPE(CHILD(n, 1)) == list_for) { *************** *** 4942,4947 **** symtable_node(st, CHILD(n, 0)); st->st_tmpname--; ! return; } case atom: if (TYPE(n) == atom && TYPE(CHILD(n, 0)) == NAME) { --- 4968,4974 ---- symtable_node(st, CHILD(n, 0)); st->st_tmpname--; ! break; } + /* fall through */ case atom: if (TYPE(n) == atom && TYPE(CHILD(n, 0)) == NAME) { *************** *** 4949,4963 **** break; } ! case for_stmt: ! if (TYPE(n) == for_stmt) { ! symtable_assign(st, CHILD(n, 1), 0); ! start = 3; ! } default: if (NCH(n) == 1) { n = CHILD(n, 0); goto loop; } ! for (i = start; i < NCH(n); ++i) if (TYPE(CHILD(n, i)) >= single_input) symtable_node(st, CHILD(n, i)); --- 4976,4989 ---- break; } ! /* fall through */ default: + /* Walk over every non-token child with a special case + for one child. + */ if (NCH(n) == 1) { n = CHILD(n, 0); goto loop; } ! for (i = 0; i < NCH(n); ++i) if (TYPE(CHILD(n, i)) >= single_input) symtable_node(st, CHILD(n, i)); *************** *** 5190,5195 **** } static void ! symtable_assign(struct symtable *st, node *n, int flag) { node *tmp; --- 5216,5227 ---- } + /* The third argument to symatble_assign() is a flag to be passed to + symtable_add_def() if it is eventually called. The flag is useful + to specify the particular type of assignment that should be + recorded, e.g. an assignment caused by import. + */ + static void ! symtable_assign(struct symtable *st, node *n, int def_flag) { node *tmp; *************** *** 5223,5227 **** } else { for (i = 0; i < NCH(n); i += 2) ! symtable_assign(st, CHILD(n, i), flag); } return; --- 5255,5259 ---- } else { for (i = 0; i < NCH(n); i += 2) ! symtable_assign(st, CHILD(n, i), def_flag); } return; *************** *** 5235,5239 **** int i; for (i = 0; i < NCH(n); i += 2) ! symtable_assign(st, CHILD(n, i), flag); return; } --- 5267,5271 ---- int i; for (i = 0; i < NCH(n); i += 2) ! symtable_assign(st, CHILD(n, i), def_flag); return; } *************** *** 5247,5251 **** if (strcmp(STR(tmp), "__debug__") == 0) symtable_warn(st, ASSIGN_DEBUG); ! symtable_add_def(st, STR(tmp), DEF_LOCAL | flag); } return; --- 5279,5283 ---- if (strcmp(STR(tmp), "__debug__") == 0) symtable_warn(st, ASSIGN_DEBUG); ! symtable_add_def(st, STR(tmp), DEF_LOCAL | def_flag); } return; *************** *** 5253,5268 **** if (NCH(n) == 3) symtable_add_def(st, STR(CHILD(n, 2)), ! DEF_LOCAL | flag); else symtable_add_def(st, STR(CHILD(CHILD(n, 0), 0)), ! DEF_LOCAL | flag); return; case dotted_name: ! symtable_add_def(st, STR(CHILD(n, 0)), DEF_LOCAL | flag); return; case NAME: ! symtable_add_def(st, STR(n), DEF_LOCAL | flag); return; default: --- 5285,5300 ---- if (NCH(n) == 3) symtable_add_def(st, STR(CHILD(n, 2)), ! DEF_LOCAL | def_flag); else symtable_add_def(st, STR(CHILD(CHILD(n, 0), 0)), ! DEF_LOCAL | def_flag); return; case dotted_name: ! symtable_add_def(st, STR(CHILD(n, 0)), DEF_LOCAL | def_flag); return; case NAME: ! symtable_add_def(st, STR(n), DEF_LOCAL | def_flag); return; default: *************** *** 5277,5281 **** for (i = 0; i < NCH(n); ++i) if (TYPE(CHILD(n, i)) >= single_input) ! symtable_assign(st, CHILD(n, i), flag); } } --- 5309,5313 ---- for (i = 0; i < NCH(n); ++i) if (TYPE(CHILD(n, i)) >= single_input) ! symtable_assign(st, CHILD(n, i), def_flag); } } From lemburg@users.sourceforge.net Fri Nov 23 10:10:37 2001 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Fri, 23 Nov 2001 02:10:37 -0800 Subject: [Python-checkins] CVS: python/nondist/peps pep-0275.txt,1.1,1.2 Message-ID: Update of /cvsroot/python/python/nondist/peps In directory usw-pr-cvs1:/tmp/cvs-serv16091 Modified Files: pep-0275.txt Log Message: New revision. Incoporates a lot of comments from python-dev. Index: pep-0275.txt =================================================================== RCS file: /cvsroot/python/python/nondist/peps/pep-0275.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** pep-0275.txt 2001/11/12 09:11:37 1.1 --- pep-0275.txt 2001/11/23 10:10:35 1.2 *************** *** 2,6 **** Title: Switching on Multiple Values Version: $Revision$ ! Author: mal@lemburg.com (Marc-Andre Lemburg) Status: Draft Type: Standards Track --- 2,6 ---- Title: Switching on Multiple Values Version: $Revision$ ! Author: mal@lemburg.com (Marc-André Lemburg) Status: Draft Type: Standards Track *************** *** 73,102 **** involve some run-time overhead to assure that the switching variable is immutable and hashable. - - Solution 1: Optimizing if-elif-else ! XXX This section currently only sketches the design. ! ! Issues: ! ! The new optimization should not change the current Python ! semantics (by reducing the number of __cmp__ calls and adding ! __hash__ calls in if-elif-else constructs which are affected ! by the optimiztation). To assure this, switching can only ! safely be implemented either if a "from __future__" style ! flag is used, or the switching variable is one of the builtin ! immutable types: int, float, string, unicode, etc. (not ! subtypes, since it's not clear whether these are still ! immutable or not) ! ! To prevent post-modifications of the jump-table dictionary ! (which could be used to reach protected code), the jump-table ! will have to be a read-only type (e.g. a read-only ! dictionary). ! The optimization should only be used for if-elif-else ! constructs which have a minimum number of n cases (where n is ! a number which has yet to be defined depending on performance ! tests). Implementation: --- 73,84 ---- involve some run-time overhead to assure that the switching variable is immutable and hashable. ! Both solutions use a dictionary lookup to find the right ! jump location, so they both share the same problem space in ! terms of requiring that both the switch variable and the ! constants need to be compatible to the dictionary implementation ! (hashable, comparable, a==b => hash(a)==hash(b)). ! Solution 1: Optimizing if-elif-else Implementation: *************** *** 128,137 **** code stream. ! Solutions 2: Adding a switch statement to Python ! XXX This section currently only sketches the design. ! Syntax: switch EXPR: case CONSTANT: --- 110,139 ---- code stream. ! Issues: ! The new optimization should not change the current Python ! semantics (by reducing the number of __cmp__ calls and adding ! __hash__ calls in if-elif-else constructs which are affected ! by the optimiztation). To assure this, switching can only ! safely be implemented either if a "from __future__" style ! flag is used, or the switching variable is one of the builtin ! immutable types: int, float, string, unicode, etc. (not ! subtypes, since it's not clear whether these are still ! immutable or not) ! To prevent post-modifications of the jump-table dictionary ! (which could be used to reach protected code), the jump-table ! will have to be a read-only type (e.g. a read-only ! dictionary). + The optimization should only be used for if-elif-else + constructs which have a minimum number of n cases (where n is + a number which has yet to be defined depending on performance + tests). + + Solution 2: Adding a switch statement to Python + + New Syntax: + switch EXPR: case CONSTANT: *************** *** 146,150 **** The "else" part is optional. If no else part is given and ! none of the defined cases matches, a ValueError is raised. Implementation: --- 148,159 ---- The "else" part is optional. If no else part is given and ! none of the defined cases matches, no action is taken and ! the switch statement is ignored. This is in line with the ! current if-behaviour. A user who wants to signal this ! situation using an exception can define an else-branch ! which then implements the intended action. ! ! Note that the constants need not be all of the same type, but ! they should be comparable to the type of the switch variable. Implementation: *************** *** 195,198 **** --- 204,210 ---- depending on 'x'. + Thomas Wouters has written a patch which demonstrates the + above. You can download it from [1]. + Issues: *************** *** 239,243 **** SUITE ! The switch statement could be extended to allow tuples of values for one section (e.g. case 'a', 'b', 'c': ...). Another proposed extension would allow ranges of values (e.g. case --- 251,255 ---- SUITE ! The switch statement could be extended to allow multiple values for one section (e.g. case 'a', 'b', 'c': ...). Another proposed extension would allow ranges of values (e.g. case *************** *** 245,250 **** kept in mind when designing and implementing a first version. ! Examples: switch EXPR: switch x: case CONSTANT: case "first": --- 257,266 ---- kept in mind when designing and implementing a first version. ! Examples: + The following examples all use a new syntax as proposed by + solution 2. However, all of these examples would work with + solution 1 as well. + switch EXPR: switch x: case CONSTANT: case "first": *************** *** 282,288 **** ... print "done" else: break # out of loop! ! SUITE else: ! print "middle state" ! state = next_state(state) Scope --- 298,313 ---- ... print "done" else: break # out of loop! ! SUITE else: ! print "middle state" ! state = next_state(state) ! ! Here's another nice application found by Jack Jansen (switching ! on argument types): ! ! switch type(x).__name__: ! case 'int': ! SUITE ! case 'string': ! SUITE Scope *************** *** 297,300 **** --- 322,330 ---- Donald Beaudry (switch syntax) Greg Ewing (switch syntax) + Jack Jansen (type switching examples) + + References + + [1] https://sourceforge.net/tracker/index.php?func=detail&aid=481118&group_id=5470&atid=305470 Copyright From loewis@users.sourceforge.net Sat Nov 24 09:24:53 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 24 Nov 2001 01:24:53 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libgc.tex,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv16042/Doc/lib Modified Files: libgc.tex Log Message: Rename get_referents to get_referrers. Fixes #483815. Index: libgc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libgc.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** libgc.tex 2001/11/18 04:51:17 1.7 --- libgc.tex 2001/11/24 09:24:51 1.8 *************** *** 79,82 **** --- 79,89 ---- \end{funcdesc} + \begin{funcdesc}{get_referrers}{*objs} + Return the list of objects that directly refer to any of objs. This + function will only locate those containers which support garbage + collection; extension types which do refer to other objects but do not + support garbage collection will not be found. + \versionadded{2.2} + \end{funcdesc} The following variable is provided for read-only access (you can From loewis@users.sourceforge.net Sat Nov 24 09:24:53 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 24 Nov 2001 01:24:53 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.317,1.318 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv16042/Misc Modified Files: NEWS Log Message: Rename get_referents to get_referrers. Fixes #483815. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.317 retrieving revision 1.318 diff -C2 -d -r1.317 -r1.318 *** NEWS 2001/11/17 00:21:57 1.317 --- NEWS 2001/11/24 09:24:51 1.318 *************** *** 9,12 **** --- 9,14 ---- Extension modules + - gc.get_referents was renamed to gc.get_referrers. + Library *************** *** 905,908 **** --- 907,912 ---- - The `new' module now exposes the CO_xxx flags. + + - The gc module offers the get_referents function. New platforms From loewis@users.sourceforge.net Sat Nov 24 09:24:53 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 24 Nov 2001 01:24:53 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules gcmodule.c,2.29,2.30 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv16042/Modules Modified Files: gcmodule.c Log Message: Rename get_referents to get_referrers. Fixes #483815. Index: gcmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gcmodule.c,v retrieving revision 2.29 retrieving revision 2.30 diff -C2 -d -r2.29 -r2.30 *** gcmodule.c 2001/11/01 19:35:45 2.29 --- gcmodule.c 2001/11/24 09:24:51 2.30 *************** *** 649,653 **** static int ! referentsvisit(PyObject* obj, PyObject *objs) { if (PySequence_Contains(objs, obj)) { --- 649,653 ---- static int ! referrersvisit(PyObject* obj, PyObject *objs) { if (PySequence_Contains(objs, obj)) { *************** *** 658,662 **** static int ! gc_referents_for(PyObject *objs, PyGC_Head *list, PyObject *resultlist) { PyGC_Head *gc; --- 658,662 ---- static int ! gc_referrers_for(PyObject *objs, PyGC_Head *list, PyObject *resultlist) { PyGC_Head *gc; *************** *** 668,672 **** if (obj == objs || obj == resultlist) continue; ! if (traverse(obj, (visitproc)referentsvisit, objs)) { if (PyList_Append(resultlist, obj) < 0) return 0; /* error */ --- 668,672 ---- if (obj == objs || obj == resultlist) continue; ! if (traverse(obj, (visitproc)referrersvisit, objs)) { if (PyList_Append(resultlist, obj) < 0) return 0; /* error */ *************** *** 676,690 **** } ! 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); ! if (!(gc_referents_for(args, &_PyGC_generation0, result) && ! gc_referents_for(args, &generation1, result) && ! gc_referents_for(args, &generation2, result))) { Py_DECREF(result); return NULL; --- 676,690 ---- } ! static char gc_get_referrers__doc__[]= ! "get_referrers(*objs) -> list\n\ Return the list of objects that directly refer to any of objs."; static PyObject * ! gc_get_referrers(PyObject *self, PyObject *args) { PyObject *result = PyList_New(0); ! if (!(gc_referrers_for(args, &_PyGC_generation0, result) && ! gc_referrers_for(args, &generation1, result) && ! gc_referrers_for(args, &generation2, result))) { Py_DECREF(result); return NULL; *************** *** 741,745 **** "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" ; --- 741,745 ---- "get_threshold() -- Return the current the collection thresholds.\n" "get_objects() -- Return a list of all objects tracked by the collector.\n" ! "get_referrers() -- Return the list of objects that refer to an object.\n" ; *************** *** 754,759 **** {"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__}, {NULL, NULL} /* Sentinel */ }; --- 754,759 ---- {"collect", gc_collect, METH_VARARGS, gc_collect__doc__}, {"get_objects", gc_get_objects,METH_VARARGS, gc_get_objects__doc__}, ! {"get_referrers", gc_get_referrers, METH_VARARGS, ! gc_get_referrers__doc__}, {NULL, NULL} /* Sentinel */ }; From loewis@users.sourceforge.net Sat Nov 24 09:28:44 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 24 Nov 2001 01:28:44 -0800 Subject: [Python-checkins] CVS: python/dist/src setup.py,1.64,1.65 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv16659 Modified Files: setup.py Log Message: Support bsddb 3.2. Fixes #483653. Index: setup.py =================================================================== RCS file: /cvsroot/python/python/dist/src/setup.py,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** setup.py 2001/11/01 14:44:15 1.64 --- setup.py 2001/11/24 09:28:42 1.65 *************** *** 391,395 **** dblib = [] ! if self.compiler.find_library_file(lib_dirs, 'db-3.1'): dblib = ['db-3.1'] elif self.compiler.find_library_file(lib_dirs, 'db3'): --- 391,397 ---- dblib = [] ! if self.compiler.find_library_file(lib_dirs, 'db-3.2'): ! dblib = ['db-3.2'] ! elif self.compiler.find_library_file(lib_dirs, 'db-3.1'): dblib = ['db-3.1'] elif self.compiler.find_library_file(lib_dirs, 'db3'): From loewis@users.sourceforge.net Sat Nov 24 09:31:46 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 24 Nov 2001 01:31:46 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.207,2.208 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv17007 Modified Files: posixmodule.c Log Message: Correct typo. Fixes #484611. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.207 retrieving revision 2.208 diff -C2 -d -r2.207 -r2.208 *** posixmodule.c 2001/11/02 23:59:11 2.207 --- posixmodule.c 2001/11/24 09:31:44 2.208 *************** *** 1696,1700 **** } else { ! PyErr_SetString(PyExc_TypeError, "spawmv() arg 2 must be a tuple or list"); return NULL; } --- 1696,1700 ---- } else { ! PyErr_SetString(PyExc_TypeError, "spawnv() arg 2 must be a tuple or list"); return NULL; } From loewis@users.sourceforge.net Sat Nov 24 09:39:08 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sat, 24 Nov 2001 01:39:08 -0800 Subject: [Python-checkins] CVS: python/dist/src Makefile.pre.in,1.66,1.67 Message-ID: Update of /cvsroot/python/python/dist/src In directory usw-pr-cvs1:/tmp/cvs-serv17729 Modified Files: Makefile.pre.in Log Message: Add hotshot to LIBSUBDIRS. Fixes #484642. Index: Makefile.pre.in =================================================================== RCS file: /cvsroot/python/python/dist/src/Makefile.pre.in,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** Makefile.pre.in 2001/10/26 19:48:06 1.66 --- Makefile.pre.in 2001/11/24 09:39:05 1.67 *************** *** 582,586 **** XMLLIBSUBDIRS= xml xml/dom xml/parsers xml/sax LIBSUBDIRS= lib-old lib-tk site-packages test test/output encodings \ ! email compiler \ distutils distutils/command $(XMLLIBSUBDIRS) curses $(MACHDEPS) libinstall: $(PYTHON) $(srcdir)/Lib/$(PLATDIR) --- 582,586 ---- XMLLIBSUBDIRS= xml xml/dom xml/parsers xml/sax LIBSUBDIRS= lib-old lib-tk site-packages test test/output encodings \ ! email compiler hotshot \ distutils distutils/command $(XMLLIBSUBDIRS) curses $(MACHDEPS) libinstall: $(PYTHON) $(srcdir)/Lib/$(PLATDIR) From gward@users.sourceforge.net Sat Nov 24 15:49:55 2001 From: gward@users.sourceforge.net (Greg Ward) Date: Sat, 24 Nov 2001 07:49:55 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/email Message.py,1.7,1.8 MIMEAudio.py,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv15719 Modified Files: Message.py MIMEAudio.py Log Message: Docstring typo fix. Index: Message.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Message.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Message.py 2001/11/05 19:19:55 1.7 --- Message.py 2001/11/24 15:49:53 1.8 *************** *** 227,231 **** These will be sorted in the order they appeared in the original message, and may contain duplicates. Any fields deleted and ! re-inserted are alwyas appended to the header list. If no such fields exist, failobj is returned (defaults to None). --- 227,231 ---- These will be sorted in the order they appeared in the original message, and may contain duplicates. Any fields deleted and ! re-inserted are always appended to the header list. If no such fields exist, failobj is returned (defaults to None). Index: MIMEAudio.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/MIMEAudio.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** MIMEAudio.py 2001/10/09 19:41:18 1.1 --- MIMEAudio.py 2001/11/24 15:49:53 1.2 *************** *** 47,51 **** _audiodata is a string containing the raw audio data. If this data can be decoded by the standard Python `sndhdr' module, then the ! subtype will be automatically included in the Content-TYpe: header. Otherwise, you can specify the specific audio subtype via the _subtype parameter. If _subtype is not given, and no subtype can be --- 47,51 ---- _audiodata is a string containing the raw audio data. If this data can be decoded by the standard Python `sndhdr' module, then the ! subtype will be automatically included in the Content-Type: header. Otherwise, you can specify the specific audio subtype via the _subtype parameter. If _subtype is not given, and no subtype can be From bwarsaw@users.sourceforge.net Sat Nov 24 16:56:58 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Sat, 24 Nov 2001 08:56:58 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/email Message.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/email In directory usw-pr-cvs1:/tmp/cvs-serv29687 Modified Files: Message.py Log Message: More typo fixes. Index: Message.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/email/Message.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Message.py 2001/11/24 15:49:53 1.8 --- Message.py 2001/11/24 16:56:56 1.9 *************** *** 193,197 **** These will be sorted in the order they appeared in the original message, and may contain duplicates. Any fields deleted and ! re-inserted are alwyas appended to the header list. """ return [v for k, v in self._headers] --- 193,197 ---- These will be sorted in the order they appeared in the original message, and may contain duplicates. Any fields deleted and ! re-inserted are always appended to the header list. """ return [v for k, v in self._headers] *************** *** 202,206 **** These will be sorted in the order they appeared in the original message, and may contain duplicates. Any fields deleted and ! re-inserted are alwyas appended to the header list. """ return self._headers[:] --- 202,206 ---- These will be sorted in the order they appeared in the original message, and may contain duplicates. Any fields deleted and ! re-inserted are always appended to the header list. """ return self._headers[:] From gvanrossum@users.sourceforge.net Sat Nov 24 18:24:49 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 24 Nov 2001 10:24:49 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects abstract.c,2.92,2.93 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv15660 Modified Files: abstract.c Log Message: PyObject_GetItem(), PyObject_SetItem(), PyObject_DelItem(): Fix a few confusing error messages. If a new-style class has no sequence or mapping behavior, attempting to use the indexing notation with a non-integer key would complain that the sequence index must be an integer, rather than complaining that the operation is not supported. Index: abstract.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/abstract.c,v retrieving revision 2.92 retrieving revision 2.93 diff -C2 -d -r2.92 -r2.93 *** abstract.c 2001/11/09 21:59:42 2.92 --- abstract.c 2001/11/24 18:24:47 2.93 *************** *** 104,108 **** return PySequence_GetItem(o, key_value); } ! return type_error("sequence index must be integer"); } --- 104,109 ---- return PySequence_GetItem(o, key_value); } ! else if (o->ob_type->tp_as_sequence->sq_item) ! return type_error("sequence index must be integer"); } *************** *** 132,137 **** return PySequence_SetItem(o, key_value, value); } ! type_error("sequence index must be integer"); ! return -1; } --- 133,140 ---- return PySequence_SetItem(o, key_value, value); } ! else if (o->ob_type->tp_as_sequence->sq_ass_item) { ! type_error("sequence index must be integer"); ! return -1; ! } } *************** *** 162,167 **** return PySequence_DelItem(o, key_value); } ! type_error("sequence index must be integer"); ! return -1; } --- 165,172 ---- return PySequence_DelItem(o, key_value); } ! else if (o->ob_type->tp_as_sequence->sq_ass_item) { ! type_error("sequence index must be integer"); ! return -1; ! } } From gvanrossum@users.sourceforge.net Sat Nov 24 21:04:33 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 24 Nov 2001 13:04:33 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib copy_reg.py,1.8,1.9 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv15720 Modified Files: copy_reg.py Log Message: _reduce(): - Fix for SF bug #482752: __getstate__ & __setstate__ ignored (by Anon.) In fact, only __getstate__ isn't recognized. This fixes that. - Separately, the test for base.__flags__ & _HEAPTYPE raised an AttributeError exception when a classic class was amongst the bases. Fixed this with a hasattr() bandaid (classic classes never qualify as the "hard" base class anyway, which is what the code is trying to find). Index: copy_reg.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/copy_reg.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** copy_reg.py 2001/09/28 18:13:29 1.8 --- copy_reg.py 2001/11/24 21:04:31 1.9 *************** *** 47,51 **** def _reduce(self): for base in self.__class__.__mro__: ! if not base.__flags__ & _HEAPTYPE: break else: --- 47,51 ---- def _reduce(self): for base in self.__class__.__mro__: ! if hasattr(base, '__flags__') and not base.__flags__ & _HEAPTYPE: break else: *************** *** 57,63 **** args = (self.__class__, base, state) try: ! dict = self.__dict__ except AttributeError: ! dict = None if dict: return _reconstructor, args, dict --- 57,68 ---- args = (self.__class__, base, state) try: ! getstate = self.__getstate__ except AttributeError: ! try: ! dict = self.__dict__ ! except AttributeError: ! dict = None ! else: ! dict = getstate() if dict: return _reconstructor, args, dict From gvanrossum@users.sourceforge.net Sat Nov 24 21:07:03 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Sat, 24 Nov 2001 13:07:03 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_descr.py,1.104,1.105 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv16272 Modified Files: test_descr.py Log Message: - Change all remaining assertions into verify() and vereq() calls. - Add tests for the recent fixes to copy_reg.py: __getstate__/__setstate__ and mixed inheritance from new+classic classes. Index: test_descr.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_descr.py,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** test_descr.py 2001/11/14 23:56:45 1.104 --- test_descr.py 2001/11/24 21:07:01 1.105 *************** *** 554,558 **** def __init__(self, *a, **kw): if a: ! assert len(a) == 1 self.state = a[0] if kw: --- 554,558 ---- def __init__(self, *a, **kw): if a: ! vereq(len(a), 1) self.state = a[0] if kw: *************** *** 561,565 **** return self.get(key, 0) def __setitem__(self, key, value): ! assert isinstance(key, type(0)) dict.__setitem__(self, key, value) def setstate(self, state): --- 561,565 ---- return self.get(key, 0) def __setitem__(self, key, value): ! verify(isinstance(key, type(0))) dict.__setitem__(self, key, value) def setstate(self, state): *************** *** 2258,2261 **** --- 2258,2276 ---- return "C2(%r, %r)<%r>" % (self.a, self.b, int(self)) + global C3 + class C3(object): + def __init__(self, foo): + self.foo = foo + def __getstate__(self): + return self.foo + def __setstate__(self, foo): + self.foo = foo + + global C4classic, C4 + class C4classic: # classic + pass + class C4(C4classic, object): # mixed inheritance + pass + for p in pickle, cPickle: for bin in 0, 1: *************** *** 2272,2284 **** s = p.dumps((a, b), bin) x, y = p.loads(s) ! assert x.__class__ == a.__class__ ! assert sorteditems(x.__dict__) == sorteditems(a.__dict__) ! assert y.__class__ == b.__class__ ! assert sorteditems(y.__dict__) == sorteditems(b.__dict__) ! assert `x` == `a` ! assert `y` == `b` if verbose: print "a = x =", a print "b = y =", b # Testing copy.deepcopy() --- 2287,2312 ---- s = p.dumps((a, b), bin) x, y = p.loads(s) ! vereq(x.__class__, a.__class__) ! vereq(sorteditems(x.__dict__), sorteditems(a.__dict__)) ! vereq(y.__class__, b.__class__) ! vereq(sorteditems(y.__dict__), sorteditems(b.__dict__)) ! vereq(`x`, `a`) ! vereq(`y`, `b`) if verbose: print "a = x =", a print "b = y =", b + # Test for __getstate__ and __setstate__ on new style class + u = C3(42) + s = p.dumps(u, bin) + v = p.loads(s) + veris(u.__class__, v.__class__) + vereq(u.foo, v.foo) + # Test for picklability of hybrid class + u = C4() + u.foo = 42 + s = p.dumps(u, bin) + v = p.loads(s) + veris(u.__class__, v.__class__) + vereq(u.foo, v.foo) # Testing copy.deepcopy() *************** *** 2293,2302 **** b = C2("hello", "world", 42) x, y = copy.deepcopy((a, b)) ! assert x.__class__ == a.__class__ ! assert sorteditems(x.__dict__) == sorteditems(a.__dict__) ! assert y.__class__ == b.__class__ ! assert sorteditems(y.__dict__) == sorteditems(b.__dict__) ! assert `x` == `a` ! assert `y` == `b` if verbose: print "a = x =", a --- 2321,2330 ---- b = C2("hello", "world", 42) x, y = copy.deepcopy((a, b)) ! vereq(x.__class__, a.__class__) ! vereq(sorteditems(x.__dict__), sorteditems(a.__dict__)) ! vereq(y.__class__, b.__class__) ! vereq(sorteditems(y.__dict__), sorteditems(b.__dict__)) ! vereq(`x`, `a`) ! vereq(`y`, `b`) if verbose: print "a = x =", a From loewis@users.sourceforge.net Sun Nov 25 14:36:00 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sun, 25 Nov 2001 06:36:00 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.318,1.319 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv23509/Misc Modified Files: NEWS Log Message: Patch #484847: Default to netscape.exe on OS/2. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.318 retrieving revision 1.319 diff -C2 -d -r1.318 -r1.319 *** NEWS 2001/11/24 09:24:51 1.318 --- NEWS 2001/11/25 14:35:53 1.319 *************** *** 13,16 **** --- 13,18 ---- Library + - webbrowser defaults to netscape.exe on OS/2 now. + Tools/Demos From loewis@users.sourceforge.net Sun Nov 25 14:36:01 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sun, 25 Nov 2001 06:36:01 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib webbrowser.py,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv23509/Lib Modified Files: webbrowser.py Log Message: Patch #484847: Default to netscape.exe on OS/2. Index: webbrowser.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/webbrowser.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** webbrowser.py 2001/10/13 16:00:52 1.22 --- webbrowser.py 2001/11/25 14:35:58 1.23 *************** *** 117,120 **** --- 117,121 ---- raise_opt, action) + print cmd rc = os.system(cmd) if rc: *************** *** 298,301 **** --- 299,311 ---- _tryorder = ("internet-config") register("internet-config", InternetConfig) + + # + # Platform support for OS/2 + # + + if sys.platform[:3] == "os2" and _iscommand("netscape.exe"): + _tryorder = ("os2netscape",) + register("os2netscape", None, + GenericBrowser("start netscape.exe %s")) # OK, now that we know what the default preference orders for each From loewis@users.sourceforge.net Sun Nov 25 14:50:58 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sun, 25 Nov 2001 06:50:58 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.319,1.320 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv28416/Misc Modified Files: NEWS Log Message: Properly set static options for tixBalloon and tixResizeHandle. Expose Tix.ResizeHandle.{detach_widget,hide,show}. Update Tix demos. Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.319 retrieving revision 1.320 diff -C2 -d -r1.319 -r1.320 *** NEWS 2001/11/25 14:35:53 1.319 --- NEWS 2001/11/25 14:50:56 1.320 *************** *** 15,18 **** --- 15,20 ---- - webbrowser defaults to netscape.exe on OS/2 now. + - Tix.ResizeHandle exposes detach_widget, hide, and show. + Tools/Demos From loewis@users.sourceforge.net Sun Nov 25 14:50:58 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sun, 25 Nov 2001 06:50:58 -0800 Subject: [Python-checkins] CVS: python/dist/src/Demo/tix/samples PanedWin.py,NONE,1.1 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/tix/samples In directory usw-pr-cvs1:/tmp/cvs-serv28416/Demo/tix/samples Added Files: PanedWin.py Log Message: Properly set static options for tixBalloon and tixResizeHandle. Expose Tix.ResizeHandle.{detach_widget,hide,show}. Update Tix demos. --- NEW FILE: PanedWin.py --- # -*-mode: python; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*- # # $Id: PanedWin.py,v 1.1 2001/11/25 14:50:55 loewis Exp $ # # Tix Demostration Program # # This sample program is structured in such a way so that it can be # executed from the Tix demo program "tixwidgets.py": it must have a # procedure called "RunSample". It should also have the "if" statment # at the end of this file so that it can be run as a standalone # program. # This file demonstrates the use of the tixPanedWindow widget. This program # is a dummy news reader: the user can adjust the sizes of the list # of artical names and the size of the text widget that shows the body # of the article. import Tix TCL_ALL_EVENTS = 0 def RunSample (root): panedwin = DemoPanedwin(root) panedwin.mainloop() panedwin.destroy() class DemoPanedwin: def __init__(self, w): self.root = w self.exit = -1 z = w.winfo_toplevel() z.wm_protocol("WM_DELETE_WINDOW", lambda self=self: self.quitcmd()) group = Tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25') group.entry.insert(0,'comp.lang.python') pane = Tix.PanedWindow(w, orientation='vertical') p1 = pane.add('list', min=70, size=100) p2 = pane.add('text', min=70) list = Tix.ScrolledListBox(p1) list.listbox['width'] = 80 list.listbox['height'] = 5 text = Tix.ScrolledText(p2) text.text['width'] = 80 text.text['height'] = 20 list.listbox.insert(Tix.END, " 12324 Re: Tkinter is good for your health") list.listbox.insert(Tix.END, "+ 12325 Re: Tkinter is good for your health") list.listbox.insert(Tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)") list.listbox.insert(Tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)") list.listbox.insert(Tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)") list.listbox.insert(Tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)") list.listbox.insert(Tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)") text.text['bg'] = list.listbox['bg'] text.text['wrap'] = 'none' text.text.insert(Tix.END, """ Mon, 19 Jun 1995 11:39:52 comp.lang.python Thread 34 of 220 Lines 353 A new way to put text and bitmaps together iNo responses ioi@blue.seas.upenn.edu Ioi K. Lam at University of Pennsylvania Hi, I have implemented a new image type called "compound". It allows you to glue together a bunch of bitmaps, images and text strings together to form a bigger image. Then you can use this image with widgets that support the -image option. For example, you can display a text string string together with a bitmap, at the same time, inside a TK button widget. """) text.text['state'] = 'disabled' list.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6) text.pack(expand=1, fill=Tix.BOTH, padx=4, pady=6) group.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH) pane.pack(side=Tix.TOP, padx=3, pady=3, fill=Tix.BOTH, expand=1) box = Tix.ButtonBox(w, orientation=Tix.HORIZONTAL) box.add('ok', text='Ok', underline=0, width=6, command=self.quitcmd) box.add('cancel', text='Cancel', underline=0, width=6, command=self.quitcmd) box.pack(side=Tix.BOTTOM, fill=Tix.X) def quitcmd (self): self.exit = 0 def mainloop(self): while self.exit < 0: self.root.tk.dooneevent(TCL_ALL_EVENTS) def destroy (self): self.root.destroy() if __name__ == '__main__': root = Tix.Tk() RunSample(root) From loewis@users.sourceforge.net Sun Nov 25 14:50:58 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sun, 25 Nov 2001 06:50:58 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/lib-tk Tix.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/lib-tk In directory usw-pr-cvs1:/tmp/cvs-serv28416/Lib/lib-tk Modified Files: Tix.py Log Message: Properly set static options for tixBalloon and tixResizeHandle. Expose Tix.ResizeHandle.{detach_widget,hide,show}. Update Tix demos. Index: Tix.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/lib-tk/Tix.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Tix.py 2001/11/02 23:48:20 1.5 --- Tix.py 2001/11/25 14:50:55 1.6 *************** *** 490,494 **** def __init__(self, master=None, cnf={}, **kw): ! TixWidget.__init__(self, master, 'tixBalloon', ['options'], cnf, kw) self.subwidget_list['label'] = _dummyLabel(self, 'label', destroy_physically=0) --- 490,496 ---- def __init__(self, master=None, cnf={}, **kw): ! # static seem to be -installcolormap -initwait -statusbar -cursor ! static = ['options', 'installcolormap', 'initwait', 'statusbar', 'cursor'] ! TixWidget.__init__(self, master, 'tixBalloon', static, cnf, kw) self.subwidget_list['label'] = _dummyLabel(self, 'label', destroy_physically=0) *************** *** 1195,1203 **** def __init__(self, master, cnf={}, **kw): TixWidget.__init__(self, master, 'tixResizeHandle', ! ['options'], cnf, kw) def attach_widget(self, widget): self.tk.call(self._w, 'attachwidget', widget._w) class ScrolledHList(TixWidget): --- 1197,1220 ---- def __init__(self, master, cnf={}, **kw): + # There seems to be a Tix bug rejecting the configure method + # Let's try making the flags -static + flags = ['options', 'command', 'cursorfg', 'cursorbg', + 'handlesize', 'hintcolor', 'hintwidth', + 'x', 'y'] + # In fact, x y height width are configurable TixWidget.__init__(self, master, 'tixResizeHandle', ! flags, cnf, kw) def attach_widget(self, widget): self.tk.call(self._w, 'attachwidget', widget._w) + + def detach_widget(self, widget): + self.tk.call(self._w, 'detachwidget', widget._w) + + def hide(self, widget): + self.tk.call(self._w, 'hide', widget._w) + + def show(self, widget): + self.tk.call(self._w, 'show', widget._w) class ScrolledHList(TixWidget): From loewis@users.sourceforge.net Sun Nov 25 14:50:57 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Sun, 25 Nov 2001 06:50:57 -0800 Subject: [Python-checkins] CVS: python/dist/src/Demo/tix tixwidgets.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/tix In directory usw-pr-cvs1:/tmp/cvs-serv28416/Demo/tix Modified Files: tixwidgets.py Log Message: Properly set static options for tixBalloon and tixResizeHandle. Expose Tix.ResizeHandle.{detach_widget,hide,show}. Update Tix demos. Index: tixwidgets.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/tix/tixwidgets.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tixwidgets.py 2001/11/11 14:07:37 1.3 --- tixwidgets.py 2001/11/25 14:50:55 1.4 *************** *** 10,17 **** # you have installed Python & Tix properly, you can execute this as # ! # % python tixwidget.py # ! import os, sys, Tix from Tkconstants import * --- 10,17 ---- # you have installed Python & Tix properly, you can execute this as # ! # % python tixwidgets.py # ! import os, os.path, sys, Tix from Tkconstants import * *************** *** 61,67 **** file.pack(side=LEFT) help.pack(side=RIGHT) ! fm = Tix.Menu(file) file['menu'] = fm ! hm = Tix.Menu(help) help['menu'] = hm --- 61,67 ---- file.pack(side=LEFT) help.pack(side=RIGHT) ! fm = Tix.Menu(file, tearoff=0) file['menu'] = fm ! hm = Tix.Menu(help, tearoff=0) help['menu'] = hm *************** *** 70,74 **** command=lambda w=w: w.tk.eval('console show')) ! fm.add_command(label='Exit', underline=1, accelerator='Ctrl+X', command = lambda self=self: self.quitcmd () ) hm.add_checkbutton(label='BalloonHelp', underline=0, command=ToggleHelp, --- 70,74 ---- command=lambda w=w: w.tk.eval('console show')) ! fm.add_command(label='Exit', underline=1, command = lambda self=self: self.quitcmd () ) hm.add_checkbutton(label='BalloonHelp', underline=0, command=ToggleHelp, *************** *** 129,151 **** def quitcmd (self): ! # self.root.destroy() self.exit = 0 def loop(self): while self.exit < 0: self.root.tk.dooneevent(TCL_ALL_EVENTS) ! # self.root.tk.dooneevent(TCL_DONT_WAIT) def destroy (self): self.root.destroy() ! def RunMain(top): ! global demo, root ! demo = Demo(top) - # top.withdraw() - # root = Tix.Toplevel() - root = top demo.build() demo.loop() --- 129,169 ---- def quitcmd (self): ! """Quit our mainloop. It is up to you to call root.destroy() after.""" self.exit = 0 def loop(self): + import tkMessageBox, traceback + while self.exit < 0: + try: while self.exit < 0: self.root.tk.dooneevent(TCL_ALL_EVENTS) ! except SystemExit: ! #print 'Exit' ! self.exit = 1 ! break ! except KeyboardInterrupt: ! if tkMessageBox.askquestion ('Interrupt', 'Really Quit?') == 'yes': ! # self.tk.eval('exit') ! return ! else: ! pass ! continue ! except: ! t, v, tb = sys.exc_info() ! text = "" ! for line in traceback.format_exception(t,v,tb): ! text += line + '\n' ! try: tkMessageBox.showerror ('Error', text) ! except: pass ! tkinspect_quit (1) def destroy (self): self.root.destroy() ! def RunMain(root): ! global demo ! demo = Demo(root) demo.build() demo.loop() *************** *** 501,506 **** rh.attach_widget(list) def MkSWindow(w): ! global demo top = Tix.Frame(w, width=330, height=330) --- 519,533 ---- rh.attach_widget(list) + # See below why this is necessary. + global image1 + image1 = None def MkSWindow(w): ! global demo, image1 ! ! text = 'The TixScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.' ! ! file = os.path.join(demo.dir, 'bitmaps', 'tix.gif') ! if not os.path.isfile(file): ! text += ' (Image missing)' top = Tix.Frame(w, width=330, height=330) *************** *** 508,515 **** msg = Tix.Message(top, relief=Tix.FLAT, width=200, anchor=Tix.N, ! text='The TixScrolledWindow widget allows you to scroll any kind of Tk widget. It is more versatile than a scrolled canvas widget.') win = Tix.ScrolledWindow(top, scrollbar='auto') ! image = Tix.Image('photo', file=demo.dir + "/bitmaps/tix.gif") ! lbl = Tix.Label(win.window, image=image) lbl.pack(expand=1, fill=Tix.BOTH) --- 535,548 ---- msg = Tix.Message(top, relief=Tix.FLAT, width=200, anchor=Tix.N, ! text=text) ! win = Tix.ScrolledWindow(top, scrollbar='auto') ! ! # This image is not showing up under Python unless it is set to a ! # global variable - no problem under Tcl. I assume it is being garbage ! # collected some how, even though the tcl command 'image names' shows ! # that as far as Tcl is concerned, the image exists and is called pyimage1. ! image1 = Tix.Image('photo', file=file) ! lbl = Tix.Label(win.window, image=image1) lbl.pack(expand=1, fill=Tix.BOTH) *************** *** 582,586 **** relief=Tix.FLAT, width=240, anchor=Tix.N, text='The PanedWindow widget allows the user to interactively manipulate the sizes of several panes. The panes can be arranged either vertically or horizontally.') ! group = Tix.Label(w, text='Newsgroup: comp.lang.python') pane = Tix.PanedWindow(w, orientation='vertical') --- 615,620 ---- relief=Tix.FLAT, width=240, anchor=Tix.N, text='The PanedWindow widget allows the user to interactively manipulate the sizes of several panes. The panes can be arranged either vertically or horizontally.') ! group = Tix.LabelEntry(w, label='Newsgroup:', options='entry.width 25') ! group.entry.insert(0,'comp.lang.python') pane = Tix.PanedWindow(w, orientation='vertical') *************** *** 590,605 **** text = Tix.ScrolledText(p2) ! list.listbox.insert(Tix.END, " 12324 Re: TK is good for your health") ! list.listbox.insert(Tix.END, "+ 12325 Re: TK is good for your health") ! list.listbox.insert(Tix.END, "+ 12326 Re: Tix is even better for your health (Was: TK is good...)") ! list.listbox.insert(Tix.END, " 12327 Re: Tix is even better for your health (Was: TK is good...)") ! list.listbox.insert(Tix.END, "+ 12328 Re: Tix is even better for your health (Was: TK is good...)") ! list.listbox.insert(Tix.END, " 12329 Re: Tix is even better for your health (Was: TK is good...)") ! list.listbox.insert(Tix.END, "+ 12330 Re: Tix is even better for your health (Was: TK is good...)") text.text['bg'] = list.listbox['bg'] text.text['wrap'] = 'none' text.text.insert(Tix.END, """ ! Mon, 19 Jun 1995 11:39:52 comp.lang.tcl Thread 34 of 220 Lines 353 A new way to put text and bitmaps together iNo responses ioi@blue.seas.upenn.edu Ioi K. Lam at University of Pennsylvania --- 624,639 ---- text = Tix.ScrolledText(p2) ! list.listbox.insert(Tix.END, " 12324 Re: Tkinter is good for your health") ! list.listbox.insert(Tix.END, "+ 12325 Re: Tkinter is good for your health") ! list.listbox.insert(Tix.END, "+ 12326 Re: Tix is even better for your health (Was: Tkinter is good...)") ! list.listbox.insert(Tix.END, " 12327 Re: Tix is even better for your health (Was: Tkinter is good...)") ! list.listbox.insert(Tix.END, "+ 12328 Re: Tix is even better for your health (Was: Tkinter is good...)") ! list.listbox.insert(Tix.END, " 12329 Re: Tix is even better for your health (Was: Tkinter is good...)") ! list.listbox.insert(Tix.END, "+ 12330 Re: Tix is even better for your health (Was: Tkinter is good...)") text.text['bg'] = list.listbox['bg'] text.text['wrap'] = 'none' text.text.insert(Tix.END, """ ! Mon, 19 Jun 1995 11:39:52 comp.lang.python Thread 34 of 220 Lines 353 A new way to put text and bitmaps together iNo responses ioi@blue.seas.upenn.edu Ioi K. Lam at University of Pennsylvania *************** *** 718,721 **** --- 752,756 ---- 'Notebook' : 'NoteBook', 'Option Menu' : 'OptMenu', + 'Paned Window' : 'PanedWin', 'Popup Menu' : 'PopMenu', 'ScrolledHList (1)' : 'SHList1', *************** *** 796,801 **** ## set manager { ##na {f ListNoteBook ListNBK.tcl } ! ## {f NoteBook NoteBook.tcl } ! ## {f PanedWindow PanedWin.tcl } ## } ## --- 831,836 ---- ## set manager { ##na {f ListNoteBook ListNBK.tcl } ! ##done {f NoteBook NoteBook.tcl } ! ##done {f PanedWindow PanedWin.tcl } ## } ## *************** *** 818,822 **** stypes['widget'] = ['Balloon', 'Button Box', 'Combo Box', 'Control', 'Directory List', 'Directory Tree', ! 'Notebook', 'Option Menu', 'Popup Menu', 'ScrolledHList (1)', 'ScrolledHList (2)', 'Tree (dynamic)'] stypes['image'] = ['Compound Image'] --- 853,857 ---- stypes['widget'] = ['Balloon', 'Button Box', 'Combo Box', 'Control', 'Directory List', 'Directory Tree', ! 'Notebook', 'Option Menu', 'Popup Menu', 'Paned Window', 'ScrolledHList (1)', 'ScrolledHList (2)', 'Tree (dynamic)'] stypes['image'] = ['Compound Image'] *************** *** 827,861 **** if not prefix: prefix = '' ! w.option_add('*' + prefix + '*TixLabelFrame*label.padX', 4) ! lab = Tix.Label(w, text='Select a sample program:', anchor=Tix.W) ! lab1 = Tix.Label(w, text='Source:', anchor=Tix.W) ! slb = Tix.ScrolledHList(w, options='listbox.exportSelection 0') ! slb.hlist['command'] = lambda args=0, w=w,slb=slb: Sample_Action(w, slb, 'run') ! slb.hlist['browsecmd'] = lambda args=0, w=w,slb=slb: Sample_Action(w, slb, 'browse') ! stext = Tix.ScrolledText(w, name='stext') font = root.tk.eval('tix option get fixed_font') stext.text.config(font=font) - # stext.text.bind('<1>', stext.text.focus()) stext.text.bind('', lambda w=stext.text: w.yview(scroll='-1 unit')) stext.text.bind('', lambda w=stext.text: w.yview(scroll='1 unit')) stext.text.bind('', lambda w=stext.text: w.xview(scroll='-1 unit')) stext.text.bind('', lambda w=stext.text: w.xview(scroll='1 unit')) ! run = Tix.Button(w, text='Run ...', name='run', command=lambda args=0, w=w,slb=slb: Sample_Action(w, slb, 'run')) ! view = Tix.Button(w, text='View Source ...', name='view', command=lambda args=0,w=w,slb=slb: Sample_Action(w, slb, 'view')) ! lab.form(top=0, left=0, right='&'+str(slb)) ! slb.form(left=0, top=lab, bottom=-4) ! lab1.form(left='&'+str(stext), top=0, right='&'+str(stext), bottom=stext) ! run.form(left=str(slb)+' 30', bottom=-4) ! view.form(left=run, bottom=-4) ! stext.form(bottom=str(run)+' -5', left='&'+str(run), right='-0', top='&'+str(slb)) stext.text['bg'] = slb.hlist['bg'] stext.text['state'] = 'disabled' stext.text['wrap'] = 'none' slb.hlist['separator'] = '.' --- 862,905 ---- if not prefix: prefix = '' ! else: ! prefix = '*' + prefix ! w.option_add(prefix + '*TixLabelFrame*label.padX', 4) ! pane = Tix.PanedWindow(w, orientation='horizontal') ! pane.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH) ! f1 = pane.add('list', expand='1') ! f2 = pane.add('text', expand='5') ! f1['relief'] = 'flat' ! f2['relief'] = 'flat' ! lab = Tix.Label(f1, text='Select a sample program:', anchor=Tix.W) ! lab.pack(side=Tix.TOP, expand=0, fill=Tix.X, padx=5, pady=5) ! lab1 = Tix.Label(f2, text='Source:', anchor=Tix.W) ! lab1.pack(side=Tix.TOP, expand=0, fill=Tix.X, padx=5, pady=5) ! slb = Tix.Tree(f1, options='hlist.width 25') ! slb.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=5) ! ! stext = Tix.ScrolledText(f2, name='stext') font = root.tk.eval('tix option get fixed_font') stext.text.config(font=font) stext.text.bind('', lambda w=stext.text: w.yview(scroll='-1 unit')) stext.text.bind('', lambda w=stext.text: w.yview(scroll='1 unit')) stext.text.bind('', lambda w=stext.text: w.xview(scroll='-1 unit')) stext.text.bind('', lambda w=stext.text: w.xview(scroll='1 unit')) + stext.pack(side=Tix.TOP, expand=1, fill=Tix.BOTH, padx=7) ! frame = Tix.Frame(f2, name='frame') ! frame.pack(side=Tix.TOP, expand=0, fill=Tix.X, padx=7) ! run = Tix.Button(frame, text='Run ...', name='run') ! view = Tix.Button(frame, text='View Source ...', name='view') ! run.pack(side=Tix.LEFT, expand=0, fill=Tix.NONE) ! view.pack(side=Tix.LEFT, expand=0, fill=Tix.NONE) stext.text['bg'] = slb.hlist['bg'] stext.text['state'] = 'disabled' stext.text['wrap'] = 'none' + stext.text['width'] = 80 slb.hlist['separator'] = '.' *************** *** 864,868 **** --- 908,917 ---- slb.hlist['indent'] = 10 slb.hlist['wideselect'] = 1 + slb.hlist['command'] = lambda args=0, w=w,slb=slb,stext=stext,run=run,view=view: Sample_Action(w, slb, stext, run, view, 'run') + slb.hlist['browsecmd'] = lambda args=0, w=w,slb=slb,stext=stext,run=run,view=view: Sample_Action(w, slb, stext, run, view, 'browse') + run['command'] = lambda args=0, w=w,slb=slb,stext=stext,run=run,view=view: Sample_Action(w, slb, stext, run, view, 'run') + view['command'] = lambda args=0, w=w,slb=slb,stext=stext,run=run,view=view: Sample_Action(w, slb, stext, run, view, 'view') + for type in ['widget', 'image']: if type != 'widget': *************** *** 880,889 **** view['state'] = 'disabled' ! def Sample_Action(w, slb, action): global demo - - run = w._nametowidget(str(w) + '.run') - view = w._nametowidget(str(w) + '.view') - stext = w._nametowidget(str(w) + '.stext') hlist = slb.hlist --- 929,934 ---- view['state'] = 'disabled' ! def Sample_Action(w, slb, stext, run, view, action): global demo hlist = slb.hlist From tim_one@users.sourceforge.net Sun Nov 25 21:12:45 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Sun, 25 Nov 2001 13:12:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib random.py,1.25,1.26 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv1482/python/Lib Modified Files: random.py Log Message: SF patch 483059: Avoid use of eval() in random.py, from Finn Bock. _verify(): Pass in the values of globals insted of eval()ing their names. The use of eval() was obscure and unnecessary, and the patch claimed random.py couldn't be used in Jython applets because of it. Index: random.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/random.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** random.py 2001/02/15 23:56:39 1.25 --- random.py 2001/11/25 21:12:43 1.26 *************** *** 83,88 **** "getstate","setstate","jumpahead","whseed"] ! def _verify(name, expected): ! computed = eval(name) if abs(computed - expected) > 1e-7: raise ValueError( --- 83,87 ---- "getstate","setstate","jumpahead","whseed"] ! def _verify(name, computed, expected): if abs(computed - expected) > 1e-7: raise ValueError( *************** *** 91,104 **** NV_MAGICCONST = 4 * _exp(-0.5)/_sqrt(2.0) ! _verify('NV_MAGICCONST', 1.71552776992141) TWOPI = 2.0*_pi ! _verify('TWOPI', 6.28318530718) LOG4 = _log(4.0) ! _verify('LOG4', 1.38629436111989) SG_MAGICCONST = 1.0 + _log(4.5) ! _verify('SG_MAGICCONST', 2.50407739677627) del _verify --- 90,103 ---- NV_MAGICCONST = 4 * _exp(-0.5)/_sqrt(2.0) ! _verify('NV_MAGICCONST', NV_MAGICCONST, 1.71552776992141) TWOPI = 2.0*_pi ! _verify('TWOPI', TWOPI, 6.28318530718) LOG4 = _log(4.0) ! _verify('LOG4', LOG4, 1.38629436111989) SG_MAGICCONST = 1.0 + _log(4.5) ! _verify('SG_MAGICCONST', SG_MAGICCONST, 2.50407739677627) del _verify From fdrake@users.sourceforge.net Mon Nov 26 21:29:20 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 26 Nov 2001 13:29:20 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/api concrete.tex,1.1,1.2 refcounts.dat,1.36,1.37 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv5452/api Modified Files: concrete.tex refcounts.dat Log Message: Add documentation for the PyCell* APIs. Index: concrete.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** concrete.tex 2001/10/12 19:01:43 1.1 --- concrete.tex 2001/11/26 21:29:17 1.2 *************** *** 2341,2342 **** --- 2341,2392 ---- \var{self} was created with. \end{cfuncdesc} + + + \subsection{Cell Objects \label{cell-objects}} + + ``Cell'' objects are used to implement variables referenced by + multiple scopes. For each such variable, a cell object is created to + store the value; the local variables of each stack frame that + references the value contains a reference to the cells from outer + scopes which also use that variable. When the value is accessed, the + value contained in the cell is used instead of the cell object + itself. This de-referencing of the cell object requires support from + the generated byte-code; these are not automatically de-referenced + when accessed. Cell objects are not likely to be useful elsewhere. + + \begin{cvardesc}{PyTypeObject}{PyCell_Type} + The type object corresponding to cell objects + \end{cvardesc} + + \begin{cfuncdesc}{int}{PyCell_Check}{ob} + Return true if \var{ob} is a cell object; \var{ob} must not be + \NULL. + \end{cfuncdesc} + + \begin{cfuncdesc}{PyObject*}{PyCell_New}{PyObject *ob} + Create and return a new cell object containing the value \var{ob}. + The parameter may be \NULL. + \end{cfuncdesc} + + \begin{cfuncdesc}{PyObject*}{PyCell_Get}{PyObject *cell} + Return the contents of the cell \var{cell}. + \end{cfuncdesc} + + \begin{cfuncdesc}{PyObject*}{PyCell_GET}{PyObject *cell} + Return the contents of the cell \var{cell}, but without checking + that \var{cell} is non-\NULL{} and a call object. + \end{cfuncdesc} + + \begin{cfuncdesc}{int}{PyCell_Set}{PyObject *cell, PyObject *value} + Set the contents of the cell object \var{cell} to \var{value}. This + releases the reference to any current content of the cell. + \var{value} may be \NULL. \var{cell} must be non-\NULL; if it is + not a cell object, \code{-1} will be returned. On success, \code{0} + will be returned. + \end{cfuncdesc} + + \begin{cfuncdesc}{void}{PyCell_SET}{PyObject *cell, PyObject *value} + Sets the value of the cell object \var{cell} to \var{value}. No + reference counts are adjusted, and no checks are made for safety; + \var{cell} must be non-\NULL{} and must be a cell object. + \end{cfuncdesc} Index: refcounts.dat =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/refcounts.dat,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** refcounts.dat 2001/10/29 17:43:14 1.36 --- refcounts.dat 2001/11/26 21:29:17 1.37 *************** *** 68,71 **** --- 68,88 ---- PyCObject_GetDesc:PyObject*:self:0: + PyCell_New:PyObject*::+1: + PyCell_New:PyObject*:ob:0: + + PyCell_GET:PyObject*::0: + PyCell_GET:PyObject*:ob:0: + + PyCell_Get:PyObject*::+1: + PyCell_Get:PyObject*:cell:0: + + PyCell_SET:void::: + PyCell_SET:PyObject*:cell:0: + PyCell_SET:PyObject*:value:0: + + PyCell_Set:int::: + PyCell_Set:PyObject*:cell:0: + PyCell_Set:PyObject*:value:0: + PyCallIter_New:PyObject*::+1: PyCallIter_New:PyObject*:callable:: From fdrake@users.sourceforge.net Mon Nov 26 21:30:38 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 26 Nov 2001 13:30:38 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libpickle.tex,1.32,1.33 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv5872/lib Modified Files: libpickle.tex Log Message: Fix typo, extra markup constructs. This closes SF bug #485252. Index: libpickle.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libpickle.tex,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** libpickle.tex 2001/11/18 16:24:01 1.32 --- libpickle.tex 2001/11/26 21:30:36 1.33 *************** *** 19,29 **** inverse operation, whereby a byte stream is converted back into an object hierarchy. Pickling (and unpickling) is alternatively known as ! ``serialization'', ``marshaling\footnote{Don't confuse this with the ! \module{marshal}\refmodule{marshal} module}'', or ``flattening'', however the preferred term used here is ``pickling'' and ``unpickling'' to avoid confusing. This documentation describes both the \module{pickle} module and the ! \module{cPickle}\refmodule{cPickle} module. \subsection{Relationship to other Python modules} --- 19,29 ---- inverse operation, whereby a byte stream is converted back into an object hierarchy. Pickling (and unpickling) is alternatively known as ! ``serialization'', ``marshalling,''\footnote{Don't confuse this with ! the \refmodule{marshal} module} or ``flattening'', however the preferred term used here is ``pickling'' and ``unpickling'' to avoid confusing. This documentation describes both the \module{pickle} module and the ! \refmodule{cPickle} module. \subsection{Relationship to other Python modules} *************** *** 47,51 **** Python has a more primitive serialization module called ! \module{marshal}\refmodule{marshal}, but in general \module{pickle} should always be the preferred way to serialize Python objects. \module{marshal} exists primarily to support Python's --- 47,51 ---- Python has a more primitive serialization module called ! \refmodule{marshal}, but in general \module{pickle} should always be the preferred way to serialize Python objects. \module{marshal} exists primarily to support Python's *************** *** 458,462 **** An alternative to implementing a \method{__reduce__()} method on the object to be pickled, is to register the callable with the ! \refmodule{copy_reg} module. This module provides a way for programs to register ``reduction functions'' and constructors for user-defined types. Reduction functions have the same semantics and --- 458,462 ---- An alternative to implementing a \method{__reduce__()} method on the object to be pickled, is to register the callable with the ! \refmodule[copyreg]{copy_reg} module. This module provides a way for programs to register ``reduction functions'' and constructors for user-defined types. Reduction functions have the same semantics and *************** *** 598,602 **** which is not a class, the unpickler will check to make sure that the callable has either been registered as a safe callable via the ! \refmodule{copy_reg} module, or that it has an attribute \member{__safe_for_unpickling__} with a true value. This prevents the unpickling environment from being tricked into doing --- 598,602 ---- which is not a class, the unpickler will check to make sure that the callable has either been registered as a safe callable via the ! \refmodule[copyreg]{copy_reg} module, or that it has an attribute \member{__safe_for_unpickling__} with a true value. This prevents the unpickling environment from being tricked into doing From fdrake@users.sourceforge.net Mon Nov 26 21:38:52 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 26 Nov 2001 13:38:52 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libundoc.tex,1.80,1.81 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv8703/lib Modified Files: libundoc.tex Log Message: Tk-related modules should no longer be listed here. Index: libundoc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libundoc.tex,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** libundoc.tex 2001/08/14 11:38:35 1.80 --- libundoc.tex 2001/11/26 21:38:50 1.81 *************** *** 16,32 **** \begin{description} - \item[\module{Tkinter}] - --- Interface to Tcl/Tk for graphical user interfaces; Fredrik Lundh - is working on this one! See - \citetitle[http://www.pythonware.com/library.htm]{An Introduction to - Tkinter} at \url{http://www.pythonware.com/library.htm} for on-line - reference material. - - \item[\module{Tkdnd}] - --- Drag-and-drop support for \module{Tkinter}. - - \item[\module{turtle}] - --- Turtle graphics in a Tk window. - \item[\module{test}] --- Regression testing framework. This is used for the Python --- 16,19 ---- From fdrake@users.sourceforge.net Mon Nov 26 21:39:42 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 26 Nov 2001 13:39:42 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libweakref.tex,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv8977/lib Modified Files: libweakref.tex Log Message: Typo, spotted by Detlef Lannert. Index: libweakref.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libweakref.tex,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** libweakref.tex 2001/10/26 17:40:22 1.15 --- libweakref.tex 2001/11/26 21:39:40 1.16 *************** *** 54,58 **** Weak references support tests for equality, but not ordering. If the referents are still alive, two references have the same ! equalality relationship as their referents (regardless of the \var{callback}). If either referent has been deleted, the references are equal only if the reference objects are the same --- 54,58 ---- Weak references support tests for equality, but not ordering. If the referents are still alive, two references have the same ! equality relationship as their referents (regardless of the \var{callback}). If either referent has been deleted, the references are equal only if the reference objects are the same From fdrake@users.sourceforge.net Mon Nov 26 21:46:55 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Mon, 26 Nov 2001 13:46:55 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/html style.css,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/html In directory usw-pr-cvs1:/tmp/cvs-serv11681/html Modified Files: style.css Log Message: Typo, spotted by Fredrik Lundh. Index: style.css =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/html/style.css,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** style.css 2001/11/14 22:35:59 1.18 --- style.css 2001/11/26 21:46:53 1.19 *************** *** 54,58 **** font-weight: normal; } ! .typelabel { font-family: lucida, sans serif; } .navigation td { background-color: #99ccff; --- 54,58 ---- font-weight: normal; } ! .typelabel { font-family: lucida, sans-serif; } .navigation td { background-color: #99ccff; From jackjansen@users.sourceforge.net Mon Nov 26 22:42:04 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 26 Nov 2001 14:42:04 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Distributions dev.exclude,1.7,1.7.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions In directory usw-pr-cvs1:/tmp/cvs-serv29992/Python/Mac/Distributions Modified Files: Tag: r22b2-branch dev.exclude Log Message: Release candidates for 2.2b2. Index: dev.exclude =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/dev.exclude,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** dev.exclude 2001/10/23 22:19:39 1.7 --- dev.exclude 2001/11/26 22:42:02 1.7.2.1 *************** *** 7,10 **** --- 7,11 ---- *.idb *.pyc + *.pyo *.slb *.xMAP *************** *** 17,19 **** CVS [(]*[)] - *.pyo --- 18,19 ---- From jackjansen@users.sourceforge.net Mon Nov 26 22:42:13 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 26 Nov 2001 14:42:13 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Distributions dev.include,1.22,1.22.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions In directory usw-pr-cvs1:/tmp/cvs-serv30026/Python/Mac/Distributions Modified Files: Tag: r22b2-branch dev.include Log Message: Release candidates for 2.2b2. Index: dev.include =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/dev.include,v retrieving revision 1.22 retrieving revision 1.22.2.1 diff -C2 -d -r1.22 -r1.22.2.1 *** dev.include 2001/10/23 22:19:52 1.22 --- dev.include 2001/11/26 22:42:10 1.22.2.1 *************** *** 224,227 **** --- 224,233 ---- (':Mac:Build:_dummy_tkinter.mcp', None) (':Mac:Build:_dummy_tkinter.mcp.exp', None) + (':Mac:Build:_hotshot.carbon.mcp', None) + (':Mac:Build:_hotshot.carbon.mcp.exp', None) + (':Mac:Build:_hotshot.carbon.mcp.xml', None) + (':Mac:Build:_hotshot.mcp', None) + (':Mac:Build:_hotshot.mcp.exp', None) + (':Mac:Build:_hotshot.mcp.xml', None) (':Mac:Build:_symtable.carbon.mcp', None) (':Mac:Build:_symtable.carbon.mcp.exp', None) *************** *** 424,427 **** --- 430,434 ---- (':Modules:_curses_panel.c', None) (':Modules:_cursesmodule.c', None) + (':Modules:_hotshot.c', None) (':Modules:_localemodule.c', None) (':Modules:_sre.c', None) *************** *** 590,598 **** (':setup.py', None) (':site-packages', None) ! (':Mac:Build:_hotshot.mcp.xml', None) ! (':Mac:Build:_hotshot.mcp.exp', None) ! (':Mac:Build:_hotshot.mcp', None) ! (':Mac:Build:_hotshot.carbon.mcp.xml', None) ! (':Mac:Build:_hotshot.carbon.mcp.exp', None) ! (':Mac:Build:_hotshot.carbon.mcp', None) ! (':Modules:_hotshot.c', None) --- 597,602 ---- (':setup.py', None) (':site-packages', None) ! (':Mac:Build:hfsplus.carbon.mcp.xml', None) ! (':Mac:Build:hfsplus.carbon.mcp.exp', None) ! (':Mac:Build:hfsplus.carbon.mcp', None) ! (':Mac:mwerks:mwerks_shlib_config.h', '') From jackjansen@users.sourceforge.net Mon Nov 26 22:42:17 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 26 Nov 2001 14:42:17 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac Relnotes,1.27,1.27.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory usw-pr-cvs1:/tmp/cvs-serv30058/Python/Mac Modified Files: Tag: r22b2-branch Relnotes Log Message: Release candidates for 2.2b2. Index: Relnotes =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Relnotes,v retrieving revision 1.27 retrieving revision 1.27.2.1 diff -C2 -d -r1.27 -r1.27.2.1 *** Relnotes 2001/10/23 22:20:30 1.27 --- Relnotes 2001/11/26 22:42:15 1.27.2.1 *************** *** 1,7 **** ! Changes in 2.2b1 since 2.1.1 ---------------------------- These release notes refer to Mac-specific changes only. See NEWS (in the Misc folder) ! for machine-independent changes. Changes that were already in 2.2a3 are flagged as such. --- 1,7 ---- ! Changes in 2.2b2 since 2.1.1 ---------------------------- These release notes refer to Mac-specific changes only. See NEWS (in the Misc folder) ! for machine-independent changes. Changes that are new in 2.2b2 are flagged as such. *************** *** 11,31 **** 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. [2.2a3] - On input MacPython now accepts either \n (unix style) or \r (mac style) newlines for text files. This behaviour can be turned off with a preference. ! This is an experimental feature; again: feedback is requested. [2.2a3] - 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. [2.2a3] - 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. [2.2a3] ! - Garbage collection and the gc module have (finally) been enabled. [2.2a3] - EasyDialogs.ProgressBar now has indeterminate progressbars if you specify maxval=0. ! This is also the new default. Patch supplied by Dean Draayer. [2.2a3] - There are new preferences for enabling old-style division warnings and for accepting unix-style newlines in text input files. These can also be set during ! startup, and in addition you can select very verbose import tracing. [2.2a3] ! - Various outdated scripts have been moved to :Mac:Unsupported. [2.2a3] ! - Various outdated items from :Mac:Lib:test have been removed. [2.2a3] - C Developers: you know have control over the Python console if you are embedding MacPython in another application, thanks to Alexandre Parenteau. :Mac:Demo:embed.html --- 11,39 ---- 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 behaviour can be turned off with a preference. ! This is an experimental feature; again: feedback is requested. ! - Command-dot handling has been improved a lot: scripts are now much easier to interrupt, ! and they only scan for cmd-. while in the foreground. [2.2b2] ! - A new, rather different GUSI I/O library is used. Please report any strange behaviour ! with I/O to the pythonmac-sig mailing list! [2.2b2] - 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. ! - A new, experimental module hfsplus is included, which gives access to some of the ! functionality of the HFS+ API. [2.2b2] - 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. - There are new preferences for enabling old-style division warnings and for accepting unix-style newlines in text input files. These can also be set during ! startup, and in addition you can select very verbose import tracing. ! - The NavServices override for StandardFile has moved from early startup to the ! time you import macfs. This speeds up MacPython startup. ! - Various outdated scripts have been moved to :Mac:Unsupported. ! - Various outdated items from :Mac:Lib:test have been removed. - C Developers: you know have control over the Python console if you are embedding MacPython in another application, thanks to Alexandre Parenteau. :Mac:Demo:embed.html *************** *** 49,53 **** http://www.cwi.nl/~jack/macpython.html. ! - MacPython 2.2a3 (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. --- 57,61 ---- http://www.cwi.nl/~jack/macpython.html. ! - MacPython 2.2b2 (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. *************** *** 57,62 **** you cannot access it from Python). - Aliases may not work in sys.path entries. - - Under Carbon on OS9 only you may occasionally see a spurious KeyboardInterrupt. I have absolutely - no clue as to what is causing this. - PythonInterpreter used interactively will eat a lot of processor cycles. You should use PythonIDE for interactive work and PythonInterpreter for scripts only. This is especially --- 65,68 ---- From jackjansen@users.sourceforge.net Mon Nov 26 22:42:26 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 26 Nov 2001 14:42:26 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCoreCarbon.exp,1.21.2.1,1.21.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv30080/Python/Mac/Build Modified Files: Tag: r22b2-branch PythonCoreCarbon.exp Log Message: Release candidates for 2.2b2. Index: PythonCoreCarbon.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCoreCarbon.exp,v retrieving revision 1.21.2.1 retrieving revision 1.21.2.2 diff -C2 -d -r1.21.2.1 -r1.21.2.2 *** PythonCoreCarbon.exp 2001/11/18 02:02:34 1.21.2.1 --- PythonCoreCarbon.exp 2001/11/26 22:42:24 1.21.2.2 *************** *** 1079,1083 **** GUSIStdioFlush GUSIStdioClose - _fdopen__FiPCc # _fdopen(int,const char*) __close_console __close_file --- 1079,1082 ---- From jackjansen@users.sourceforge.net Mon Nov 26 23:04:48 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 26 Nov 2001 15:04:48 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/mkcwproject/template-carbon template-alllibraries.xml,1.1,1.1.14.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-carbon In directory usw-pr-cvs1:/tmp/cvs-serv3634/Python/Mac/Lib/mkcwproject/template-carbon Modified Files: Tag: r22b2-branch template-alllibraries.xml Log Message: Added support for weak-linking the system interface library and/or the user-supplied dynamic libraries. The latter is all-or-nothing, i.e. no way to weak link only specific libraries, but for now that is good enough. Index: template-alllibraries.xml =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-carbon/template-alllibraries.xml,v retrieving revision 1.1 retrieving revision 1.1.14.1 diff -C2 -d -r1.1 -r1.1.14.1 *** template-alllibraries.xml 2001/01/23 22:33:30 1.1 --- template-alllibraries.xml 2001/11/26 23:04:46 1.1.14.1 *************** *** 4,7 **** MacOS Library ! Debug --- 4,7 ---- MacOS Library ! %(libraryflags)s From jackjansen@users.sourceforge.net Mon Nov 26 23:04:55 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 26 Nov 2001 15:04:55 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/mkcwproject/template-carbon template.prj.xml,1.3.2.2,1.3.2.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-carbon In directory usw-pr-cvs1:/tmp/cvs-serv3676/Python/Mac/Lib/mkcwproject/template-carbon Modified Files: Tag: r22b2-branch template.prj.xml Log Message: Added support for weak-linking the system interface library and/or the user-supplied dynamic libraries. The latter is all-or-nothing, i.e. no way to weak link only specific libraries, but for now that is good enough. Index: template.prj.xml =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-carbon/template.prj.xml,v retrieving revision 1.3.2.2 retrieving revision 1.3.2.3 diff -C2 -d -r1.3.2.2 -r1.3.2.3 *** template.prj.xml 2001/11/20 23:11:52 1.3.2.2 --- template.prj.xml 2001/11/26 23:04:53 1.3.2.3 *************** *** 980,984 **** CarbonLib MacOS ! Library --- 980,984 ---- CarbonLib MacOS ! %(stdlibraryflags)s From jackjansen@users.sourceforge.net Mon Nov 26 23:05:02 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 26 Nov 2001 15:05:02 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/mkcwproject/template-ppc template.prj.xml,1.2.2.1,1.2.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-ppc In directory usw-pr-cvs1:/tmp/cvs-serv3707/Python/Mac/Lib/mkcwproject/template-ppc Modified Files: Tag: r22b2-branch template.prj.xml Log Message: Added support for weak-linking the system interface library and/or the user-supplied dynamic libraries. The latter is all-or-nothing, i.e. no way to weak link only specific libraries, but for now that is good enough. Index: template.prj.xml =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-ppc/template.prj.xml,v retrieving revision 1.2.2.1 retrieving revision 1.2.2.2 diff -C2 -d -r1.2.2.1 -r1.2.2.2 *** template.prj.xml 2001/11/20 23:12:01 1.2.2.1 --- template.prj.xml 2001/11/26 23:05:00 1.2.2.2 *************** *** 723,727 **** MacOS Library ! Debug --- 723,727 ---- MacOS Library ! %(stdlibraryflags)s From jackjansen@users.sourceforge.net Mon Nov 26 23:05:08 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 26 Nov 2001 15:05:08 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/mkcwproject/template-ppc template-alllibraries.xml,1.1,1.1.14.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-ppc In directory usw-pr-cvs1:/tmp/cvs-serv3789/Python/Mac/Lib/mkcwproject/template-ppc Modified Files: Tag: r22b2-branch template-alllibraries.xml Log Message: Added support for weak-linking the system interface library and/or the user-supplied dynamic libraries. The latter is all-or-nothing, i.e. no way to weak link only specific libraries, but for now that is good enough. Index: template-alllibraries.xml =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-ppc/template-alllibraries.xml,v retrieving revision 1.1 retrieving revision 1.1.14.1 diff -C2 -d -r1.1 -r1.1.14.1 *** template-alllibraries.xml 2001/01/23 22:33:00 1.1 --- template-alllibraries.xml 2001/11/26 23:05:06 1.1.14.1 *************** *** 4,7 **** MacOS Library ! Debug --- 4,7 ---- MacOS Library ! %(libraryflags)s From jackjansen@users.sourceforge.net Mon Nov 26 23:05:13 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Mon, 26 Nov 2001 15:05:13 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/mkcwproject __init__.py,1.10,1.10.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject In directory usw-pr-cvs1:/tmp/cvs-serv3818/Python/Mac/Lib/mkcwproject Modified Files: Tag: r22b2-branch __init__.py Log Message: Added support for weak-linking the system interface library and/or the user-supplied dynamic libraries. The latter is all-or-nothing, i.e. no way to weak link only specific libraries, but for now that is good enough. Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/__init__.py,v retrieving revision 1.10 retrieving revision 1.10.8.1 diff -C2 -d -r1.10 -r1.10.8.1 *** __init__.py 2001/08/25 12:00:44 1.10 --- __init__.py 2001/11/26 23:05:11 1.10.8.1 *************** *** 19,22 **** --- 19,26 ---- if not dictcopy.has_key('mac_outputdir'): dictcopy['mac_outputdir'] = ':lib:' + if not dictcopy.has_key('stdlibraryflags'): + dictcopy['stdlibraryflags'] = 'Debug' + if not dictcopy.has_key('libraryflags'): + dictcopy['libraryflags'] = 'Debug' if not dictcopy.has_key('mac_dllname'): dictcopy['mac_dllname'] = modulename + '.ppc.slb' From bwarsaw@users.sourceforge.net Tue Nov 27 07:12:37 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Mon, 26 Nov 2001 23:12:37 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_email.py,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv5345 Modified Files: test_email.py Log Message: test_formatdate(): Integrating Jack's 22b2 branch fix for Mac epoch: More changes to the formatdate epoch test: the Mac epoch is in localtime, so east of GMT it falls in 1903:-( Changed the test to obtain the epoch in both local time and GMT, and do the right thing in the comparisons. As a sanity measure also check that day/month is Jan 1. Index: test_email.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_email.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** test_email.py 2001/11/19 18:38:42 1.21 --- test_email.py 2001/11/27 07:12:35 1.22 *************** *** 922,931 **** def test_formatdate(self): now = 1005327232.109884 ! epoch = time.gmtime(0)[0] # When does the epoch start? ! if epoch == 1970: # traditional Unix epoch matchdate = 'Fri, 09 Nov 2001 17:33:52 -0000' ! elif epoch == 1904: # Mac epoch matchdate = 'Sat, 09 Nov 1935 16:33:52 -0000' --- 922,932 ---- def test_formatdate(self): now = 1005327232.109884 ! gm_epoch = time.gmtime(0)[0:3] ! loc_epoch = time.localtime(0)[0:3] # When does the epoch start? ! if gm_epoch == (1970, 1, 1): # traditional Unix epoch matchdate = 'Fri, 09 Nov 2001 17:33:52 -0000' ! elif loc_epoch == (1904, 1, 1): # Mac epoch matchdate = 'Sat, 09 Nov 1935 16:33:52 -0000' From tim_one@users.sourceforge.net Tue Nov 27 20:30:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 27 Nov 2001 12:30:44 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc ACKS,1.137,1.138 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv26953/python/Misc Modified Files: ACKS Log Message: SF bug 485175: buffer overflow in traceback.c. Bugfix candidate. tb_displayline(): the sprintf format was choking off the file name, but used plain %s for the function name (which can be arbitrarily long). Limit both to 500 chars max. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/ACKS,v retrieving revision 1.137 retrieving revision 1.138 diff -C2 -d -r1.137 -r1.138 *** ACKS 2001/10/31 04:45:45 1.137 --- ACKS 2001/11/27 20:30:42 1.138 *************** *** 275,278 **** --- 275,279 ---- Vladimir Marangozov Doug Marien + Alex Martelli Anthony Martin Roger Masse From tim_one@users.sourceforge.net Tue Nov 27 20:30:45 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 27 Nov 2001 12:30:45 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python traceback.c,2.34,2.35 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv26953/python/Python Modified Files: traceback.c Log Message: SF bug 485175: buffer overflow in traceback.c. Bugfix candidate. tb_displayline(): the sprintf format was choking off the file name, but used plain %s for the function name (which can be arbitrarily long). Limit both to 500 chars max. Index: traceback.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/traceback.c,v retrieving revision 2.34 retrieving revision 2.35 diff -C2 -d -r2.34 -r2.35 *** traceback.c 2001/10/22 22:17:41 2.34 --- traceback.c 2001/11/27 20:30:42 2.35 *************** *** 145,149 **** int err = 0; FILE *xfp; ! char linebuf[1000]; int i; if (filename == NULL || name == NULL) --- 145,149 ---- int err = 0; FILE *xfp; ! char linebuf[2000]; int i; if (filename == NULL || name == NULL) *************** *** 151,158 **** #ifdef MPW /* This is needed by MPW's File and Line commands */ ! #define FMT " File \"%.900s\"; line %d # in %s\n" #else /* This is needed by Emacs' compile command */ ! #define FMT " File \"%.900s\", line %d, in %s\n" #endif xfp = fopen(filename, "r"); --- 151,158 ---- #ifdef MPW /* This is needed by MPW's File and Line commands */ ! #define FMT " File \"%.500s\"; line %d # in %.500s\n" #else /* This is needed by Emacs' compile command */ ! #define FMT " File \"%.500s\", line %d, in %.500s\n" #endif xfp = fopen(filename, "r"); From tim_one@users.sourceforge.net Tue Nov 27 23:29:31 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Tue, 27 Nov 2001 15:29:31 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python ceval.c,2.290,2.291 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv13534/python/Python Modified Files: ceval.c Log Message: SF bug #483469: crash on unbounded recursion in __del__. PyEval_EvalCodeEx(): increment tstate->recursion_depth around the decref of the frame, because the C stack for this call is still in use and the decref can lead to __del__ methods getting called. While this gives tstate->recursion_depth a value proportional to the depth of the C stack (instead of a small constant no matter how deeply __del__s recurse), it's not enough to stop the reported crash when using the default recursion limit on Windows. Bugfix candidate. Index: ceval.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/ceval.c,v retrieving revision 2.290 retrieving revision 2.291 diff -C2 -d -r2.290 -r2.291 *** ceval.c 2001/11/20 15:17:25 2.290 --- ceval.c 2001/11/27 23:29:29 2.291 *************** *** 2561,2565 **** --- 2561,2573 ---- fail: /* Jump here from prelude on failure */ + /* decref'ing the frame can cause __del__ methods to get invoked, + which can call back into Python. While we're done with the + current Python frame (f), the associated C stack is still in use, + so recursion_depth must be boosted for the duration. + */ + assert(tstate != NULL); + ++tstate->recursion_depth; Py_DECREF(f); + --tstate->recursion_depth; return retval; } From jhylton@users.sourceforge.net Tue Nov 27 23:35:13 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Tue, 27 Nov 2001 15:35:13 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/compiler pycodegen.py,1.57,1.58 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/compiler In directory usw-pr-cvs1:/tmp/cvs-serv16134 Modified Files: pycodegen.py Log Message: Fix [ #484645 ] little bug in pycodegen.py Index: pycodegen.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/compiler/pycodegen.py,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** pycodegen.py 2001/11/09 16:24:34 1.57 --- pycodegen.py 2001/11/27 23:35:10 1.58 *************** *** 1379,1381 **** for file in sys.argv[1:]: ! compile(file) --- 1379,1381 ---- for file in sys.argv[1:]: ! compileFile(file) From akuchling@users.sourceforge.net Wed Nov 28 04:28:34 2001 From: akuchling@users.sourceforge.net (A.M. Kuchling) Date: Tue, 27 Nov 2001 20:28:34 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.196,1.197 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv15968 Modified Files: socketmodule.c Log Message: Fix docstring typo Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.196 retrieving revision 1.197 diff -C2 -d -r1.196 -r1.197 *** socketmodule.c 2001/11/19 10:41:26 1.196 --- socketmodule.c 2001/11/28 04:28:31 1.197 *************** *** 1853,1857 **** getsockopt() -- get socket options\n\ listen() -- start listening for incoming connections\n\ ! makefile() -- return a file object corresponding tot the socket (*)\n\ recv() -- receive data\n\ recvfrom() -- receive data and sender's address\n\ --- 1853,1857 ---- getsockopt() -- get socket options\n\ listen() -- start listening for incoming connections\n\ ! makefile() -- return a file object corresponding to the socket (*)\n\ recv() -- receive data\n\ recvfrom() -- receive data and sender's address\n\ From bwarsaw@users.sourceforge.net Wed Nov 28 05:49:41 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 27 Nov 2001 21:49:41 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib pprint.py,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv31732/Lib Modified Files: pprint.py Log Message: __format(): Applied SF patch #482003 by Skip to fix multiline dict output. Patch includes additional test case test_basic_line_wrap(). This patch is a candidate for Python 2.1.2. Index: pprint.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/pprint.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** pprint.py 2001/11/13 21:51:26 1.18 --- pprint.py 2001/11/28 05:49:39 1.19 *************** *** 159,163 **** for key, ent in items[1:]: rep = self.__repr(key, context, level) ! write(',\n%s: %s' % (' '*indent, rep)) self.__format(ent, stream, indent + _len(rep) + 2, allowance + 1, context, level) --- 159,163 ---- for key, ent in items[1:]: rep = self.__repr(key, context, level) ! write(',\n%s%s: ' % (' '*indent, rep)) self.__format(ent, stream, indent + _len(rep) + 2, allowance + 1, context, level) From bwarsaw@users.sourceforge.net Wed Nov 28 05:49:41 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Tue, 27 Nov 2001 21:49:41 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_pprint.py,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv31732/Lib/test Modified Files: test_pprint.py Log Message: __format(): Applied SF patch #482003 by Skip to fix multiline dict output. Patch includes additional test case test_basic_line_wrap(). This patch is a candidate for Python 2.1.2. Index: test_pprint.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_pprint.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_pprint.py 2001/09/20 21:33:42 1.6 --- test_pprint.py 2001/11/28 05:49:39 1.7 *************** *** 78,81 **** --- 78,100 ---- + def test_basic_line_wrap(self): + """verify basic line-wrapping operation""" + o = {'RPM_cal': 0, + 'RPM_cal2': 48059, + 'Speed_cal': 0, + 'controldesk_runtime_us': 0, + 'main_code_runtime_us': 0, + 'read_io_runtime_us': 0, + 'write_io_runtime_us': 43690} + exp = """\ + {'RPM_cal': 0, + 'RPM_cal2': 48059, + 'Speed_cal': 0, + 'controldesk_runtime_us': 0, + 'main_code_runtime_us': 0, + 'read_io_runtime_us': 0, + 'write_io_runtime_us': 43690}""" + self.assertEqual(pprint.pformat(o), exp) + def test_main(): test_support.run_unittest(QueryTestCase) From fdrake@users.sourceforge.net Wed Nov 28 07:26:17 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 27 Nov 2001 23:26:17 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/api abstract.tex,1.7,1.8 intro.tex,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv17014/api Modified Files: abstract.tex intro.tex Log Message: Clean up some markup cruft. A number of the macros that take no parameters (like \UNIX) are commonly entered using an empty group to separate the markup from a following inter-word space; this is not needed when the next character is punctuation, or the markup is the last thing in the enclosing group. These cases were marked inconsistently; the empty group is now *only* used when needed. Index: abstract.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/abstract.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** abstract.tex 2001/11/12 07:46:31 1.7 --- abstract.tex 2001/11/28 07:26:14 1.8 *************** *** 737,741 **** \begin{cfuncdesc}{PyObject*}{PySequence_Fast_GET_ITEM}{PyObject *o, int i} Return the \var{i}th element of \var{o}, assuming that \var{o} was ! returned by \cfunction{PySequence_Fast()}, \var{o} is not \NULL{}, and that \var{i} is within bounds. \end{cfuncdesc} --- 737,741 ---- \begin{cfuncdesc}{PyObject*}{PySequence_Fast_GET_ITEM}{PyObject *o, int i} Return the \var{i}th element of \var{o}, assuming that \var{o} was ! returned by \cfunction{PySequence_Fast()}, \var{o} is not \NULL, and that \var{i} is within bounds. \end{cfuncdesc} *************** *** 744,748 **** Returns the length of \var{o}, assuming that \var{o} was returned by \cfunction{PySequence_Fast()} and that \var{o} is ! not \NULL{}. The size can also be gotten by calling \cfunction{PySequence_Size()} on \var{o}, but \cfunction{PySequence_Fast_GET_SIZE()} is faster because it can --- 744,748 ---- Returns the length of \var{o}, assuming that \var{o} was returned by \cfunction{PySequence_Fast()} and that \var{o} is ! not \NULL. The size can also be gotten by calling \cfunction{PySequence_Size()} on \var{o}, but \cfunction{PySequence_Fast_GET_SIZE()} is faster because it can Index: intro.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/intro.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** intro.tex 2001/10/25 15:53:44 1.2 --- intro.tex 2001/11/28 07:26:14 1.3 *************** *** 4,8 **** The Application Programmer's Interface to Python gives C and \Cpp{} programmers access to the Python interpreter at a variety of ! levels. The API is equally usable from \Cpp{}, but for brevity it is generally referred to as the Python/C API. There are two fundamentally different reasons for using the Python/C API. The first --- 4,8 ---- The Application Programmer's Interface to Python gives C and \Cpp{} programmers access to the Python interpreter at a variety of ! levels. The API is equally usable from \Cpp, but for brevity it is generally referred to as the Python/C API. There are two fundamentally different reasons for using the Python/C API. The first From fdrake@users.sourceforge.net Wed Nov 28 07:26:17 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 27 Nov 2001 23:26:17 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/ext embedding.tex,1.3,1.4 extending.tex,1.5,1.6 unix.tex,1.1,1.2 windows.tex,1.1,1.2 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ext In directory usw-pr-cvs1:/tmp/cvs-serv17014/ext Modified Files: embedding.tex extending.tex unix.tex windows.tex Log Message: Clean up some markup cruft. A number of the macros that take no parameters (like \UNIX) are commonly entered using an empty group to separate the markup from a following inter-word space; this is not needed when the next character is punctuation, or the markup is the last thing in the enclosing group. These cases were marked inconsistently; the empty group is now *only* used when needed. Index: embedding.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/embedding.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** embedding.tex 2001/11/17 06:50:42 1.3 --- embedding.tex 2001/11/28 07:26:14 1.4 *************** *** 273,284 **** ! \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{}. --- 273,284 ---- ! \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. Index: extending.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/extending.tex,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** extending.tex 2001/11/17 06:50:42 1.5 --- extending.tex 2001/11/28 07:26:15 1.6 *************** *** 1,3 **** ! \chapter{Extending Python with C or \Cpp{} \label{intro}} --- 1,3 ---- ! \chapter{Extending Python with C or \Cpp \label{intro}} *************** *** 500,504 **** \ref{methodTable}, ``The Module's Method Table and Initialization Function.'' The \cfunction{PyArg_ParseTuple()} function and its ! arguments are documented in section \ref{parseTuple}, ``Extracting Parameters in Extension Functions.'' --- 500,504 ---- \ref{methodTable}, ``The Module's Method Table and Initialization Function.'' The \cfunction{PyArg_ParseTuple()} function and its ! arguments are documented in section~\ref{parseTuple}, ``Extracting Parameters in Extension Functions.'' *************** *** 506,511 **** increment/decrement the reference count of an object and are safe in the presence of \NULL{} pointers (but note that \var{temp} will not be ! \NULL{} in this context). More info on them in section ! \ref{refcounts}, ``Reference Counts.'' Later, when it is time to call the function, you call the C function --- 506,511 ---- increment/decrement the reference count of an object and are safe in the presence of \NULL{} pointers (but note that \var{temp} will not be ! \NULL{} in this context). More info on them in ! section~\ref{refcounts}, ``Reference Counts.'' Later, when it is time to call the function, you call the C function *************** *** 545,549 **** Before you do this, however, it is important to check that the return ! value isn't \NULL{}. If it is, the Python function terminated by raising an exception. If the C code that called \cfunction{PyEval_CallObject()} is called from Python, it should now --- 545,549 ---- Before you do this, however, it is important to check that the return ! value isn't \NULL. If it is, the Python function terminated by raising an exception. If the C code that called \cfunction{PyEval_CallObject()} is called from Python, it should now *************** *** 653,657 **** \item[\samp{z} (string or \code{None}) {[char *]}] Like \samp{s}, but the Python object may also be \code{None}, in which ! case the C pointer is set to \NULL{}. \item[\samp{z\#} (string or \code{None} or any read buffer compatible object) --- 653,657 ---- \item[\samp{z} (string or \code{None}) {[char *]}] Like \samp{s}, but the Python object may also be \code{None}, in which ! case the C pointer is set to \NULL. \item[\samp{z\#} (string or \code{None} or any read buffer compatible object) *************** *** 681,685 **** the buffer used for storing the encoded data). ! The encoding name must map to a registered codec. If set to \NULL{}, the default encoding is used. --- 681,685 ---- the buffer used for storing the encoded data). ! The encoding name must map to a registered codec. If set to \NULL, the default encoding is used. *************** *** 706,710 **** (\var{*buffer_length}, the buffer length). ! The encoding name must map to a registered codec. If set to \NULL{}, the default encoding is used. --- 706,710 ---- (\var{*buffer_length}, the buffer length). ! The encoding name must map to a registered codec. If set to \NULL, the default encoding is used. *************** *** 767,771 **** The C program thus receives the actual object that was passed. The object's reference count is not increased. The pointer stored is not ! \NULL{}. \item[\samp{O!} (object) {[\var{typeobject}, PyObject *]}] --- 767,771 ---- The C program thus receives the actual object that was passed. The object's reference count is not increased. The pointer stored is not ! \NULL. \item[\samp{O!} (object) {[\var{typeobject}, PyObject *]}] *************** *** 946,950 **** \cfunction{PyArg_ParseTuple()} function. The \var{kwdict} parameter is the dictionary of keywords received as the third parameter from the ! Python runtime. The \var{kwlist} parameter is a \NULL{}-terminated list of strings which identify the parameters; the names are matched with the type information from \var{format} from left to right. On --- 946,950 ---- \cfunction{PyArg_ParseTuple()} function. The \var{kwdict} parameter is the dictionary of keywords received as the third parameter from the ! Python runtime. The \var{kwlist} parameter is a \NULL-terminated list of strings which identify the parameters; the names are matched with the type information from \var{format} from left to right. On *************** *** 1056,1064 **** \item[\samp{s} (string) {[char *]}] Convert a null-terminated C string to a Python object. If the C ! string pointer is \NULL{}, \code{None} is used. \item[\samp{s\#} (string) {[char *, int]}] Convert a C string and its length to a Python object. If the C string ! pointer is \NULL{}, the length is ignored and \code{None} is returned. --- 1056,1064 ---- \item[\samp{s} (string) {[char *]}] Convert a null-terminated C string to a Python object. If the C ! string pointer is \NULL, \code{None} is used. \item[\samp{s\#} (string) {[char *, int]}] Convert a C string and its length to a Python object. If the C string ! pointer is \NULL, the length is ignored and \code{None} is returned. *************** *** 1172,1179 **** \label{refcounts}} ! In languages like C or \Cpp{}, the programmer is responsible for dynamic allocation and deallocation of memory on the heap. In C, this is done using the functions \cfunction{malloc()} and ! \cfunction{free()}. In \Cpp{}, the operators \keyword{new} and \keyword{delete} are used with essentially the same meaning; they are actually implemented using \cfunction{malloc()} and --- 1172,1179 ---- \label{refcounts}} ! In languages like C or \Cpp, the programmer is responsible for dynamic allocation and deallocation of memory on the heap. In C, this is done using the functions \cfunction{malloc()} and ! \cfunction{free()}. In \Cpp, the operators \keyword{new} and \keyword{delete} are used with essentially the same meaning; they are actually implemented using \cfunction{malloc()} and *************** *** 1424,1428 **** exception occurred. The reason for not testing for \NULL{} arguments is that functions often pass the objects they receive on to ! other function --- if each function were to test for \NULL{}, there would be a lot of redundant tests and the code would run more slowly. --- 1424,1428 ---- exception occurred. The reason for not testing for \NULL{} arguments is that functions often pass the objects they receive on to ! other function --- if each function were to test for \NULL, there would be a lot of redundant tests and the code would run more slowly. *************** *** 1459,1466 **** ! \section{Writing Extensions in \Cpp{} \label{cplusplus}} ! It is possible to write extension modules in \Cpp{}. Some restrictions apply. If the main program (the Python interpreter) is compiled and linked by the C compiler, global or static objects with constructors --- 1459,1466 ---- ! \section{Writing Extensions in \Cpp \label{cplusplus}} ! It is possible to write extension modules in \Cpp. Some restrictions apply. If the main program (the Python interpreter) is compiled and linked by the C compiler, global or static objects with constructors Index: unix.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/unix.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** unix.tex 2001/08/20 19:30:29 1.1 --- unix.tex 2001/11/28 07:26:15 1.2 *************** *** 14,18 **** 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 --- 14,18 ---- 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 Index: windows.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/windows.tex,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** windows.tex 2001/08/20 19:30:29 1.1 --- windows.tex 2001/11/28 07:26:15 1.2 *************** *** 4,8 **** 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 --- 4,8 ---- 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 *************** *** 67,71 **** 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 --- 67,71 ---- 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 *************** *** 81,85 **** 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 --- 81,85 ---- 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 *************** *** 100,104 **** 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 --- 100,104 ---- 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 *************** *** 110,114 **** 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. --- 110,114 ---- 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. *************** *** 117,121 **** \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. --- 117,121 ---- \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. From fdrake@users.sourceforge.net Wed Nov 28 07:26:17 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 27 Nov 2001 23:26:17 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/ref ref1.tex,1.13,1.14 ref2.tex,1.31,1.32 ref3.tex,1.76,1.77 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ref In directory usw-pr-cvs1:/tmp/cvs-serv17014/ref Modified Files: ref1.tex ref2.tex ref3.tex Log Message: Clean up some markup cruft. A number of the macros that take no parameters (like \UNIX) are commonly entered using an empty group to separate the markup from a following inter-word space; this is not needed when the next character is punctuation, or the markup is the last thing in the enclosing group. These cases were marked inconsistently; the empty group is now *only* used when needed. Index: ref1.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref1.tex,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** ref1.tex 2001/06/23 05:27:20 1.13 --- ref1.tex 2001/11/28 07:26:15 1.14 *************** *** 76,80 **** to describe the notion of `control character' if needed. \index{lexical definitions} ! \index{ASCII@\ASCII{}} Even though the notation used is almost the same, there is a big --- 76,80 ---- to describe the notion of `control character' if needed. \index{lexical definitions} ! \index{ASCII@\ASCII} Even though the notation used is almost the same, there is a big Index: ref2.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref2.tex,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** ref2.tex 2001/08/30 20:51:58 1.31 --- ref2.tex 2001/11/28 07:26:15 1.32 *************** *** 15,19 **** The run-time character set depends on the I/O devices connected to the ! program but is generally a superset of \ASCII{}. \strong{Future compatibility note:} It may be tempting to assume that the --- 15,19 ---- The run-time character set depends on the I/O devices connected to the ! program but is generally a superset of \ASCII. \strong{Future compatibility note:} It may be tempting to assume that the *************** *** 53,57 **** A physical line ends in whatever the current platform's convention is ! for terminating lines. On \UNIX{}, this is the \ASCII{} LF (linefeed) character. On DOS/Windows, it is the \ASCII{} sequence CR LF (return followed by linefeed). On Macintosh, it is the \ASCII{} CR (return) --- 53,57 ---- A physical line ends in whatever the current platform's convention is ! for terminating lines. On \UNIX, this is the \ASCII{} LF (linefeed) character. On DOS/Windows, it is the \ASCII{} sequence CR LF (return followed by linefeed). On Macintosh, it is the \ASCII{} CR (return) *************** *** 143,147 **** such that the total number of characters up to and including the replacement is a multiple of ! eight (this is intended to be the same rule as used by \UNIX{}). The total number of spaces preceding the first non-blank character then determines the line's indentation. Indentation cannot be split over --- 143,147 ---- such that the total number of characters up to and including the replacement is a multiple of ! eight (this is intended to be the same rule as used by \UNIX). The total number of spaces preceding the first non-blank character then determines the line's indentation. Indentation cannot be split over *************** *** 309,313 **** \index{string literal} ! \index{ASCII@\ASCII{}} \begin{productionlist} \production{stringliteral} --- 309,313 ---- \index{string literal} ! \index{ASCII@\ASCII} \begin{productionlist} \production{stringliteral} *************** *** 389,393 **** \lineii{\e x\var{hh}} {\ASCII{} character with hex value \var{hh}} \end{tableii} ! \index{ASCII@\ASCII{}} As in Standard C, up to three octal digits are accepted. However, --- 389,393 ---- \lineii{\e x\var{hh}} {\ASCII{} character with hex value \var{hh}} \end{tableii} ! \index{ASCII@\ASCII} As in Standard C, up to three octal digits are accepted. However, *************** *** 597,601 **** lexically as delimiters, but also perform an operation. ! The following printing ASCII characters have special meaning as part of other tokens or are otherwise significant to the lexical analyzer: --- 597,601 ---- lexically as delimiters, but also perform an operation. ! The following printing \ASCII{} characters have special meaning as part of other tokens or are otherwise significant to the lexical analyzer: *************** *** 607,611 **** occurrence outside string literals and comments is an unconditional error: ! \index{ASCII@\ASCII{}} \begin{verbatim} --- 607,611 ---- occurrence outside string literals and comments is an unconditional error: ! \index{ASCII@\ASCII} \begin{verbatim} Index: ref3.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ref/ref3.tex,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** ref3.tex 2001/10/20 04:19:50 1.76 --- ref3.tex 2001/11/28 07:26:15 1.77 *************** *** 280,291 **** \index{character} \index{byte} ! \index{ASCII@\ASCII{}} ! (On systems whose native character set is not \ASCII{}, strings may use EBCDIC in their internal representation, provided the functions \function{chr()} and \function{ord()} implement a mapping between \ASCII{} and EBCDIC, and string comparison preserves the \ASCII{} order. Or perhaps someone can propose a better rule?) ! \index{ASCII@\ASCII{}} \index{EBCDIC} \index{character set} --- 280,291 ---- \index{character} \index{byte} ! \index{ASCII@\ASCII} ! (On systems whose native character set is not \ASCII, strings may use EBCDIC in their internal representation, provided the functions \function{chr()} and \function{ord()} implement a mapping between \ASCII{} and EBCDIC, and string comparison preserves the \ASCII{} order. Or perhaps someone can propose a better rule?) ! \index{ASCII@\ASCII} \index{EBCDIC} \index{character set} From fdrake@users.sourceforge.net Wed Nov 28 07:26:17 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 27 Nov 2001 23:26:17 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/tut tut.tex,1.151,1.152 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tut In directory usw-pr-cvs1:/tmp/cvs-serv17014/tut Modified Files: tut.tex Log Message: Clean up some markup cruft. A number of the macros that take no parameters (like \UNIX) are commonly entered using an empty group to separate the markup from a following inter-word space; this is not needed when the next character is punctuation, or the markup is the last thing in the enclosing group. These cases were marked inconsistently; the empty group is now *only* used when needed. Index: tut.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tut/tut.tex,v retrieving revision 1.151 retrieving revision 1.152 diff -C2 -d -r1.151 -r1.152 *** tut.tex 2001/10/16 03:25:00 1.151 --- tut.tex 2001/11/28 07:26:15 1.152 *************** *** 53,57 **** \citetitle[../ref/ref.html]{Python Reference Manual} gives a more formal definition of the language. To write extensions in C or ! \Cpp{}, read \citetitle[../ext/ext.html]{Extending and Embedding the Python Interpreter} and \citetitle[../api/api.html]{Python/C API Reference}. There are also several books covering Python in depth. --- 53,57 ---- \citetitle[../ref/ref.html]{Python Reference Manual} gives a more formal definition of the language. To write extensions in C or ! \Cpp, read \citetitle[../ext/ext.html]{Extending and Embedding the Python Interpreter} and \citetitle[../api/api.html]{Python/C API Reference}. There are also several books covering Python in depth. *************** *** 183,187 **** The interpreter's line-editing features usually aren't very ! sophisticated. On \UNIX{}, whoever installed the interpreter may have enabled support for the GNU readline library, which adds more elaborate interactive editing and history features. Perhaps the --- 183,187 ---- The interpreter's line-editing features usually aren't very ! sophisticated. On \UNIX, whoever installed the interpreter may have enabled support for the GNU readline library, which adds more elaborate interactive editing and history features. Perhaps the *************** *** 2231,2235 **** directory names. When \envvar{PYTHONPATH} is not set, or when the file is not found there, the search continues in an installation-dependent ! default path; on \UNIX{}, this is usually \file{.:/usr/local/lib/python}. Actually, modules are searched in the list of directories given by the --- 2231,2235 ---- directory names. When \envvar{PYTHONPATH} is not set, or when the file is not found there, the search continues in an installation-dependent ! default path; on \UNIX, this is usually \file{.:/usr/local/lib/python}. Actually, modules are searched in the list of directories given by the *************** *** 2600,2604 **** %(One could design a notation to refer to parent packages, similar to ! %the use of ".." to refer to the parent directory in Unix and Windows %filesystems. In fact, the \module{ni} module, which was the %ancestor of this package system, supported this using \code{__} for --- 2600,2604 ---- %(One could design a notation to refer to parent packages, similar to ! %the use of ".." to refer to the parent directory in \UNIX{} and Windows %filesystems. In fact, the \module{ni} module, which was the %ancestor of this package system, supported this using \code{__} for *************** *** 3336,3340 **** make occasional use of Smalltalk and \Cpp{} terms. (I would use Modula-3 terms, since its object-oriented semantics are closer to those of ! Python than \Cpp{}, but I expect that few readers have heard of it.) I also have to warn you that there's a terminological pitfall for --- 3336,3340 ---- make occasional use of Smalltalk and \Cpp{} terms. (I would use Modula-3 terms, since its object-oriented semantics are closer to those of ! Python than \Cpp, but I expect that few readers have heard of it.) I also have to warn you that there's a terminological pitfall for *************** *** 3593,3597 **** The first I'll call \emph{data attributes}. These correspond to ``instance variables'' in Smalltalk, and to ``data members'' in ! \Cpp{}. Data attributes need not be declared; like local variables, they spring into existence when they are first assigned to. For example, if \code{x} is the instance of \class{MyClass} created above, --- 3593,3597 ---- The first I'll call \emph{data attributes}. These correspond to ``instance variables'' in Smalltalk, and to ``data members'' in ! \Cpp. Data attributes need not be declared; like local variables, they spring into existence when they are first assigned to. For example, if \code{x} is the instance of \class{MyClass} created above, From fdrake@users.sourceforge.net Wed Nov 28 07:26:17 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 27 Nov 2001 23:26:17 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libamoeba.tex,1.15,1.16 libbase64.tex,1.19,1.20 libbinascii.tex,1.22,1.23 libbinhex.tex,1.8,1.9 libcalendar.tex,1.12,1.13 libcgi.tex,1.33,1.34 libcurses.tex,1.36,1.37 libdl.tex,1.4,1.5 libexcs.tex,1.42,1.43 libfcntl.tex,1.26,1.27 libfnmatch.tex,1.19,1.20 libgetpass.tex,1.3,1.4 libmailbox.tex,1.23,1.24 libmmap.tex,1.6,1.7 libos.tex,1.70,1.71 libposix.tex,1.60,1.61 libposixfile.tex,1.25,1.26 libposixpath.tex,1.21,1.22 libselect.tex,1.19,1.20 libsite.tex,1.21,1.22 libstat.tex,1.21,1.22 libstdtypes.tex,1.75,1.76 libsys.tex,1.55,1.56 libtelnetlib.tex,1.8,1.9 libtempfile.tex,1.16,1.17 libtermios.tex,1.21,1.22 libthread.tex,1.23,1.24 libtime.tex,1.47,1.48 libtty.tex,1.2,1.3 tkinter.tex,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv17014/lib Modified Files: libamoeba.tex libbase64.tex libbinascii.tex libbinhex.tex libcalendar.tex libcgi.tex libcurses.tex libdl.tex libexcs.tex libfcntl.tex libfnmatch.tex libgetpass.tex libmailbox.tex libmmap.tex libos.tex libposix.tex libposixfile.tex libposixpath.tex libselect.tex libsite.tex libstat.tex libstdtypes.tex libsys.tex libtelnetlib.tex libtempfile.tex libtermios.tex libthread.tex libtime.tex libtty.tex tkinter.tex Log Message: Clean up some markup cruft. A number of the macros that take no parameters (like \UNIX) are commonly entered using an empty group to separate the markup from a following inter-word space; this is not needed when the next character is punctuation, or the markup is the last thing in the enclosing group. These cases were marked inconsistently; the empty group is now *only* used when needed. Index: libamoeba.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libamoeba.tex,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** libamoeba.tex 1999/03/02 16:37:06 1.15 --- libamoeba.tex 2001/11/28 07:26:15 1.16 *************** *** 124,128 **** \begin{funcdesc}{tod_gettime}{} ! Returns the time (in seconds since the Epoch, in UCT, as for \POSIX{}) from a time server. \end{funcdesc} --- 124,128 ---- \begin{funcdesc}{tod_gettime}{} ! Returns the time (in seconds since the Epoch, in UCT, as for \POSIX) from a time server. \end{funcdesc} Index: libbase64.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libbase64.tex,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** libbase64.tex 2001/09/28 16:01:46 1.19 --- libbase64.tex 2001/11/28 07:26:15 1.20 *************** *** 57,61 **** \begin{seealso} ! \seemodule{binascii}{Support module containing \ASCII{}-to-binary and binary-to-\ASCII{} conversions.} \seerfc{1521}{MIME (Multipurpose Internet Mail Extensions) Part One: --- 57,61 ---- \begin{seealso} ! \seemodule{binascii}{Support module containing \ASCII-to-binary and binary-to-\ASCII{} conversions.} \seerfc{1521}{MIME (Multipurpose Internet Mail Extensions) Part One: Index: libbinascii.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libbinascii.tex,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** libbinascii.tex 2001/10/15 13:45:49 1.22 --- libbinascii.tex 2001/11/28 07:26:15 1.23 *************** *** 1,4 **** \section{\module{binascii} --- ! Convert between binary and \ASCII{}} \declaremodule{builtin}{binascii} --- 1,4 ---- \section{\module{binascii} --- ! Convert between binary and \ASCII} \declaremodule{builtin}{binascii} *************** *** 8,12 **** The \module{binascii} module contains a number of methods to convert ! between binary and various \ASCII{}-encoded binary representations. Normally, you will not use these functions directly but use wrapper modules like \refmodule{uu}\refstmodindex{uu} or --- 8,12 ---- The \module{binascii} module contains a number of methods to convert ! between binary and various \ASCII-encoded binary representations. Normally, you will not use these functions directly but use wrapper modules like \refmodule{uu}\refstmodindex{uu} or Index: libbinhex.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libbinhex.tex,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** libbinhex.tex 2000/10/18 17:43:06 1.8 --- libbinhex.tex 2001/11/28 07:26:15 1.9 *************** *** 7,11 **** This module encodes and decodes files in binhex4 format, a format ! allowing representation of Macintosh files in \ASCII{}. On the Macintosh, both forks of a file and the finder information are encoded (or decoded), on other platforms only the data fork is handled. --- 7,11 ---- This module encodes and decodes files in binhex4 format, a format ! allowing representation of Macintosh files in \ASCII. On the Macintosh, both forks of a file and the finder information are encoded (or decoded), on other platforms only the data fork is handled. Index: libcalendar.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcalendar.tex,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** libcalendar.tex 2001/11/06 22:14:34 1.12 --- libcalendar.tex 2001/11/28 07:26:15 1.13 *************** *** 87,91 **** An unrelated but handy function that takes a time tuple such as returned by the \function{gmtime()} function in the \refmodule{time} ! module, and returns the corresponding Unix timestamp value, assuming an epoch of 1970, and the POSIX encoding. In fact, \function{time.gmtime()} and \function{timegm()} are each others' inverse. --- 87,91 ---- An unrelated but handy function that takes a time tuple such as returned by the \function{gmtime()} function in the \refmodule{time} ! module, and returns the corresponding \UNIX{} timestamp value, assuming an epoch of 1970, and the POSIX encoding. In fact, \function{time.gmtime()} and \function{timegm()} are each others' inverse. Index: libcgi.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcgi.tex,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** libcgi.tex 2001/09/11 16:27:03 1.33 --- libcgi.tex 2001/11/28 07:26:15 1.34 *************** *** 406,410 **** ! \subsection{Installing your CGI script on a Unix system} Read the documentation for your HTTP server and check with your local --- 406,410 ---- ! \subsection{Installing your CGI script on a \UNIX\ system} Read the documentation for your HTTP server and check with your local Index: libcurses.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libcurses.tex,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** libcurses.tex 2001/10/20 16:07:41 1.36 --- libcurses.tex 2001/11/28 07:26:15 1.37 *************** *** 151,155 **** \begin{funcdesc}{erasechar}{} ! Returns the user's current erase character. Under Unix operating systems this is a property of the controlling tty of the curses program, and is not set by the curses library itself. --- 151,155 ---- \begin{funcdesc}{erasechar}{} ! Returns the user's current erase character. Under \UNIX{} operating systems this is a property of the controlling tty of the curses program, and is not set by the curses library itself. *************** *** 285,289 **** \begin{funcdesc}{killchar}{} ! Returns the user's current line kill character. Under Unix operating systems this is a property of the controlling tty of the curses program, and is not set by the curses library itself. --- 285,289 ---- \begin{funcdesc}{killchar}{} ! Returns the user's current line kill character. Under \UNIX{} operating systems this is a property of the controlling tty of the curses program, and is not set by the curses library itself. Index: libdl.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdl.tex,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** libdl.tex 2001/10/20 04:24:09 1.4 --- libdl.tex 2001/11/28 07:26:15 1.5 *************** *** 88,92 **** The arguments must be either Python integers, which will be passed as is, Python strings, to which a pointer will be passed, ! or \code{None}, which will be passed as \NULL{}. Note that strings should only be passed to functions as \ctype{const char*}, as Python will not like its string mutated. --- 88,92 ---- The arguments must be either Python integers, which will be passed as is, Python strings, to which a pointer will be passed, ! or \code{None}, which will be passed as \NULL. Note that strings should only be passed to functions as \ctype{const char*}, as Python will not like its string mutated. Index: libexcs.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libexcs.tex,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** libexcs.tex 2001/10/06 06:10:54 1.42 --- libexcs.tex 2001/11/28 07:26:15 1.43 *************** *** 137,145 **** % XXXJH xrefs here Raised when one of the built-in functions (\function{input()} or ! \function{raw_input()}) hits an end-of-file condition (\EOF{}) without reading any data. % XXXJH xrefs here (N.B.: the \method{read()} and \method{readline()} methods of file ! objects return an empty string when they hit \EOF{}.) \end{excdesc} --- 137,145 ---- % XXXJH xrefs here Raised when one of the built-in functions (\function{input()} or ! \function{raw_input()}) hits an end-of-file condition (\EOF) without reading any data. % XXXJH xrefs here (N.B.: the \method{read()} and \method{readline()} methods of file ! objects return an empty string when they hit \EOF.) \end{excdesc} Index: libfcntl.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfcntl.tex,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** libfcntl.tex 2001/05/09 21:09:57 1.26 --- libfcntl.tex 2001/11/28 07:26:15 1.27 *************** *** 7,12 **** \sectionauthor{Jaap Vermeulen}{} ! \indexii{UNIX@\UNIX{}}{file control} ! \indexii{UNIX@\UNIX{}}{I/O control} This module performs file control and I/O control on file descriptors. --- 7,12 ---- \sectionauthor{Jaap Vermeulen}{} ! \indexii{UNIX@\UNIX}{file control} ! \indexii{UNIX@\UNIX}{I/O control} This module performs file control and I/O control on file descriptors. Index: libfnmatch.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfnmatch.tex,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** libfnmatch.tex 2001/06/16 08:14:04 1.19 --- libfnmatch.tex 2001/11/28 07:26:15 1.20 *************** *** 20,24 **** \end{tableii} ! Note that the filename separator (\code{'/'} on \UNIX{}) is \emph{not} special to this module. See module \refmodule{glob}\refstmodindex{glob} for pathname expansion --- 20,24 ---- \end{tableii} ! Note that the filename separator (\code{'/'} on \UNIX) is \emph{not} special to this module. See module \refmodule{glob}\refstmodindex{glob} for pathname expansion Index: libgetpass.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libgetpass.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** libgetpass.tex 1999/04/22 21:23:21 1.3 --- libgetpass.tex 2001/11/28 07:26:15 1.4 *************** *** 16,20 **** prompted using the string \var{prompt}, which defaults to \code{'Password: '}. ! Availability: Macintosh, \UNIX{}, Windows. \end{funcdesc} --- 16,20 ---- prompted using the string \var{prompt}, which defaults to \code{'Password: '}. ! Availability: Macintosh, \UNIX, Windows. \end{funcdesc} *************** *** 22,26 **** \begin{funcdesc}{getuser}{} Return the ``login name'' of the user. ! Availability: \UNIX{}, Windows. This function checks the environment variables \envvar{LOGNAME}, --- 22,26 ---- \begin{funcdesc}{getuser}{} Return the ``login name'' of the user. ! Availability: \UNIX, Windows. This function checks the environment variables \envvar{LOGNAME}, Index: libmailbox.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmailbox.tex,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** libmailbox.tex 2001/10/01 15:49:56 1.23 --- libmailbox.tex 2001/11/28 07:26:15 1.24 *************** *** 7,11 **** This module defines a number of classes that allow easy and uniform ! access to mail messages in a (\UNIX{}) mailbox. \begin{classdesc}{UnixMailbox}{fp\optional{, factory}} --- 7,11 ---- This module defines a number of classes that allow easy and uniform ! access to mail messages in a (\UNIX) mailbox. \begin{classdesc}{UnixMailbox}{fp\optional{, factory}} Index: libmmap.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libmmap.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** libmmap.tex 2001/11/13 23:11:19 1.6 --- libmmap.tex 2001/11/28 07:26:15 1.7 *************** *** 3,7 **** \declaremodule{builtin}{mmap} ! \modulesynopsis{Interface to memory-mapped files for Unix and Windows.} Memory-mapped file objects behave like both mutable strings and like --- 3,7 ---- \declaremodule{builtin}{mmap} ! \modulesynopsis{Interface to memory-mapped files for \UNIX\ and Windows.} Memory-mapped file objects behave like both mutable strings and like Index: libos.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libos.tex,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** libos.tex 2001/10/18 18:58:30 1.70 --- libos.tex 2001/11/28 07:26:15 1.71 *************** *** 112,121 **** Return the filename corresponding to the controlling terminal of the process. ! Availability: \UNIX{}. \end{funcdesc} \begin{funcdesc}{getegid}{} Return the current process' effective group id. ! Availability: \UNIX{}. \end{funcdesc} [...1125 lines suppressed...] If the configuration value specified by \var{name} isn't defined, the --- 1189,1193 ---- included in that mapping, passing an integer for \var{name} is also accepted. ! Availability: \UNIX. If the configuration value specified by \var{name} isn't defined, the *************** *** 1215,1219 **** that provides information on the known names is given by \code{sysconf_names}. ! Availability: \UNIX{}. \end{funcdesc} --- 1215,1219 ---- that provides information on the known names is given by \code{sysconf_names}. ! Availability: \UNIX. \end{funcdesc} Index: libposix.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libposix.tex,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** libposix.tex 2001/10/24 21:10:52 1.60 --- libposix.tex 2001/11/28 07:26:15 1.61 *************** *** 14,18 **** \strong{Do not import this module directly.} Instead, import the module \refmodule{os}, which provides a \emph{portable} version of this ! interface. On \UNIX{}, the \refmodule{os} module provides a superset of the \module{posix} interface. On non-\UNIX{} operating systems the \module{posix} module is not available, but a subset is always --- 14,18 ---- \strong{Do not import this module directly.} Instead, import the module \refmodule{os}, which provides a \emph{portable} version of this ! interface. On \UNIX, the \refmodule{os} module provides a superset of the \module{posix} interface. On non-\UNIX{} operating systems the \module{posix} module is not available, but a subset is always Index: libposixfile.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libposixfile.tex,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** libposixfile.tex 2001/10/24 21:56:59 1.25 --- libposixfile.tex 2001/11/28 07:26:15 1.26 *************** *** 10,14 **** ! \indexii{\POSIX{}}{file object} \deprecated{1.5}{The locking operation that this module provides is --- 10,14 ---- ! \indexii{\POSIX}{file object} \deprecated{1.5}{The locking operation that this module provides is *************** *** 23,27 **** has all the standard file object methods and adds the methods described below. This module only works for certain flavors of ! \UNIX{}, since it uses \function{fcntl.fcntl()} for file locking.% \withsubitem{(in module fcntl)}{\ttindex{fcntl()}} --- 23,27 ---- has all the standard file object methods and adds the methods described below. This module only works for certain flavors of ! \UNIX, since it uses \function{fcntl.fcntl()} for file locking.% \withsubitem{(in module fcntl)}{\ttindex{fcntl()}} Index: libposixpath.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libposixpath.tex,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** libposixpath.tex 2001/10/20 04:24:09 1.21 --- libposixpath.tex 2001/11/28 07:26:15 1.22 *************** *** 128,132 **** \begin{funcdesc}{normcase}{path} ! Normalize the case of a pathname. On \UNIX{}, this returns the path unchanged; on case-insensitive filesystems, it converts the path to lowercase. On Windows, it also converts forward slashes to backward --- 128,132 ---- \begin{funcdesc}{normcase}{path} ! Normalize the case of a pathname. On \UNIX, this returns the path unchanged; on case-insensitive filesystems, it converts the path to lowercase. On Windows, it also converts forward slashes to backward *************** *** 145,149 **** Return the canonical path of the specified filename, eliminating any symbolic links encountered in the path. ! Availability: \UNIX{}. \versionadded{2.2} \end{funcdesc} --- 145,149 ---- Return the canonical path of the specified filename, eliminating any symbolic links encountered in the path. ! Availability: \UNIX. \versionadded{2.2} \end{funcdesc} *************** *** 154,158 **** Raise an exception if a \function{os.stat()} call on either pathname fails. ! Availability: Macintosh, \UNIX{}. \end{funcdesc} --- 154,158 ---- Raise an exception if a \function{os.stat()} call on either pathname fails. ! Availability: Macintosh, \UNIX. \end{funcdesc} *************** *** 161,165 **** same file. The two file objects may represent different file descriptors. ! Availability: Macintosh, \UNIX{}. \end{funcdesc} --- 161,165 ---- same file. The two file objects may represent different file descriptors. ! Availability: Macintosh, \UNIX. \end{funcdesc} *************** *** 170,174 **** function implements the underlying comparison used by \function{samefile()} and \function{sameopenfile()}. ! Availability: Macintosh, \UNIX{}. \end{funcdesc} --- 170,174 ---- function implements the underlying comparison used by \function{samefile()} and \function{sameopenfile()}. ! Availability: Macintosh, \UNIX. \end{funcdesc} Index: libselect.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libselect.tex,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** libselect.tex 2001/10/20 04:24:09 1.19 --- libselect.tex 2001/11/28 07:26:15 1.20 *************** *** 10,14 **** available in most operating systems. Note that on Windows, it only works for sockets; on other operating systems, it also works for other ! file types (in particular, on \UNIX{}, it works on pipes). It cannot be used on regular files to determine whether a file has grown since it was last read. --- 10,14 ---- available in most operating systems. Note that on Windows, it only works for sockets; on other operating systems, it also works for other ! file types (in particular, on \UNIX, it works on pipes). It cannot be used on regular files to determine whether a file has grown since it was last read. *************** *** 68,72 **** \label{poll-objects}} ! The \cfunction{poll()} system call, supported on most Unix systems, provides better scalability for network servers that service many, many clients at the same time. --- 68,72 ---- \label{poll-objects}} ! The \cfunction{poll()} system call, supported on most \UNIX{} systems, provides better scalability for network servers that service many, many clients at the same time. Index: libsite.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsite.tex,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** libsite.tex 2001/01/11 22:07:25 1.21 --- libsite.tex 2001/11/28 07:26:15 1.22 *************** *** 21,25 **** the tail part, it uses the empty string (on Macintosh or Windows) or it uses first \file{lib/python\shortversion/site-packages} and then ! \file{lib/site-python} (on \UNIX{}). For each of the distinct head-tail combinations, it sees if it refers to an existing directory, and if so, adds to \code{sys.path}, and also inspects the path for --- 21,25 ---- the tail part, it uses the empty string (on Macintosh or Windows) or it uses first \file{lib/python\shortversion/site-packages} and then ! \file{lib/site-python} (on \UNIX). For each of the distinct head-tail combinations, it sees if it refers to an existing directory, and if so, adds to \code{sys.path}, and also inspects the path for Index: libstat.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstat.tex,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** libstat.tex 2001/01/11 16:02:08 1.21 --- libstat.tex 2001/11/28 07:26:15 1.22 *************** *** 116,123 **** The interpretation of ``file size'' changes according to the file type. For plain files this is the size of the file in bytes. For ! FIFOs and sockets under most Unixes (including Linux in particular), ! the ``size'' is the number of bytes waiting to be read at the time of ! the call to \function{os.stat()}, \function{os.fstat()}, or ! \function{os.lstat()}; this can sometimes be useful, especially for polling one of these special files after a non-blocking open. The meaning of the size field for other character and block devices varies --- 116,123 ---- The interpretation of ``file size'' changes according to the file type. For plain files this is the size of the file in bytes. For ! FIFOs and sockets under most flavors of \UNIX{} (including Linux in ! particular), the ``size'' is the number of bytes waiting to be read at ! the time of the call to \function{os.stat()}, \function{os.fstat()}, ! or \function{os.lstat()}; this can sometimes be useful, especially for polling one of these special files after a non-blocking open. The meaning of the size field for other character and block devices varies Index: libstdtypes.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libstdtypes.tex,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** libstdtypes.tex 2001/10/30 06:23:14 1.75 --- libstdtypes.tex 2001/11/28 07:26:15 1.76 *************** *** 129,133 **** (I couldn't choose between \ABC{} and C! :-) \index{ABC language@\ABC{} language} ! \index{language!ABC@\ABC{}} \indexii{C}{language} \code{!=} is the preferred spelling; \code{<>} is obsolescent. --- 129,133 ---- (I couldn't choose between \ABC{} and C! :-) \index{ABC language@\ABC{} language} ! \index{language!ABC@\ABC} \indexii{C}{language} \code{!=} is the preferred spelling; \code{<>} is obsolescent. *************** *** 1106,1110 **** Read until \EOF{} using \method{readline()} and return a list containing the lines thus read. If the optional \var{sizehint} argument is ! present, instead of reading up to \EOF{}, whole lines totalling approximately \var{sizehint} bytes (possibly after rounding up to an internal buffer size) are read. Objects implementing a file-like --- 1106,1110 ---- Read until \EOF{} using \method{readline()} and return a list containing the lines thus read. If the optional \var{sizehint} argument is ! present, instead of reading up to \EOF, whole lines totalling approximately \var{sizehint} bytes (possibly after rounding up to an internal buffer size) are read. Objects implementing a file-like Index: libsys.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsys.tex,v retrieving revision 1.55 retrieving revision 1.56 diff -C2 -d -r1.55 -r1.56 *** libsys.tex 2001/10/23 01:59:54 1.55 --- libsys.tex 2001/11/28 07:26:15 1.56 *************** *** 157,161 **** produce undefined results otherwise. Some systems have a convention for assigning specific meanings to specific exit codes, but these ! are generally underdeveloped; Unix programs generally use 2 for command line syntax errors and 1 for all other kind of errors. If another type of object is passed, \code{None} is equivalent to --- 157,161 ---- produce undefined results otherwise. Some systems have a convention for assigning specific meanings to specific exit codes, but these ! are generally underdeveloped; \UNIX{} programs generally use 2 for command line syntax errors and 1 for all other kind of errors. If another type of object is passed, \code{None} is equivalent to Index: libtelnetlib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtelnetlib.tex,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** libtelnetlib.tex 2001/09/06 08:51:38 1.8 --- libtelnetlib.tex 2001/11/28 07:26:15 1.9 *************** *** 56,60 **** \begin{methoddesc}{read_all}{} ! Read all data until \EOF{}; block until connection closed. \end{methoddesc} --- 56,60 ---- \begin{methoddesc}{read_all}{} ! Read all data until \EOF; block until connection closed. \end{methoddesc} Index: libtempfile.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtempfile.tex,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** libtempfile.tex 2000/07/16 19:01:10 1.16 --- libtempfile.tex 2001/11/28 07:26:15 1.17 *************** *** 51,55 **** directory in which filenames returned by \function{mktemp()} reside. The default is taken from the environment variable \envvar{TMPDIR}; if ! this is not set, either \file{/usr/tmp} is used (on \UNIX{}), or the current working directory (all other systems). No check is made to see whether its value is valid. --- 51,55 ---- directory in which filenames returned by \function{mktemp()} reside. The default is taken from the environment variable \envvar{TMPDIR}; if ! this is not set, either \file{/usr/tmp} is used (on \UNIX), or the current working directory (all other systems). No check is made to see whether its value is valid. *************** *** 69,73 **** \function{mktemp()}. A string of decimal digits is added to generate unique filenames. The default is either \file{@\var{pid}.} where ! \var{pid} is the current process ID (on \UNIX{}), \file{\textasciitilde\var{pid}-} on Windows NT, \file{Python-Tmp-} on MacOS, or \file{tmp} (all other systems). --- 69,73 ---- \function{mktemp()}. A string of decimal digits is added to generate unique filenames. The default is either \file{@\var{pid}.} where ! \var{pid} is the current process ID (on \UNIX), \file{\textasciitilde\var{pid}-} on Windows NT, \file{Python-Tmp-} on MacOS, or \file{tmp} (all other systems). Index: libtermios.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtermios.tex,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** libtermios.tex 2001/05/09 15:50:17 1.21 --- libtermios.tex 2001/11/28 07:26:15 1.22 *************** *** 6,10 **** \modulesynopsis{\POSIX\ style tty control.} ! \indexii{\POSIX{}}{I/O control} \indexii{tty}{I/O control} --- 6,10 ---- \modulesynopsis{\POSIX\ style tty control.} ! \indexii{\POSIX}{I/O control} \indexii{tty}{I/O control} *************** *** 116,120 **** ! \indexii{\POSIX{}}{I/O control} \indexii{tty}{I/O control} --- 116,120 ---- ! \indexii{\POSIX}{I/O control} \indexii{tty}{I/O control} Index: libthread.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libthread.tex,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** libthread.tex 2001/10/16 21:13:49 1.23 --- libthread.tex 2001/11/28 07:26:15 1.24 *************** *** 20,24 **** (a.k.a. ``pthread'') implementation. \index{pthreads} ! \indexii{threads}{\POSIX{}} It defines the following constant and functions: --- 20,24 ---- (a.k.a. ``pthread'') implementation. \index{pthreads} ! \indexii{threads}{\POSIX} It defines the following constant and functions: Index: libtime.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtime.tex,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** libtime.tex 2001/10/29 18:01:24 1.47 --- libtime.tex 2001/11/28 07:26:15 1.48 *************** *** 17,21 **** The \dfn{epoch}\index{epoch} is the point where the time starts. On January 1st of that year, at 0 hours, the ``time since the epoch'' is ! zero. For \UNIX{}, the epoch is 1970. To find out what the epoch is, look at \code{gmtime(0)}. --- 17,21 ---- The \dfn{epoch}\index{epoch} is the point where the time starts. On January 1st of that year, at 0 hours, the ``time since the epoch'' is ! zero. For \UNIX, the epoch is 1970. To find out what the epoch is, look at \code{gmtime(0)}. *************** *** 23,27 **** The functions in this module do not handle dates and times before the epoch or far in the future. The cut-off point in the future is ! determined by the C library; for \UNIX{}, it is typically in 2038\index{Year 2038}. --- 23,27 ---- The functions in this module do not handle dates and times before the epoch or far in the future. The cut-off point in the future is ! determined by the C library; for \UNIX, it is typically in 2038\index{Year 2038}. Index: libtty.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libtty.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** libtty.tex 2000/12/01 15:25:23 1.2 --- libtty.tex 2001/11/28 07:26:15 1.3 *************** *** 13,17 **** Because it requires the \refmodule{termios} module, it will work ! only on \UNIX{}. The \module{tty} module defines the following functions: --- 13,17 ---- Because it requires the \refmodule{termios} module, it will work ! only on \UNIX. The \module{tty} module defines the following functions: Index: tkinter.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/tkinter.tex,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tkinter.tex 2001/11/16 06:02:55 1.3 --- tkinter.tex 2001/11/28 07:26:15 1.4 *************** *** 40,44 **** The \module{Tkinter} module (``Tk interface'') is the standard Python interface to the Tk GUI toolkit, now maintained at ActiveState. Both ! Tk and \module{Tkinter} are available on most Unix platforms, as well as on Windows and Macintosh systems. --- 40,44 ---- The \module{Tkinter} module (``Tk interface'') is the standard Python interface to the Tk GUI toolkit, now maintained at ActiveState. Both ! Tk and \module{Tkinter} are available on most \UNIX{} platforms, as well as on Windows and Macintosh systems. *************** *** 1675,1679 **** is a GUI toolkit that combines the most attractive attributes of Qt, Tk, Motif, and GTK+ in one powerful and efficient package. It is ! implemented in \Cpp. wxWindows supports two flavors of Unix implementation: GTK+ and Motif, and under Windows, it has a standard Microsoft Foundation Classes (MFC) appearance, because it uses Win32 --- 1675,1679 ---- is a GUI toolkit that combines the most attractive attributes of Qt, Tk, Motif, and GTK+ in one powerful and efficient package. It is ! implemented in \Cpp. wxWindows supports two flavors of \UNIX{} implementation: GTK+ and Motif, and under Windows, it has a standard Microsoft Foundation Classes (MFC) appearance, because it uses Win32 From fdrake@users.sourceforge.net Wed Nov 28 07:32:55 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 27 Nov 2001 23:32:55 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libsimplexmlrpc.tex,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv19080/lib Modified Files: libsimplexmlrpc.tex Log Message: Add synopsis for the SimpleXMLRPCServer module; used in the chapter-level list of modules. Index: libsimplexmlrpc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libsimplexmlrpc.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** libsimplexmlrpc.tex 2001/09/29 05:01:59 1.2 --- libsimplexmlrpc.tex 2001/11/28 07:32:53 1.3 *************** *** 3,6 **** --- 3,7 ---- \declaremodule{standard}{SimpleXMLRPCServer} + \modulesynopsis{Basic XML-RPC server implementation.} \moduleauthor{Brian Quinlan}{brianq@activestate.com} \sectionauthor{Fred L. Drake, Jr.}{fdrake@acm.org} From fdrake@users.sourceforge.net Wed Nov 28 07:48:34 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 27 Nov 2001 23:48:34 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libfcntl.tex,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv23680/lib Modified Files: libfcntl.tex Log Message: Clarify that on some systems, lockf() using LOCK_EX requires that the file is opened for writing; this closes SF bug #485342. Added notes that file objects are also accepted in the place of file descriptors. Index: libfcntl.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libfcntl.tex,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** libfcntl.tex 2001/11/28 07:26:15 1.27 --- libfcntl.tex 2001/11/28 07:48:32 1.28 *************** *** 17,21 **** first argument. This can be an integer file descriptor, such as returned by \code{sys.stdin.fileno()}, or a file object, such as ! \code{sys.stdin} itself. The module defines the following functions: --- 17,22 ---- first argument. This can be an integer file descriptor, such as returned by \code{sys.stdin.fileno()}, or a file object, such as ! \code{sys.stdin} itself, which provides a \method{fileno()} which ! returns a genuine file descriptor. The module defines the following functions: *************** *** 23,27 **** \begin{funcdesc}{fcntl}{fd, op\optional{, arg}} ! Perform the requested operation on file descriptor \var{fd}. The operation is defined by \var{op} and is operating system dependent. These codes are also found in the \module{fcntl} --- 24,29 ---- \begin{funcdesc}{fcntl}{fd, op\optional{, arg}} ! Perform the requested operation on file descriptor \var{fd} (file ! objects providing a \method{fileno()} method are accepted as well). The operation is defined by \var{op} and is operating system dependent. These codes are also found in the \module{fcntl} *************** *** 53,57 **** \begin{funcdesc}{flock}{fd, op} ! Perform the lock operation \var{op} on file descriptor \var{fd}. See the \UNIX{} manual \manpage{flock}{3} for details. (On some systems, this function is emulated using \cfunction{fcntl()}.) --- 55,60 ---- \begin{funcdesc}{flock}{fd, op} ! Perform the lock operation \var{op} on file descriptor \var{fd} (file ! objects providing a \method{fileno()} method are accepted as well). See the \UNIX{} manual \manpage{flock}{3} for details. (On some systems, this function is emulated using \cfunction{fcntl()}.) *************** *** 76,80 **** will have an \var{errno} attribute set to \constant{EACCES} or \constant{EAGAIN} (depending on the operating system; for portability, ! check for both values). \var{length} is the number of bytes to lock, \var{start} is the byte --- 79,85 ---- will have an \var{errno} attribute set to \constant{EACCES} or \constant{EAGAIN} (depending on the operating system; for portability, ! check for both values). On at least some systems, \constant{LOCK_EX} ! can only be used if the file descriptor refers to a file opened for ! writing. \var{length} is the number of bytes to lock, \var{start} is the byte From fdrake@users.sourceforge.net Wed Nov 28 07:50:47 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Tue, 27 Nov 2001 23:50:47 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib lib.tex,1.197,1.198 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv24078/lib Modified Files: lib.tex Log Message: Re-arrange the modules in the "Internet Data Handling" chapter to try to achieve a more sensible organization. Index: lib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/lib.tex,v retrieving revision 1.197 retrieving revision 1.198 diff -C2 -d -r1.197 -r1.198 *** lib.tex 2001/11/15 22:10:46 1.197 --- lib.tex 2001/11/28 07:50:45 1.198 *************** *** 218,237 **** \input{netdata} % Internet Data Handling \input{libformatter} \input{email} ! \input{librfc822} \input{libmimetools} \input{libmimewriter} \input{libmultifile} \input{libbinhex} \input{libuu} - \input{libbinascii} \input{libxdrlib} ! \input{libmailcap} ! \input{libmimetypes} ! \input{libbase64} ! \input{libquopri} ! \input{libmailbox} ! \input{libmhlib} ! \input{libmimify} \input{libnetrc} \input{librobotparser} --- 218,243 ---- \input{netdata} % Internet Data Handling \input{libformatter} + + % MIME & email stuff \input{email} ! \input{libmailcap} ! \input{libmailbox} ! \input{libmhlib} \input{libmimetools} + \input{libmimetypes} \input{libmimewriter} + \input{libmimify} \input{libmultifile} + \input{librfc822} + + % encoding stuff + \input{libbase64} + \input{libbinascii} \input{libbinhex} + \input{libquopri} \input{libuu} \input{libxdrlib} ! ! % file formats \input{libnetrc} \input{librobotparser} From lemburg@users.sourceforge.net Wed Nov 28 11:47:02 2001 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Wed, 28 Nov 2001 03:47:02 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects weakrefobject.c,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv15762/Objects Modified Files: weakrefobject.c Log Message: Fixes for possible buffer overflows in sprintf() usages. Index: weakrefobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/weakrefobject.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** weakrefobject.c 2001/10/22 16:31:40 1.4 --- weakrefobject.c 2001/11/28 11:46:59 1.5 *************** *** 136,140 **** } else { ! sprintf(buffer, "", (long)(self), PyWeakref_GET_OBJECT(self)->ob_type->tp_name, (long)(PyWeakref_GET_OBJECT(self))); --- 136,140 ---- } else { ! sprintf(buffer, "", (long)(self), PyWeakref_GET_OBJECT(self)->ob_type->tp_name, (long)(PyWeakref_GET_OBJECT(self))); From lemburg@users.sourceforge.net Wed Nov 28 11:47:02 2001 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Wed, 28 Nov 2001 03:47:02 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python compile.c,2.230,2.231 dynload_os2.c,2.5,2.6 dynload_win.c,2.8,2.9 getargs.c,2.84,2.85 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv15762/Python Modified Files: compile.c dynload_os2.c dynload_win.c getargs.c Log Message: Fixes for possible buffer overflows in sprintf() usages. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.230 retrieving revision 2.231 diff -C2 -d -r2.230 -r2.231 *** compile.c 2001/11/09 22:02:46 2.230 --- compile.c 2001/11/28 11:47:00 2.231 *************** *** 4196,4200 **** } } ! sprintf(buf, "unknown scope for %.100s in %.100s(%s) " "in %s\nsymbols: %s\nlocals: %s\nglobals: %s\n", --- 4196,4200 ---- } } ! PyOS_snprintf(buf, sizeof(buf), "unknown scope for %.100s in %.100s(%s) " "in %s\nsymbols: %s\nlocals: %s\nglobals: %s\n", Index: dynload_os2.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_os2.c,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -d -r2.5 -r2.6 *** dynload_os2.c 2000/09/01 23:29:28 2.5 --- dynload_os2.c 2001/11/28 11:47:00 2.6 *************** *** 33,37 **** char errBuf[256]; sprintf(errBuf, ! "DLL load failed, rc = %d: %s", rc, failreason); PyErr_SetString(PyExc_ImportError, errBuf); --- 33,37 ---- char errBuf[256]; sprintf(errBuf, ! "DLL load failed, rc = %d: %.200s", rc, failreason); PyErr_SetString(PyExc_ImportError, errBuf); Index: dynload_win.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_win.c,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -d -r2.8 -r2.9 *** dynload_win.c 2001/05/09 00:50:59 2.8 --- dynload_win.c 2001/11/28 11:47:00 2.9 *************** *** 233,237 **** strcasecmp(buffer,import_python)) { sprintf(buffer, ! "Module use of %s conflicts " "with this version of Python.", import_python); --- 233,237 ---- strcasecmp(buffer,import_python)) { sprintf(buffer, ! "Module use of %.150s conflicts " "with this version of Python.", import_python); Index: getargs.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getargs.c,v retrieving revision 2.84 retrieving revision 2.85 diff -C2 -d -r2.84 -r2.85 *** getargs.c 2001/10/27 07:25:06 2.84 --- getargs.c 2001/11/28 11:47:00 2.85 *************** *** 2,10 **** /* New getargs implementation */ - /* XXX There are several unchecked sprintf or strcat calls in this file. - XXX The only way these can become a danger is if some C code in the - XXX Python source (or in an extension) uses ridiculously long names - XXX or ridiculously deep nesting in format strings. */ - #include "Python.h" --- 2,5 ---- *************** *** 141,145 **** if (args == NULL) return 1; ! sprintf(msgbuf, "%s%s takes no arguments", fname==NULL ? "function" : fname, fname==NULL ? "" : "()"); --- 136,140 ---- if (args == NULL) return 1; ! sprintf(msgbuf, "%.200s%s takes no arguments", fname==NULL ? "function" : fname, fname==NULL ? "" : "()"); *************** *** 150,154 **** if (args == NULL) { sprintf(msgbuf, ! "%s%s takes at least one argument", fname==NULL ? "function" : fname, fname==NULL ? "" : "()"); --- 145,149 ---- if (args == NULL) { sprintf(msgbuf, ! "%.200s%s takes at least one argument", fname==NULL ? "function" : fname, fname==NULL ? "" : "()"); *************** *** 180,184 **** if (message == NULL) { sprintf(msgbuf, ! "%s%s takes %s %d argument%s (%d given)", fname==NULL ? "function" : fname, fname==NULL ? "" : "()", --- 175,179 ---- if (message == NULL) { sprintf(msgbuf, ! "%.150s%s takes %s %d argument%s (%d given)", fname==NULL ? "function" : fname, fname==NULL ? "" : "()", *************** *** 221,225 **** seterror(int iarg, char *msg, int *levels, char *fname, char *message) { ! char buf[256]; int i; char *p = buf; --- 216,220 ---- seterror(int iarg, char *msg, int *levels, char *fname, char *message) { ! char buf[512]; int i; char *p = buf; *************** *** 229,233 **** else if (message == NULL) { if (fname != NULL) { ! sprintf(p, "%s() ", fname); p += strlen(p); } --- 224,228 ---- else if (message == NULL) { if (fname != NULL) { ! sprintf(p, "%.200s() ", fname); p += strlen(p); } *************** *** 236,240 **** i = 0; p += strlen(p); ! while (levels[i] > 0) { sprintf(p, ", item %d", levels[i]-1); p += strlen(p); --- 231,235 ---- i = 0; p += strlen(p); ! while (levels[i] > 0 && (int)(p-buf) < 220) { sprintf(p, ", item %d", levels[i]-1); p += strlen(p); *************** *** 246,250 **** p += strlen(p); } ! sprintf(p, " %s", msg); message = buf; } --- 241,245 ---- p += strlen(p); } ! sprintf(p, " %.256s", msg); message = buf; } *************** *** 301,306 **** levels[0] = 0; sprintf(msgbuf, ! toplevel ? "expected %d arguments, not %s" : ! "must be %d-item sequence, not %s", n, arg == Py_None ? "None" : arg->ob_type->tp_name); return msgbuf; --- 296,301 ---- levels[0] = 0; sprintf(msgbuf, ! toplevel ? "expected %d arguments, not %.50s" : ! "must be %d-item sequence, not %.50s", n, arg == Py_None ? "None" : arg->ob_type->tp_name); return msgbuf; From lemburg@users.sourceforge.net Wed Nov 28 11:47:02 2001 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Wed, 28 Nov 2001 03:47:02 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules _testcapimodule.c,1.12,1.13 posixmodule.c,2.208,2.209 readline.c,2.39,2.40 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv15762/Modules Modified Files: _testcapimodule.c posixmodule.c readline.c Log Message: Fixes for possible buffer overflows in sprintf() usages. Index: _testcapimodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_testcapimodule.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** _testcapimodule.c 2001/09/30 05:09:37 1.12 --- _testcapimodule.c 2001/11/28 11:46:59 1.13 *************** *** 37,41 **** { char buf[1024]; ! sprintf(buf, "%s #define == %d but sizeof(%s) == %d", fatname, expected, typename, got); PyErr_SetString(TestError, buf); --- 37,41 ---- { char buf[1024]; ! sprintf(buf, "%.200s #define == %d but sizeof(%.200s) == %d", fatname, expected, typename, got); PyErr_SetString(TestError, buf); Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.208 retrieving revision 2.209 diff -C2 -d -r2.208 -r2.209 *** posixmodule.c 2001/11/24 09:31:44 2.208 --- posixmodule.c 2001/11/28 11:46:59 2.209 *************** *** 5788,5792 **** ULONG values[QSV_MAX+1]; PyObject *v; ! char *ver, tmp[10]; Py_BEGIN_ALLOW_THREADS --- 5788,5792 ---- ULONG values[QSV_MAX+1]; PyObject *v; ! char *ver, tmp[50]; Py_BEGIN_ALLOW_THREADS Index: readline.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/readline.c,v retrieving revision 2.39 retrieving revision 2.40 diff -C2 -d -r2.39 -r2.40 *** readline.c 2001/10/19 01:18:43 2.39 --- readline.c 2001/11/28 11:46:59 2.40 *************** *** 166,170 **** PyObject *function = Py_None; char buf[80]; ! sprintf(buf, "|O:set_%s", funcname); if (!PyArg_ParseTuple(args, buf, &function)) return NULL; --- 166,170 ---- PyObject *function = Py_None; char buf[80]; ! sprintf(buf, "|O:set_%.50s", funcname); if (!PyArg_ParseTuple(args, buf, &function)) return NULL; *************** *** 182,186 **** } else { ! sprintf(buf, "set_%s(func): argument not callable", funcname); PyErr_SetString(PyExc_TypeError, buf); return NULL; --- 182,186 ---- } else { ! sprintf(buf, "set_%.50s(func): argument not callable", funcname); PyErr_SetString(PyExc_TypeError, buf); return NULL; From lemburg@users.sourceforge.net Wed Nov 28 12:56:22 2001 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Wed, 28 Nov 2001 04:56:22 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.121,2.122 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv30303/Objects Modified Files: unicodeobject.c Log Message: Fix for bug #485951: repr diff between string and unicode. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.121 retrieving revision 2.122 diff -C2 -d -r2.121 -r2.122 *** unicodeobject.c 2001/11/20 15:18:49 2.121 --- unicodeobject.c 2001/11/28 12:56:20 2.122 *************** *** 1834,1838 **** /* Map non-printable US ASCII to '\xhh' */ ! else if (ch < ' ' || ch >= 128) { *p++ = '\\'; *p++ = 'x'; --- 1834,1838 ---- /* Map non-printable US ASCII to '\xhh' */ ! else if (ch < ' ' || ch >= 0x7F) { *p++ = '\\'; *p++ = 'x'; From lemburg@users.sourceforge.net Wed Nov 28 14:03:16 2001 From: lemburg@users.sourceforge.net (M.-A. Lemburg) Date: Wed, 28 Nov 2001 06:03:16 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test test_unicode.py,1.44,1.45 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv12994/Lib/test Modified Files: test_unicode.py Log Message: Adding test for Unicode repr()-output. Index: test_unicode.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/test_unicode.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** test_unicode.py 2001/11/20 15:18:49 1.44 --- test_unicode.py 2001/11/28 14:03:14 1.45 *************** *** 23,26 **** --- 23,41 ---- verify(repr(u"'") == '''u"'"''') verify(repr(u'"') == """u'"'""") + verify(repr(u''.join(map(unichr, range(256)))) == + "u'\\x00\\x01\\x02\\x03\\x04\\x05\\x06\\x07\\x08\\t\\n\\x0b\\x0c\\r" + "\\x0e\\x0f\\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17\\x18\\x19\\x1a" + "\\x1b\\x1c\\x1d\\x1e\\x1f !\"#$%&\\'()*+,-./0123456789:;<=>?@ABCDEFGHI" + "JKLMNOPQRSTUVWXYZ[\\\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\\x7f" + "\\x80\\x81\\x82\\x83\\x84\\x85\\x86\\x87\\x88\\x89\\x8a\\x8b\\x8c\\x8d" + "\\x8e\\x8f\\x90\\x91\\x92\\x93\\x94\\x95\\x96\\x97\\x98\\x99\\x9a\\x9b" + "\\x9c\\x9d\\x9e\\x9f\\xa0\\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'") def test(method, input, output, *args): From jhylton@users.sourceforge.net Wed Nov 28 16:20:10 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 08:20:10 -0800 Subject: [Python-checkins] CVS: python/dist/src/Include abstract.h,2.41,2.42 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv22593 Modified Files: abstract.h Log Message: Fix SF bug [ #476852 ] Some bad macros in abstract.h Change macros as requested by Guido Index: abstract.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/abstract.h,v retrieving revision 2.41 retrieving revision 2.42 diff -C2 -d -r2.41 -r2.42 *** abstract.h 2001/11/09 21:59:27 2.41 --- abstract.h 2001/11/28 16:20:07 2.42 *************** *** 1113,1117 **** the Python statement: del o[key]. */ ! #define PyMapping_DelItemString(O,K) PyDict_DelItemString((O),(K)) /* implemented as a macro: --- 1113,1117 ---- the Python statement: del o[key]. */ ! #define PyMapping_DelItemString(O,K) PyObject_DelItemString((O),(K)) /* implemented as a macro: *************** *** 1123,1127 **** the Python statement: del o[key]. */ ! #define PyMapping_DelItem(O,K) PyDict_DelItem((O),(K)) DL_IMPORT(int) PyMapping_HasKeyString(PyObject *o, char *key); --- 1123,1127 ---- the Python statement: del o[key]. */ ! #define PyMapping_DelItem(O,K) PyObject_DelItem((O),(K)) DL_IMPORT(int) PyMapping_HasKeyString(PyObject *o, char *key); From tim_one@users.sourceforge.net Wed Nov 28 16:51:52 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 28 Nov 2001 08:51:52 -0800 Subject: [Python-checkins] CVS: python/dist/src/Include pyerrors.h,2.51,2.52 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv32343/python/Include Modified Files: pyerrors.h Log Message: Removed preprocessor gimmick trying to force use of snprintf emulation before 2.2b1. Index: pyerrors.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/pyerrors.h,v retrieving revision 2.51 retrieving revision 2.52 diff -C2 -d -r2.51 -r2.52 *** pyerrors.h 2001/10/23 02:19:10 2.51 --- pyerrors.h 2001/11/28 16:51:49 2.52 *************** *** 109,127 **** extern DL_IMPORT(void) PyErr_SyntaxLocation(char *, int); 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 --- 109,125 ---- extern DL_IMPORT(void) PyErr_SyntaxLocation(char *, int); 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, ! WARNING: The return value of snprintf varies across platforms; do ! not rely on any particular behavior; eventually the C99 defn may ! be reliable. ! */ #if defined(MS_WIN32) && !defined(HAVE_SNPRINTF) # define HAVE_SNPRINTF # define snprintf _snprintf # define vsnprintf _vsnprintf #endif From gvanrossum@users.sourceforge.net Wed Nov 28 19:41:47 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 28 Nov 2001 11:41:47 -0800 Subject: [Python-checkins] CVS: python/dist/src/Tools/scripts trace.py,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/scripts In directory usw-pr-cvs1:/tmp/cvs-serv22978 Modified Files: trace.py Log Message: Checking in Zooko's version per SF patch #476866, plus my changes to the usage docs: (a) align properly, (b) explain properly. Index: trace.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/scripts/trace.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** trace.py 2001/10/08 20:33:20 1.5 --- trace.py 2001/11/28 19:41:45 1.6 *************** *** 1,4 **** --- 1,11 ---- #!/usr/bin/env python + # portions copyright 2001, Autonomous Zones Industries, Inc., all rights... + # err... reserved and offered to the public under the terms of the + # Python 2.2 license. + # Author: Zooko O'Whielacronx + # http://zooko.com/ + # mailto:zooko@zooko.com + # [...1024 lines suppressed...] ! else: ! sys.argv = prog_argv ! progname = prog_argv[0] ! if eval(sys.version[:3])>1.3: ! sys.path[0] = os.path.split(progname)[0] # ??? ! t = Trace(count, trace, countfuncs=listfuncs, ignoremods=ignore_modules, ignoredirs=ignore_dirs, infile=counts_file, outfile=counts_file) try: ! t.run('execfile(' + `progname` + ')') except IOError, err: ! _err_exit("Cannot run file %s because: %s" % (`sys.argv[0]`, err)) except SystemExit: pass results = t.results() if not no_report: ! results.write_results(missing, summary=summary, coverdir=coverdir) if __name__=='__main__': From jhylton@users.sourceforge.net Wed Nov 28 20:24:35 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 12:24:35 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python exceptions.c,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv4433 Modified Files: exceptions.c Log Message: Use PyOS_snprintf instead of sprintf. Just being sure. The old code looks like it was safe, but there's no harm in double-checking. Index: exceptions.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/exceptions.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** exceptions.c 2001/10/05 21:50:08 1.27 --- exceptions.c 2001/11/28 20:24:33 1.28 *************** *** 811,829 **** bufsize += PyString_GET_SIZE(filename); ! buffer = PyMem_Malloc(bufsize); if (buffer != NULL) { if (have_filename && have_lineno) ! sprintf(buffer, "%s (%s, line %ld)", ! PyString_AS_STRING(str), ! my_basename(PyString_AS_STRING(filename)), ! PyInt_AsLong(lineno)); else if (have_filename) ! sprintf(buffer, "%s (%s)", ! PyString_AS_STRING(str), ! my_basename(PyString_AS_STRING(filename))); else if (have_lineno) ! sprintf(buffer, "%s (line %ld)", ! PyString_AS_STRING(str), ! PyInt_AsLong(lineno)); result = PyString_FromString(buffer); --- 811,829 ---- bufsize += PyString_GET_SIZE(filename); ! buffer = PyMem_MALLOC(bufsize); if (buffer != NULL) { if (have_filename && have_lineno) ! PyOS_snprintf(buffer, bufsize, "%s (%s, line %ld)", ! PyString_AS_STRING(str), ! my_basename(PyString_AS_STRING(filename)), ! PyInt_AsLong(lineno)); else if (have_filename) ! PyOS_snprintf(buffer, bufsize, "%s (%s)", ! PyString_AS_STRING(str), ! my_basename(PyString_AS_STRING(filename))); else if (have_lineno) ! PyOS_snprintf(buffer, bufsize, "%s (line %ld)", ! PyString_AS_STRING(str), ! PyInt_AsLong(lineno)); result = PyString_FromString(buffer); From tim_one@users.sourceforge.net Wed Nov 28 20:27:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 28 Nov 2001 12:27:44 -0800 Subject: [Python-checkins] CVS: python/dist/src/Demo/pysvr pysvr.c,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Demo/pysvr In directory usw-pr-cvs1:/tmp/cvs-serv5054/python/Demo/pysvr Modified Files: pysvr.c Log Message: sprintf -> PyOS_snprintf in some "obviously safe" cases. Also changed <>-style #includes to ""-style in some places where the former didn't make sense. Index: pysvr.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Demo/pysvr/pysvr.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** pysvr.c 2000/11/03 08:18:37 1.9 --- pysvr.c 2001/11/28 20:27:42 1.10 *************** *** 26,30 **** So Python.h must be included after pthread.h. */ ! #include extern int Py_VerboseFlag; --- 26,30 ---- So Python.h must be included after pthread.h. */ ! #include "Python.h" extern int Py_VerboseFlag; *************** *** 365,369 **** { char buffer[100]; ! sprintf(buffer, "ps -l -p %d Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv5054/python/Objects Modified Files: stringobject.c Log Message: sprintf -> PyOS_snprintf in some "obviously safe" cases. Also changed <>-style #includes to ""-style in some places where the former didn't make sense. Index: stringobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/stringobject.c,v retrieving revision 2.140 retrieving revision 2.141 diff -C2 -d -r2.140 -r2.141 *** stringobject.c 2001/10/22 04:12:44 2.140 --- stringobject.c 2001/11/28 20:27:42 2.141 *************** *** 2877,2881 **** if (type == 'f' && fabs(x)/1e25 >= 1e25) type = 'g'; ! sprintf(fmt, "%%%s.%d%c", (flags&F_ALT) ? "#" : "", prec, type); /* worst case length calc to ensure no buffer overrun: fmt = %#.g --- 2877,2883 ---- if (type == 'f' && fabs(x)/1e25 >= 1e25) type = 'g'; ! PyOS_snprintf(fmt, sizeof(fmt), "%%%s.%d%c", ! (flags&F_ALT) ? "#" : "", ! prec, type); /* worst case length calc to ensure no buffer overrun: fmt = %#.g *************** *** 2890,2894 **** return -1; } ! sprintf(buf, fmt, x); return strlen(buf); } --- 2892,2896 ---- return -1; } ! PyOS_snprintf(buf, buflen, fmt, x); return strlen(buf); } *************** *** 3048,3052 **** if (prec < 0) prec = 1; ! sprintf(fmt, "%%%s.%dl%c", (flags&F_ALT) ? "#" : "", prec, type); /* buf = '+'/'-'/'0'/'0x' + '[0-9]'*max(prec, len(x in octal)) worst case buf = '0x' + [0-9]*prec, where prec >= 11 */ --- 3050,3056 ---- if (prec < 0) prec = 1; ! PyOS_snprintf(fmt, sizeof(fmt), "%%%s.%dl%c", ! (flags&F_ALT) ? "#" : "", ! prec, type); /* buf = '+'/'-'/'0'/'0x' + '[0-9]'*max(prec, len(x in octal)) worst case buf = '0x' + [0-9]*prec, where prec >= 11 */ *************** *** 3056,3060 **** return -1; } ! sprintf(buf, fmt, x); /* When converting 0 under %#x or %#X, C leaves off the base marker, * but we want it (for consistency with other %#x conversions, and --- 3060,3064 ---- return -1; } ! PyOS_snprintf(buf, buflen, fmt, x); /* When converting 0 under %#x or %#X, C leaves off the base marker, * but we want it (for consistency with other %#x conversions, and From tim_one@users.sourceforge.net Wed Nov 28 20:27:44 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 28 Nov 2001 12:27:44 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules _hotshot.c,1.9,1.10 _localemodule.c,2.24,2.25 _testcapimodule.c,1.13,1.14 _tkinter.c,1.119,1.120 arraymodule.c,2.64,2.65 flmodule.c,1.45,1.46 gdbmmodule.c,2.30,2.31 pcremodule.c,2.28,2.29 posixmodule.c,2.209,2.210 pyexpat.c,2.55,2.56 readline.c,2.40,2.41 socketmodule.c,1.197,1.198 stropmodule.c,2.82,2.83 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv5054/python/Modules Modified Files: _hotshot.c _localemodule.c _testcapimodule.c _tkinter.c arraymodule.c flmodule.c gdbmmodule.c pcremodule.c posixmodule.c pyexpat.c readline.c socketmodule.c stropmodule.c Log Message: sprintf -> PyOS_snprintf in some "obviously safe" cases. Also changed <>-style #includes to ""-style in some places where the former didn't make sense. Index: _hotshot.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_hotshot.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** _hotshot.c 2001/11/09 15:59:36 1.9 --- _hotshot.c 2001/11/28 20:27:42 1.10 *************** *** 3,11 **** */ ! #include ! #include ! #include ! #include ! #include #ifdef HAVE_UNISTD_H --- 3,11 ---- */ ! #include "Python.h" ! #include "compile.h" ! #include "eval.h" ! #include "frameobject.h" ! #include "structmember.h" #ifdef HAVE_UNISTD_H *************** *** 1453,1462 **** #ifdef MS_WIN32 ! sprintf(cwdbuffer, "%I64d", frequency.QuadPart); pack_add_info(self, "reported-performance-frequency", cwdbuffer); #else ! sprintf(cwdbuffer, "%lu", rusage_diff); pack_add_info(self, "observed-interval-getrusage", cwdbuffer); ! sprintf(cwdbuffer, "%lu", timeofday_diff); pack_add_info(self, "observed-interval-gettimeofday", cwdbuffer); #endif --- 1453,1462 ---- #ifdef MS_WIN32 ! PyOS_snprintf(cwdbuffer, sizeof(cwdbuffer), "%I64d", frequency.QuadPart); pack_add_info(self, "reported-performance-frequency", cwdbuffer); #else ! PyOS_snprintf(cwdbuffer, sizeof(cwdbuffer), "%lu", rusage_diff); pack_add_info(self, "observed-interval-getrusage", cwdbuffer); ! PyOS_snprintf(cwdbuffer, sizeof(cwdbuffer), "%lu", timeofday_diff); pack_add_info(self, "observed-interval-gettimeofday", cwdbuffer); #endif Index: _localemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_localemodule.c,v retrieving revision 2.24 retrieving revision 2.25 diff -C2 -d -r2.24 -r2.25 *** _localemodule.c 2001/09/20 19:18:30 2.24 --- _localemodule.c 2001/11/28 20:27:42 2.25 *************** *** 377,381 **** return NULL; ! sprintf(encoding, "cp%d", GetACP()); if (GetLocaleInfo(LOCALE_USER_DEFAULT, --- 377,381 ---- return NULL; ! PyOS_snprintf(encoding, sizeof(encoding), "cp%d", GetACP()); if (GetLocaleInfo(LOCALE_USER_DEFAULT, Index: _testcapimodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_testcapimodule.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** _testcapimodule.c 2001/11/28 11:46:59 1.13 --- _testcapimodule.c 2001/11/28 20:27:42 1.14 *************** *** 20,24 **** PyErr_SetString(TestError, "internal error msg too large"); else { ! sprintf(buf, "%s: %s", test_name, msg); PyErr_SetString(TestError, buf); } --- 20,24 ---- PyErr_SetString(TestError, "internal error msg too large"); else { ! PyOS_snprintf(buf, sizeof(buf), "%s: %s", test_name, msg); PyErr_SetString(TestError, buf); } *************** *** 37,41 **** { char buf[1024]; ! sprintf(buf, "%.200s #define == %d but sizeof(%.200s) == %d", fatname, expected, typename, got); PyErr_SetString(TestError, buf); --- 37,42 ---- { char buf[1024]; ! PyOS_snprintf(buf, sizeof(buf), ! "%.200s #define == %d but sizeof(%.200s) == %d", fatname, expected, typename, got); PyErr_SetString(TestError, buf); Index: _tkinter.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/_tkinter.c,v retrieving revision 1.119 retrieving revision 1.120 diff -C2 -d -r1.119 -r1.120 *** _tkinter.c 2001/08/17 18:39:25 1.119 --- _tkinter.c 2001/11/28 20:27:42 1.120 *************** *** 1580,1585 **** char buf[100]; ! sprintf(buf, "", v, ! v->func == NULL ? ", handler deleted" : ""); return PyString_FromString(buf); } --- 1580,1585 ---- char buf[100]; ! PyOS_snprintf(buf, sizeof(buf), "", v, ! v->func == NULL ? ", handler deleted" : ""); return PyString_FromString(buf); } Index: arraymodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/arraymodule.c,v retrieving revision 2.64 retrieving revision 2.65 diff -C2 -d -r2.64 -r2.65 *** arraymodule.c 2001/07/27 16:05:32 2.64 --- arraymodule.c 2001/11/28 20:27:42 2.65 *************** *** 1314,1323 **** len = a->ob_size; if (len == 0) { ! sprintf(buf, "array('%c')", a->ob_descr->typecode); return PyString_FromString(buf); } if (a->ob_descr->typecode == 'c') { PyObject *t_empty = PyTuple_New(0); ! sprintf(buf, "array('c', "); s = PyString_FromString(buf); v = array_tostring(a, t_empty); --- 1314,1324 ---- len = a->ob_size; if (len == 0) { ! PyOS_snprintf(buf, sizeof(buf), "array('%c')", ! a->ob_descr->typecode); return PyString_FromString(buf); } if (a->ob_descr->typecode == 'c') { PyObject *t_empty = PyTuple_New(0); ! PyOS_snprintf(buf, sizeof(buf), "array('c', "); s = PyString_FromString(buf); v = array_tostring(a, t_empty); *************** *** 1329,1333 **** return s; } ! sprintf(buf, "array('%c', [", a->ob_descr->typecode); s = PyString_FromString(buf); comma = PyString_FromString(", "); --- 1330,1334 ---- return s; } ! PyOS_snprintf(buf, sizeof(buf), "array('%c', [", a->ob_descr->typecode); s = PyString_FromString(buf); comma = PyString_FromString(", "); Index: flmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/flmodule.c,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** flmodule.c 2000/09/01 23:29:26 1.45 --- flmodule.c 2001/11/28 20:27:42 1.46 *************** *** 371,376 **** { char buf[100]; ! sprintf(buf, "", ! g, g->ob_generic->objclass); return PyString_FromString(buf); } --- 371,376 ---- { char buf[100]; ! PyOS_snprintf(buf, sizeof(buf), "", ! g, g->ob_generic->objclass); return PyString_FromString(buf); } *************** *** 1581,1586 **** { char buf[100]; ! sprintf(buf, "", ! f, f->ob_form->window); return PyString_FromString(buf); } --- 1581,1586 ---- { char buf[100]; ! PyOS_snprintf(buf, sizeof(buf), "", ! f, f->ob_form->window); return PyString_FromString(buf); } Index: gdbmmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gdbmmodule.c,v retrieving revision 2.30 retrieving revision 2.31 diff -C2 -d -r2.30 -r2.31 *** gdbmmodule.c 2001/11/11 14:24:05 2.30 --- gdbmmodule.c 2001/11/28 20:27:42 2.31 *************** *** 478,482 **** #endif default: ! sprintf(buf, "Flag '%c' is not supported.", *flags); PyErr_SetString(DbmError, buf); return NULL; --- 478,483 ---- #endif default: ! PyOS_snprintf(buf, sizeof(buf), "Flag '%c' is not supported.", ! *flags); PyErr_SetString(DbmError, buf); return NULL; Index: pcremodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pcremodule.c,v retrieving revision 2.28 retrieving revision 2.29 diff -C2 -d -r2.28 -r2.29 *** pcremodule.c 2001/07/19 21:29:48 2.28 --- pcremodule.c 2001/11/28 20:27:42 2.29 *************** *** 264,268 **** { char message[50]; ! sprintf(message, "\\%c is not allowed", c); PyErr_SetString(ErrorObject, message); return NULL; --- 264,269 ---- { char message[50]; ! PyOS_snprintf(message, sizeof(message), ! "\\%c is not allowed", c); PyErr_SetString(ErrorObject, message); return NULL; *************** *** 496,500 **** { char message[50]; ! sprintf(message, "group did not contribute to the match"); PyErr_SetString(ErrorObject, --- 497,501 ---- { char message[50]; ! PyOS_snprintf(message, sizeof(message), "group did not contribute to the match"); PyErr_SetString(ErrorObject, Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.209 retrieving revision 2.210 diff -C2 -d -r2.209 -r2.210 *** posixmodule.c 2001/11/28 11:46:59 2.209 --- posixmodule.c 2001/11/28 20:27:42 2.210 *************** *** 433,437 **** os2_formatmsg(msgbuf, msglen, reason); else ! sprintf(msgbuf, "unknown OS error #%d", errorcode); return msgbuf; --- 433,438 ---- os2_formatmsg(msgbuf, msglen, reason); else ! PyOS_snprintf(msgbuf, sizeof(msgbuf), ! "unknown OS error #%d", errorcode); return msgbuf; *************** *** 5815,5820 **** case 50: ver = "5.00"; break; default: ! sprintf(tmp, "%d-%d", values[QSV_VERSION_MAJOR], ! values[QSV_VERSION_MINOR]); ver = &tmp[0]; } --- 5816,5822 ---- case 50: ver = "5.00"; break; default: ! PyOS_snprintf(tmp, sizeof(tmp), ! "%d-%d", values[QSV_VERSION_MAJOR], ! values[QSV_VERSION_MINOR]); ver = &tmp[0]; } Index: pyexpat.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/pyexpat.c,v retrieving revision 2.55 retrieving revision 2.56 diff -C2 -d -r2.55 -r2.56 *** pyexpat.c 2001/11/18 02:36:07 2.55 --- pyexpat.c 2001/11/28 20:27:42 2.56 *************** *** 130,134 **** enum XML_Error code = XML_GetErrorCode(parser); ! sprintf(buffer, "%.200s: line %i, column %i", XML_ErrorString(code), lineno, column); err = PyObject_CallFunction(ErrorObject, "s", buffer); --- 130,134 ---- enum XML_Error code = XML_GetErrorCode(parser); ! PyOS_snprintf(buffer, sizeof(buffer), "%.200s: line %i, column %i", XML_ErrorString(code), lineno, column); err = PyObject_CallFunction(ErrorObject, "s", buffer); Index: readline.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/readline.c,v retrieving revision 2.40 retrieving revision 2.41 diff -C2 -d -r2.40 -r2.41 *** readline.c 2001/11/28 11:46:59 2.40 --- readline.c 2001/11/28 20:27:42 2.41 *************** *** 166,170 **** PyObject *function = Py_None; char buf[80]; ! sprintf(buf, "|O:set_%.50s", funcname); if (!PyArg_ParseTuple(args, buf, &function)) return NULL; --- 166,170 ---- PyObject *function = Py_None; char buf[80]; ! PyOS_snprintf(buf, sizeof(buf), "|O:set_%.50s", funcname); if (!PyArg_ParseTuple(args, buf, &function)) return NULL; *************** *** 182,186 **** } else { ! sprintf(buf, "set_%.50s(func): argument not callable", funcname); PyErr_SetString(PyExc_TypeError, buf); return NULL; --- 182,188 ---- } else { ! PyOS_snprintf(buf, sizeof(buf), ! "set_%.50s(func): argument not callable", ! funcname); PyErr_SetString(PyExc_TypeError, buf); return NULL; Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.197 retrieving revision 1.198 diff -C2 -d -r1.197 -r1.198 *** socketmodule.c 2001/11/28 04:28:31 1.197 --- socketmodule.c 2001/11/28 20:27:42 1.198 *************** *** 1769,1775 **** } #endif ! sprintf(buf, ! "", ! (long)s->sock_fd, s->sock_family, s->sock_type, s->sock_proto); return PyString_FromString(buf); } --- 1769,1777 ---- } #endif ! PyOS_snprintf(buf, sizeof(buf), ! "", ! (long)s->sock_fd, s->sock_family, ! s->sock_type, ! s->sock_proto); return PyString_FromString(buf); } *************** *** 3057,3061 **** break; default: ! sprintf(buf, "WSAStartup failed: error code %d", ret); PyErr_SetString(PyExc_ImportError, buf); break; --- 3059,3064 ---- break; default: ! PyOS_snprintf(buf, sizeof(buf), ! "WSAStartup failed: error code %d", ret); PyErr_SetString(PyExc_ImportError, buf); break; Index: stropmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/stropmodule.c,v retrieving revision 2.82 retrieving revision 2.83 diff -C2 -d -r2.82 -r2.83 *** stropmodule.c 2001/05/15 02:14:44 2.82 --- stropmodule.c 2001/11/28 20:27:42 2.83 *************** *** 773,777 **** if (*end != '\0') { bad: ! sprintf(buffer, "invalid literal for atoi(): %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; --- 773,778 ---- if (*end != '\0') { bad: ! PyOS_snprintf(buffer, sizeof(buffer), ! "invalid literal for atoi(): %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; *************** *** 866,875 **** end++; if (*end != '\0') { ! sprintf(buffer, "invalid literal for atof(): %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; } else if (errno != 0) { ! sprintf(buffer, "atof() literal too large: %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; --- 867,878 ---- end++; if (*end != '\0') { ! PyOS_snprintf(buffer, sizeof(buffer), ! "invalid literal for atof(): %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; } else if (errno != 0) { ! PyOS_snprintf(buffer, sizeof(buffer), ! "atof() literal too large: %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; From jhylton@users.sourceforge.net Wed Nov 28 20:29:24 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 12:29:24 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python getargs.c,2.85,2.86 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv5913 Modified Files: getargs.c Log Message: Use PyOS_snprintf when possible. Index: getargs.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getargs.c,v retrieving revision 2.85 retrieving revision 2.86 diff -C2 -d -r2.85 -r2.86 *** getargs.c 2001/11/28 11:47:00 2.85 --- getargs.c 2001/11/28 20:29:22 2.86 *************** *** 136,142 **** if (args == NULL) return 1; ! sprintf(msgbuf, "%.200s%s takes no arguments", ! fname==NULL ? "function" : fname, ! fname==NULL ? "" : "()"); PyErr_SetString(PyExc_TypeError, msgbuf); return 0; --- 136,143 ---- if (args == NULL) return 1; ! PyOS_snprintf(msgbuf, sizeof(msgbuf), ! "%.200s%s takes no arguments", ! fname==NULL ? "function" : fname, ! fname==NULL ? "" : "()"); PyErr_SetString(PyExc_TypeError, msgbuf); return 0; *************** *** 144,151 **** else if (min == 1 && max == 1) { if (args == NULL) { ! sprintf(msgbuf, ! "%.200s%s takes at least one argument", ! fname==NULL ? "function" : fname, ! fname==NULL ? "" : "()"); PyErr_SetString(PyExc_TypeError, msgbuf); return 0; --- 145,152 ---- else if (min == 1 && max == 1) { if (args == NULL) { ! PyOS_snprintf(msgbuf, sizeof(msgbuf), ! "%.200s%s takes at least one argument", ! fname==NULL ? "function" : fname, ! fname==NULL ? "" : "()"); PyErr_SetString(PyExc_TypeError, msgbuf); return 0; *************** *** 174,186 **** if (len < min || max < len) { if (message == NULL) { ! sprintf(msgbuf, ! "%.150s%s takes %s %d argument%s (%d given)", ! fname==NULL ? "function" : fname, ! fname==NULL ? "" : "()", ! min==max ? "exactly" ! : len < min ? "at least" : "at most", ! len < min ? min : max, ! (len < min ? min : max) == 1 ? "" : "s", ! len); message = msgbuf; } --- 175,188 ---- if (len < min || max < len) { if (message == NULL) { ! PyOS_snprintf(msgbuf, sizeof(msgbuf), ! "%.150s%s takes %s %d argument%s " ! "(%d given)", ! fname==NULL ? "function" : fname, ! fname==NULL ? "" : "()", ! min==max ? "exactly" ! : len < min ? "at least" : "at most", ! len < min ? min : max, ! (len < min ? min : max) == 1 ? "" : "s", ! len); message = msgbuf; } *************** *** 223,226 **** --- 225,229 ---- return; else if (message == NULL) { + /* XXX snprintf */ if (fname != NULL) { sprintf(p, "%.200s() ", fname); *************** *** 295,302 **** if (!PySequence_Check(arg) || PyString_Check(arg)) { levels[0] = 0; ! sprintf(msgbuf, ! toplevel ? "expected %d arguments, not %.50s" : ! "must be %d-item sequence, not %.50s", ! n, arg == Py_None ? "None" : arg->ob_type->tp_name); return msgbuf; } --- 298,306 ---- if (!PySequence_Check(arg) || PyString_Check(arg)) { levels[0] = 0; ! PyOS_snprintf(msgbuf, sizeof(msgbuf), ! toplevel ? "expected %d arguments, not %.50s" : ! "must be %d-item sequence, not %.50s", ! n, ! arg == Py_None ? "None" : arg->ob_type->tp_name); return msgbuf; } *************** *** 304,311 **** if ((i = PySequence_Size(arg)) != n) { levels[0] = 0; ! sprintf(msgbuf, ! toplevel ? "expected %d arguments, not %d" : ! "must be sequence of length %d, not %d", ! n, i); return msgbuf; } --- 308,315 ---- if ((i = PySequence_Size(arg)) != n) { levels[0] = 0; ! PyOS_snprintf(msgbuf, sizeof(msgbuf), ! toplevel ? "expected %d arguments, not %d" : ! "must be sequence of length %d, not %d", ! n, i); return msgbuf; } *************** *** 367,371 **** assert(expected != NULL); assert(arg != NULL); ! sprintf(msgbuf, "must be %.50s, not %.50s", expected, arg == Py_None ? "None" : arg->ob_type->tp_name); return msgbuf; --- 371,377 ---- assert(expected != NULL); assert(arg != NULL); ! /* XXX use snprintf? */ ! sprintf(msgbuf, ! "must be %.50s, not %.50s", expected, arg == Py_None ? "None" : arg->ob_type->tp_name); return msgbuf; *************** *** 1130,1142 **** if (len < min || max < len) { if (message == NULL) { ! sprintf(msgbuf, ! "%.200s%s takes %s %d argument%s (%d given)", ! fname==NULL ? "function" : fname, ! fname==NULL ? "" : "()", ! min==max ? "exactly" ! : len < min ? "at least" : "at most", ! len < min ? min : max, ! (len < min ? min : max) == 1 ? "" : "s", ! len); message = msgbuf; } --- 1136,1149 ---- if (len < min || max < len) { if (message == NULL) { ! PyOS_snprintf(msgbuf, sizeof(msgbuf), ! "%.200s%s takes %s %d argument%s " ! "(%d given)", ! fname==NULL ? "function" : fname, ! fname==NULL ? "" : "()", ! min==max ? "exactly" ! : len < min ? "at least" : "at most", ! len < min ? min : max, ! (len < min ? min : max) == 1 ? "" : "s", ! len); message = msgbuf; } From jhylton@users.sourceforge.net Wed Nov 28 20:32:24 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 12:32:24 -0800 Subject: [Python-checkins] CVS: python/dist/src/RISCOS/Python dynload_riscos.c,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/RISCOS/Python In directory usw-pr-cvs1:/tmp/cvs-serv6817 Modified Files: dynload_riscos.c Log Message: Use PyOS_snprintf instead of sprintf. Index: dynload_riscos.c =================================================================== RCS file: /cvsroot/python/python/dist/src/RISCOS/Python/dynload_riscos.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** dynload_riscos.c 2001/10/24 20:13:15 1.2 --- dynload_riscos.c 2001/11/28 20:32:22 1.3 *************** *** 56,63 **** err = dlk_load_no_init(pathname, &init_function); ! if (err) ! { ! sprintf(errstr, "dlk failure %d", err); ! PyErr_SetString(PyExc_ImportError, errstr); } return init_function; --- 56,62 ---- err = dlk_load_no_init(pathname, &init_function); ! if (err) { ! PyOS_snprintf(errstr, sizeof(errstr), "dlk failure %d", err); ! PyErr_SetString(PyExc_ImportError, errstr); } return init_function; From tim_one@users.sourceforge.net Wed Nov 28 20:32:59 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 28 Nov 2001 12:32:59 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules posixmodule.c,2.210,2.211 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv6881/python/Modules Modified Files: posixmodule.c Log Message: Repair a botched PyOS_snprintf conversion. Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.210 retrieving revision 2.211 diff -C2 -d -r2.210 -r2.211 *** posixmodule.c 2001/11/28 20:27:42 2.210 --- posixmodule.c 2001/11/28 20:32:57 2.211 *************** *** 433,437 **** os2_formatmsg(msgbuf, msglen, reason); else ! PyOS_snprintf(msgbuf, sizeof(msgbuf), "unknown OS error #%d", errorcode); --- 433,437 ---- os2_formatmsg(msgbuf, msglen, reason); else ! PyOS_snprintf(msgbuf, msgbuflen, "unknown OS error #%d", errorcode); From jhylton@users.sourceforge.net Wed Nov 28 20:36:44 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 12:36:44 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python bltinmodule.c,2.244,2.245 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv7990/Python Modified Files: bltinmodule.c Log Message: Use PyOS_snprintf instead of sprintf. Index: bltinmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/bltinmodule.c,v retrieving revision 2.244 retrieving revision 2.245 diff -C2 -d -r2.244 -r2.245 *** bltinmodule.c 2001/11/05 02:45:59 2.244 --- bltinmodule.c 2001/11/28 20:36:42 2.245 *************** *** 780,784 **** "argument %d to map() must support iteration"; char errbuf[sizeof(errmsg) + 25]; ! sprintf(errbuf, errmsg, i+2); PyErr_SetString(PyExc_TypeError, errbuf); goto Fail_2; --- 780,784 ---- "argument %d to map() must support iteration"; char errbuf[sizeof(errmsg) + 25]; ! PyOS_snprintf(errbuf, sizeof(errbuf), errmsg, i+2); PyErr_SetString(PyExc_TypeError, errbuf); goto Fail_2; From jhylton@users.sourceforge.net Wed Nov 28 20:37:27 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 12:37:27 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python dynload_beos.c,2.5,2.6 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv8174/Python Modified Files: dynload_beos.c Log Message: Use PyOS_snprintf instead of sprintf. Also replace a switch statement with one case and a default to an if/else. Index: dynload_beos.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_beos.c,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -d -r2.5 -r2.6 *** dynload_beos.c 2000/09/01 23:29:28 2.5 --- dynload_beos.c 2001/11/28 20:37:25 2.6 *************** *** 195,206 **** } ! switch( the_id ) { ! case B_ERROR: ! sprintf( buff, "BeOS: Failed to load %.200s", fullpath ); ! break; ! default: ! sprintf( buff, "Unknown error loading %.200s", fullpath ); ! break; ! } PyErr_SetString( PyExc_ImportError, buff ); --- 195,206 ---- } ! if( the_id == B_ERROR ) ! PyOS_snprintf( buff, sizeof(buff), ! "BeOS: Failed to load %.200s", ! fullpath ); ! else ! PyOS_snprintf( buff, sizeof(buff), ! "Unknown error loading %.200s", ! fullpath ); PyErr_SetString( PyExc_ImportError, buff ); *************** *** 208,212 **** } ! sprintf(funcname, "init%.200s", shortname); if( Py_VerboseFlag ) { printf( "get_image_symbol( %s )\n", funcname ); --- 208,212 ---- } ! PyOs_snprintf(funcname, sizeof(funcname), "init%.200s", shortname); if( Py_VerboseFlag ) { printf( "get_image_symbol( %s )\n", funcname ); *************** *** 225,238 **** switch( retval ) { case B_BAD_IMAGE_ID: ! sprintf( buff, "can't load init function for dynamic module: " ! "Invalid image ID for %.180s", fullpath ); break; case B_BAD_INDEX: ! sprintf( buff, "can't load init function for dynamic module: " ! "Bad index for %.180s", funcname ); break; default: ! sprintf( buff, "can't load init function for dynamic module: " ! "Unknown error looking up %.180s", funcname ); break; } --- 225,241 ---- switch( retval ) { case B_BAD_IMAGE_ID: ! PyOS_snprintf( buff, sizeof(buff), ! "can't load init function for dynamic module: " ! "Invalid image ID for %.180s", fullpath ); break; case B_BAD_INDEX: ! PyOS_snprintf( buff, sizeof(buff), ! "can't load init function for dynamic module: " ! "Bad index for %.180s", funcname ); break; default: ! PyOS_snprintf( buff, sizeof(buf), ! "can't load init function for dynamic module: " ! "Unknown error looking up %.180s", funcname ); break; } From jhylton@users.sourceforge.net Wed Nov 28 20:37:39 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 12:37:39 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python dynload_dl.c,2.6,2.7 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv8267/Python Modified Files: dynload_dl.c Log Message: Use PyOS_snprintf instead of sprintf. Index: dynload_dl.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_dl.c,v retrieving revision 2.6 retrieving revision 2.7 diff -C2 -d -r2.6 -r2.7 *** dynload_dl.c 2000/09/01 23:29:28 2.6 --- dynload_dl.c 2001/11/28 20:37:37 2.7 *************** *** 22,26 **** char funcname[258]; ! sprintf(funcname, "init%.200s", shortname); return dl_loadmod(Py_GetProgramName(), pathname, funcname); } --- 22,26 ---- char funcname[258]; ! PyOS_snprintf(funcname, sizeof(funcname), "init%.200s", shortname); return dl_loadmod(Py_GetProgramName(), pathname, funcname); } From jhylton@users.sourceforge.net Wed Nov 28 20:39:08 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 12:39:08 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python dynload_hpux.c,2.5,2.6 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv8738/Python Modified Files: dynload_hpux.c Log Message: Use PyOS_snprintf instead of sprintf. Index: dynload_hpux.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_hpux.c,v retrieving revision 2.5 retrieving revision 2.6 diff -C2 -d -r2.5 -r2.6 *** dynload_hpux.c 2000/09/01 23:29:28 2.5 --- dynload_hpux.c 2001/11/28 20:39:06 2.6 *************** *** 40,48 **** if (Py_VerboseFlag) perror(pathname); ! sprintf(buf, "Failed to load %.200s", pathname); PyErr_SetString(PyExc_ImportError, buf); return NULL; } ! sprintf(funcname, FUNCNAME_PATTERN, shortname); if (Py_VerboseFlag) printf("shl_findsym %s\n", funcname); --- 40,49 ---- if (Py_VerboseFlag) perror(pathname); ! PyOS_snprintf(buf, sizeof(buf), "Failed to load %.200s", ! pathname); PyErr_SetString(PyExc_ImportError, buf); return NULL; } ! PyOS_snprintf(funcname, sizeof(funcname), FUNCNAME_PATTERN, shortname); if (Py_VerboseFlag) printf("shl_findsym %s\n", funcname); From jhylton@users.sourceforge.net Wed Nov 28 20:40:49 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 12:40:49 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python dynload_mac.c,2.11,2.12 dynload_next.c,2.8,2.9 dynload_os2.c,2.6,2.7 dynload_shlib.c,2.12,2.13 dynload_win.c,2.9,2.10 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv9366/Python Modified Files: dynload_mac.c dynload_next.c dynload_os2.c dynload_shlib.c dynload_win.c Log Message: Use PyOS_snprintf instead of sprintf. Index: dynload_mac.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_mac.c,v retrieving revision 2.11 retrieving revision 2.12 diff -C2 -d -r2.11 -r2.12 *** dynload_mac.c 2001/01/19 23:34:06 2.11 --- dynload_mac.c 2001/11/28 20:40:47 2.12 *************** *** 67,71 **** #endif if ( err ) { ! sprintf(buf, "%.200s: %.200s", pathname, PyMac_StrError(err)); PyErr_SetString(PyExc_ImportError, buf); return NULL; --- 67,72 ---- #endif if ( err ) { ! PyOS_snprintf(buf, sizeof(buf), ! "%.200s: %.200s", pathname, PyMac_StrError(err)); PyErr_SetString(PyExc_ImportError, buf); return NULL; *************** *** 92,97 **** */ if (errMessage[0] == 10 && strncmp((char *)errMessage+1, "PythonCore", 10) == 0 ) { ! sprintf(buf, "Dynamic module was built for %s version of MacPython", ! (err == cfragImportTooOldErr ? "a newer" : "an older")); PyErr_SetString(PyExc_ImportError, buf); return NULL; --- 93,99 ---- */ if (errMessage[0] == 10 && strncmp((char *)errMessage+1, "PythonCore", 10) == 0 ) { ! PyOS_snprintf(buf, sizeof(buf), ! "Dynamic module was built for %s version of MacPython", ! (err == cfragImportTooOldErr ? "a newer" : "an older")); PyErr_SetString(PyExc_ImportError, buf); return NULL; *************** *** 99,103 **** } if ( err ) { ! sprintf(buf, "%.*s: %.200s", errMessage[0], errMessage+1, PyMac_StrError(err)); --- 101,105 ---- } if ( err ) { ! PyOS_snprintf(buf, sizeof(buf), "%.*s: %.200s", errMessage[0], errMessage+1, PyMac_StrError(err)); *************** *** 106,114 **** } /* Locate the address of the correct init function */ ! sprintf(funcname, "init%.200s", shortname); err = FindSymbol(connID, Pstring(funcname), &symAddr, &class); if ( err ) { ! sprintf(buf, "%s: %.200s", ! funcname, PyMac_StrError(err)); PyErr_SetString(PyExc_ImportError, buf); return NULL; --- 108,116 ---- } /* Locate the address of the correct init function */ ! PyOS_snprintf(funcname, sizeof(funcname), "init%.200s", shortname); err = FindSymbol(connID, Pstring(funcname), &symAddr, &class); if ( err ) { ! PyOS_snprintf(buf, sizeof(buf), "%s: %.200s", ! funcname, PyMac_StrError(err)); PyErr_SetString(PyExc_ImportError, buf); return NULL; Index: dynload_next.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_next.c,v retrieving revision 2.8 retrieving revision 2.9 diff -C2 -d -r2.8 -r2.9 *** dynload_next.c 2001/08/11 21:54:11 2.8 --- dynload_next.c 2001/11/28 20:40:47 2.9 *************** *** 45,49 **** char funcname[258]; ! sprintf(funcname, "_init%.200s", shortname); #ifdef USE_RLD --- 45,49 ---- char funcname[258]; ! PyOS_snprintf(funcname, sizeof(funcname), "_init%.200s", shortname); #ifdef USE_RLD Index: dynload_os2.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_os2.c,v retrieving revision 2.6 retrieving revision 2.7 diff -C2 -d -r2.6 -r2.7 *** dynload_os2.c 2001/11/28 11:47:00 2.6 --- dynload_os2.c 2001/11/28 20:40:47 2.7 *************** *** 32,43 **** if (rc != NO_ERROR) { char errBuf[256]; ! sprintf(errBuf, ! "DLL load failed, rc = %d: %.200s", ! rc, failreason); PyErr_SetString(PyExc_ImportError, errBuf); return NULL; } ! sprintf(funcname, "init%.200s", shortname); rc = DosQueryProcAddr(hDLL, 0L, funcname, &p); if (rc != NO_ERROR) --- 32,43 ---- if (rc != NO_ERROR) { char errBuf[256]; ! PyOS_snprintf(errBuf, sizeof(errBuf), ! "DLL load failed, rc = %d: %.200s", ! rc, failreason); PyErr_SetString(PyExc_ImportError, errBuf); return NULL; } ! PyOS_snprintf(funcname, sizeof(funcname), "init%.200s", shortname); rc = DosQueryProcAddr(hDLL, 0L, funcname, &p); if (rc != NO_ERROR) Index: dynload_shlib.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_shlib.c,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -d -r2.12 -r2.13 *** dynload_shlib.c 2001/10/18 21:24:04 2.12 --- dynload_shlib.c 2001/11/28 20:40:47 2.13 *************** *** 58,66 **** if (strchr(pathname, '/') == NULL) { /* Prefix bare filename with "./" */ ! sprintf(pathbuf, "./%-.255s", pathname); pathname = pathbuf; } ! sprintf(funcname, LEAD_UNDERSCORE "init%.200s", shortname); if (fp != NULL) { --- 58,67 ---- if (strchr(pathname, '/') == NULL) { /* Prefix bare filename with "./" */ ! PyOS_snprintf(pathbuf, sizeof(pathbuf), "./%-.255s", pathname); pathname = pathbuf; } ! PyOS_snprintf(funcname, sizeof(funcname), ! LEAD_UNDERSCORE "init%.200s", shortname); if (fp != NULL) { Index: dynload_win.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_win.c,v retrieving revision 2.9 retrieving revision 2.10 diff -C2 -d -r2.9 -r2.10 *** dynload_win.c 2001/11/28 11:47:00 2.9 --- dynload_win.c 2001/11/28 20:40:47 2.10 *************** *** 160,164 **** char funcname[258], *import_python; ! sprintf(funcname, "init%.200s", shortname); #ifdef MS_WIN32 --- 160,164 ---- char funcname[258], *import_python; ! PyOS_snprintf(funcname, sizeof(funcname), "init%.200s", shortname); #ifdef MS_WIN32 *************** *** 202,208 **** This should not happen if called correctly. */ if (theLength == 0) { ! sprintf(errBuf, ! "DLL load failed with error code %d", ! errorCode); } else { size_t len; --- 202,208 ---- This should not happen if called correctly. */ if (theLength == 0) { ! PyOS_snprintf(errBuf, sizeof(errBuf), ! "DLL load failed with error code %d", ! errorCode); } else { size_t len; *************** *** 226,230 **** char buffer[256]; ! sprintf(buffer,"python%d%d.dll", PY_MAJOR_VERSION,PY_MINOR_VERSION); import_python = GetPythonImport(hDLL); --- 226,230 ---- char buffer[256]; ! PyOS_snprintf(buffer, sizeof(buffer), "python%d%d.dll", PY_MAJOR_VERSION,PY_MINOR_VERSION); import_python = GetPythonImport(hDLL); *************** *** 232,239 **** if (import_python && strcasecmp(buffer,import_python)) { ! sprintf(buffer, ! "Module use of %.150s conflicts " ! "with this version of Python.", ! import_python); PyErr_SetString(PyExc_ImportError,buffer); FreeLibrary(hDLL); --- 232,239 ---- if (import_python && strcasecmp(buffer,import_python)) { ! PyOS_snprintf(buffer, sizeof(buffer), ! "Module use of %.150s conflicts " ! "with this version of Python.", ! import_python); PyErr_SetString(PyExc_ImportError,buffer); FreeLibrary(hDLL); *************** *** 252,256 **** { /* Prefix bare filename with ".\" */ ! sprintf(pathbuf, ".\\%-.13s", pathname); pathname = pathbuf; } --- 252,257 ---- { /* Prefix bare filename with ".\" */ ! PyOS_snprintf(pathbuf, sizeof(pathbuf), ! ".\\%-.13s", pathname); pathname = pathbuf; } *************** *** 258,263 **** if (hDLL < HINSTANCE_ERROR){ char errBuf[256]; ! sprintf(errBuf, ! "DLL load failed with error code %d", hDLL); PyErr_SetString(PyExc_ImportError, errBuf); return NULL; --- 259,265 ---- if (hDLL < HINSTANCE_ERROR){ char errBuf[256]; ! PyOS_snprintf(errBuf, sizeof(errBuf), ! "DLL load failed with error code %d", ! hDLL); PyErr_SetString(PyExc_ImportError, errBuf); return NULL; From jhylton@users.sourceforge.net Wed Nov 28 20:41:05 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 12:41:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python getversion.c,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv9494/Python Modified Files: getversion.c Log Message: Use PyOS_snprintf instead of sprintf. Index: getversion.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getversion.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** getversion.c 2000/09/01 23:29:28 1.14 --- getversion.c 2001/11/28 20:41:03 1.15 *************** *** 10,15 **** { static char version[250]; ! sprintf(version, "%.80s (%.80s) %.80s", PY_VERSION, ! Py_GetBuildInfo(), Py_GetCompiler()); return version; } --- 10,15 ---- { static char version[250]; ! PyOS_snprintf(version, sizeof(version), "%.80s (%.80s) %.80s", ! PY_VERSION, Py_GetBuildInfo(), Py_GetCompiler()); return version; } From jhylton@users.sourceforge.net Wed Nov 28 20:41:30 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 12:41:30 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python pythonrun.c,2.150,2.151 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv9672/Python Modified Files: pythonrun.c Log Message: Use PyOS_snprintf instead of sprintf. Index: pythonrun.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/pythonrun.c,v retrieving revision 2.150 retrieving revision 2.151 diff -C2 -d -r2.150 -r2.151 *** pythonrun.c 2001/11/13 23:08:26 2.150 --- pythonrun.c 2001/11/28 20:41:28 2.151 *************** *** 934,938 **** PyFile_WriteString(filename, f); PyFile_WriteString("\", line ", f); ! sprintf(buf, "%d", lineno); PyFile_WriteString(buf, f); PyFile_WriteString("\n", f); --- 934,938 ---- PyFile_WriteString(filename, f); PyFile_WriteString("\", line ", f); ! PyOS_snprintf(buf, sizeof(buf), "%d", lineno); PyFile_WriteString(buf, f); PyFile_WriteString("\n", f); From jhylton@users.sourceforge.net Wed Nov 28 20:42:03 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 12:42:03 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python strerror.c,2.10,2.11 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv9875/Python Modified Files: strerror.c Log Message: Use PyOS_snprintf instead of sprintf. Index: strerror.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/strerror.c,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -d -r2.10 -r2.11 *** strerror.c 2000/09/01 23:29:28 2.10 --- strerror.c 2001/11/28 20:42:01 2.11 *************** *** 4,7 **** --- 4,8 ---- #include + #include "Python.h" extern int sys_nerr; *************** *** 14,18 **** if (err >= 0 && err < sys_nerr) return sys_errlist[err]; ! sprintf(buf, "Unknown errno %d", err); return buf; } --- 15,19 ---- if (err >= 0 && err < sys_nerr) return sys_errlist[err]; ! PyOS_snprintf(buf, sizeof(buf), "Unknown errno %d", err); return buf; } From jhylton@users.sourceforge.net Wed Nov 28 20:42:22 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 12:42:22 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python traceback.c,2.35,2.36 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv10034/Python Modified Files: traceback.c Log Message: Use PyOS_snprintf instead of sprintf. Index: traceback.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/traceback.c,v retrieving revision 2.35 retrieving revision 2.36 diff -C2 -d -r2.35 -r2.36 *** traceback.c 2001/11/27 20:30:42 2.35 --- traceback.c 2001/11/28 20:42:20 2.36 *************** *** 196,200 **** } } ! sprintf(linebuf, FMT, filename, lineno, name); err = PyFile_WriteString(linebuf, f); if (xfp == NULL || err != 0) --- 196,200 ---- } } ! PyOS_snprintf(linebuf, sizeof(linebuf), FMT, filename, lineno, name); err = PyFile_WriteString(linebuf, f); if (xfp == NULL || err != 0) From bwarsaw@users.sourceforge.net Wed Nov 28 20:50:58 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 28 Nov 2001 12:50:58 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects complexobject.c,2.51,2.52 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv12794 Modified Files: complexobject.c Log Message: complex_to_buf(), complex_subtype_from_c_complex(): Conversion of sprintf() to PyOS_snprintf() for buffer overrun avoidance. complex_print(), complex_repr(), complex_str(): Call complex_to_buf() passing in sizeof(buf). Index: complexobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/complexobject.c,v retrieving revision 2.51 retrieving revision 2.52 diff -C2 -d -r2.51 -r2.52 *** complexobject.c 2001/10/25 18:07:22 2.51 --- complexobject.c 2001/11/28 20:50:56 2.52 *************** *** 271,281 **** static void ! complex_to_buf(char *buf, PyComplexObject *v, int precision) { if (v->cval.real == 0.) ! sprintf(buf, "%.*gj", precision, v->cval.imag); else ! sprintf(buf, "(%.*g%+.*gj)", precision, v->cval.real, ! precision, v->cval.imag); } --- 271,283 ---- static void ! complex_to_buf(char *buf, int bufsz, PyComplexObject *v, int precision) { if (v->cval.real == 0.) ! PyOS_snprintf(buf, bufsz, "%.*gj", ! precision, v->cval.imag); else ! PyOS_snprintf(buf, bufsz, "(%.*g%+.*gj)", ! precision, v->cval.real, ! precision, v->cval.imag); } *************** *** 284,288 **** { char buf[100]; ! complex_to_buf(buf, v, (flags & Py_PRINT_RAW) ? PREC_STR : PREC_REPR); fputs(buf, fp); --- 286,290 ---- { char buf[100]; ! complex_to_buf(buf, sizeof(buf), v, (flags & Py_PRINT_RAW) ? PREC_STR : PREC_REPR); fputs(buf, fp); *************** *** 294,298 **** { char buf[100]; ! complex_to_buf(buf, v, PREC_REPR); return PyString_FromString(buf); } --- 296,300 ---- { char buf[100]; ! complex_to_buf(buf, sizeof(buf), v, PREC_REPR); return PyString_FromString(buf); } *************** *** 302,306 **** { char buf[100]; ! complex_to_buf(buf, v, PREC_STR); return PyString_FromString(buf); } --- 304,308 ---- { char buf[100]; ! complex_to_buf(buf, sizeof(buf), v, PREC_STR); return PyString_FromString(buf); } *************** *** 753,757 **** PyFPE_END_PROTECT(z) if (errno != 0) { ! sprintf(buffer, "float() out of range: %.150s", s); PyErr_SetString( --- 755,759 ---- PyFPE_END_PROTECT(z) if (errno != 0) { ! PyOS_snprintf(buffer, sizeof(buffer), "float() out of range: %.150s", s); PyErr_SetString( From bwarsaw@users.sourceforge.net Wed Nov 28 20:52:23 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 28 Nov 2001 12:52:23 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects floatobject.c,2.106,2.107 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv13293 Modified Files: floatobject.c Log Message: PyFloat_FromString(): Conversion of sprintf() to PyOS_snprintf() for buffer overrun avoidance. Index: floatobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v retrieving revision 2.106 retrieving revision 2.107 diff -C2 -d -r2.106 -r2.107 *** floatobject.c 2001/11/01 23:59:56 2.106 --- floatobject.c 2001/11/28 20:52:21 2.107 *************** *** 151,155 **** end = last; if (end == s) { ! sprintf(buffer, "invalid literal for float(): %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; --- 151,156 ---- end = last; if (end == s) { ! PyOS_snprintf(buffer, sizeof(buffer), ! "invalid literal for float(): %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; *************** *** 160,164 **** end++; if (*end != '\0') { ! sprintf(buffer, "invalid literal for float(): %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; --- 161,166 ---- end++; if (*end != '\0') { ! PyOS_snprintf(buffer, sizeof(buffer), ! "invalid literal for float(): %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; From bwarsaw@users.sourceforge.net Wed Nov 28 20:55:36 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 28 Nov 2001 12:55:36 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects intobject.c,2.76,2.77 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv14234 Modified Files: intobject.c Log Message: PyInt_FromString(), int_repr(), int_oct(), int_hex(): Conversion of sprintf() to PyOS_snprintf() for buffer overrun avoidance. Index: intobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/intobject.c,v retrieving revision 2.76 retrieving revision 2.77 diff -C2 -d -r2.76 -r2.77 *** intobject.c 2001/09/19 01:25:15 2.76 --- intobject.c 2001/11/28 20:55:34 2.77 *************** *** 199,208 **** if (*end != '\0') { bad: ! sprintf(buffer, "invalid literal for int(): %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; } else if (errno != 0) { ! sprintf(buffer, "int() literal too large: %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; --- 199,210 ---- if (*end != '\0') { bad: ! PyOS_snprintf(buffer, sizeof(buffer), ! "invalid literal for int(): %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; } else if (errno != 0) { ! PyOS_snprintf(buffer, sizeof(buffer), ! "int() literal too large: %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; *************** *** 258,262 **** { char buf[20]; ! sprintf(buf, "%ld", v->ob_ival); return PyString_FromString(buf); } --- 260,264 ---- { char buf[20]; ! PyOS_snprintf(buf, sizeof(buf), "%ld", v->ob_ival); return PyString_FromString(buf); } *************** *** 821,825 **** strcpy(buf, "0"); else ! sprintf(buf, "0%lo", x); return PyString_FromString(buf); } --- 823,827 ---- strcpy(buf, "0"); else ! PyOS_snprintf(buf, sizeof(buf), "0%lo", x); return PyString_FromString(buf); } *************** *** 830,834 **** char buf[100]; long x = v -> ob_ival; ! sprintf(buf, "0x%lx", x); return PyString_FromString(buf); } --- 832,836 ---- char buf[100]; long x = v -> ob_ival; ! PyOS_snprintf(buf, sizeof(buf), "0x%lx", x); return PyString_FromString(buf); } From bwarsaw@users.sourceforge.net Wed Nov 28 20:56:46 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 28 Nov 2001 12:56:46 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects structseq.c,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv14600 Modified Files: structseq.c Log Message: structseq_new(): Conversion of sprintf() to PyOS_snprintf() for buffer overrun avoidance. Index: structseq.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/structseq.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** structseq.c 2001/10/30 23:20:46 1.2 --- structseq.c 2001/11/28 20:56:44 1.3 *************** *** 103,107 **** required_len = REAL_SIZE_TP(type); if (len != required_len) { ! sprintf(msgbuf, "constructor takes exactly %d arguments (%d given)", required_len, --- 103,108 ---- required_len = REAL_SIZE_TP(type); if (len != required_len) { ! PyOS_snprintf( ! msgbuf, sizeof(msgbuf), "constructor takes exactly %d arguments (%d given)", required_len, From bwarsaw@users.sourceforge.net Wed Nov 28 21:00:43 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 28 Nov 2001 13:00:43 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects unicodeobject.c,2.122,2.123 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv15734 Modified Files: unicodeobject.c Log Message: formatfloat(), formatint(): Conversion of sprintf() to PyOS_snprintf() for buffer overrun avoidance. Index: unicodeobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/unicodeobject.c,v retrieving revision 2.122 retrieving revision 2.123 diff -C2 -d -r2.122 -r2.123 *** unicodeobject.c 2001/11/28 12:56:20 2.122 --- unicodeobject.c 2001/11/28 21:00:41 2.123 *************** *** 5081,5085 **** if (type == 'f' && (fabs(x) / 1e25) >= 1e25) type = 'g'; ! sprintf(fmt, "%%%s.%d%c", (flags & F_ALT) ? "#" : "", prec, type); /* worst case length calc to ensure no buffer overrun: fmt = %#.g --- 5081,5086 ---- if (type == 'f' && (fabs(x) / 1e25) >= 1e25) type = 'g'; ! PyOS_snprintf(fmt, sizeof(fmt), "%%%s.%d%c", ! (flags & F_ALT) ? "#" : "", prec, type); /* worst case length calc to ensure no buffer overrun: fmt = %#.g *************** *** 5152,5164 **** if (x == 0 && (flags & F_ALT) && (type == 'x' || type == 'X')) { /* Only way to know what the platform does is to try it. */ ! sprintf(fmt, type == 'x' ? "%#x" : "%#X", 0); if (fmt[1] != (char)type) { /* Supply our own leading 0x/0X -- needed under std C */ use_native_c_format = 0; ! sprintf(fmt, "0%c%%#.%dl%c", type, prec, type); } } if (use_native_c_format) ! sprintf(fmt, "%%%s.%dl%c", (flags & F_ALT) ? "#" : "", prec, type); return usprintf(buf, fmt, x); } --- 5153,5166 ---- if (x == 0 && (flags & F_ALT) && (type == 'x' || type == 'X')) { /* Only way to know what the platform does is to try it. */ ! PyOS_snprintf(fmt, sizeof(fmt), type == 'x' ? "%#x" : "%#X", 0); if (fmt[1] != (char)type) { /* Supply our own leading 0x/0X -- needed under std C */ use_native_c_format = 0; ! PyOS_snprintf(fmt, sizeof(fmt), "0%c%%#.%dl%c", type, prec, type); } } if (use_native_c_format) ! PyOS_snprintf(fmt, sizeof(fmt), "%%%s.%dl%c", ! (flags & F_ALT) ? "#" : "", prec, type); return usprintf(buf, fmt, x); } From bwarsaw@users.sourceforge.net Wed Nov 28 21:01:58 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 28 Nov 2001 13:01:58 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects weakrefobject.c,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv16128 Modified Files: weakrefobject.c Log Message: weakref_repr(), proxy_repr(): Conversion of sprintf() to PyOS_snprintf() for buffer overrun avoidance. Index: weakrefobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/weakrefobject.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** weakrefobject.c 2001/11/28 11:46:59 1.5 --- weakrefobject.c 2001/11/28 21:01:56 1.6 *************** *** 132,142 **** char buffer[256]; if (PyWeakref_GET_OBJECT(self) == Py_None) { ! sprintf(buffer, "", ! (long)(self)); } else { ! sprintf(buffer, "", ! (long)(self), PyWeakref_GET_OBJECT(self)->ob_type->tp_name, ! (long)(PyWeakref_GET_OBJECT(self))); } return PyString_FromString(buffer); --- 132,144 ---- char buffer[256]; if (PyWeakref_GET_OBJECT(self) == Py_None) { ! PyOS_snprintf(buffer, sizeof(buffer), "", ! (long)(self)); } else { ! PyOS_snprintf(buffer, sizeof(buffer), ! "", ! (long)(self), ! PyWeakref_GET_OBJECT(self)->ob_type->tp_name, ! (long)(PyWeakref_GET_OBJECT(self))); } return PyString_FromString(buffer); *************** *** 266,272 **** { char buf[160]; ! sprintf(buf, "", proxy, ! PyWeakref_GET_OBJECT(proxy)->ob_type->tp_name, ! PyWeakref_GET_OBJECT(proxy)); return PyString_FromString(buf); } --- 268,275 ---- { char buf[160]; ! PyOS_snprintf(buf, sizeof(buf), ! "", proxy, ! PyWeakref_GET_OBJECT(proxy)->ob_type->tp_name, ! PyWeakref_GET_OBJECT(proxy)); return PyString_FromString(buf); } From bwarsaw@users.sourceforge.net Wed Nov 28 21:03:39 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 28 Nov 2001 13:03:39 -0800 Subject: [Python-checkins] CVS: python/dist/src/PC import_nt.c,1.15,1.16 Message-ID: Update of /cvsroot/python/python/dist/src/PC In directory usw-pr-cvs1:/tmp/cvs-serv16548 Modified Files: import_nt.c Log Message: PyWin_FindRegisteredModule(): Conversion of sprintf() to PyOS_snprintf() for buffer overrun avoidance. Index: import_nt.c =================================================================== RCS file: /cvsroot/python/python/dist/src/PC/import_nt.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** import_nt.c 2001/07/15 18:38:47 1.15 --- import_nt.c 2001/11/28 21:03:37 1.16 *************** *** 50,56 **** */ moduleKey = alloca(bufSize); ! sprintf(moduleKey, ! "Software\\Python\\PythonCore\\%s\\Modules\\%s%s", ! PyWin_DLLVersionString, moduleName, debugString); modNameSize = pathLen; --- 50,56 ---- */ moduleKey = alloca(bufSize); ! PyOS_snprintf(moduleKey, bufSize, ! "Software\\Python\\PythonCore\\%s\\Modules\\%s%s", ! PyWin_DLLVersionString, moduleName, debugString); modNameSize = pathLen; From bwarsaw@users.sourceforge.net Wed Nov 28 21:04:27 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 28 Nov 2001 13:04:27 -0800 Subject: [Python-checkins] CVS: python/dist/src/Parser grammar1.c,2.12,2.13 Message-ID: Update of /cvsroot/python/python/dist/src/Parser In directory usw-pr-cvs1:/tmp/cvs-serv16791 Modified Files: grammar1.c Log Message: PyGrammar_LabelRepr(): Conversion of sprintf() to PyOS_snprintf() for buffer overrun avoidance. Index: grammar1.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/grammar1.c,v retrieving revision 2.12 retrieving revision 2.13 diff -C2 -d -r2.12 -r2.13 *** grammar1.c 2000/09/01 23:29:28 2.12 --- grammar1.c 2001/11/28 21:04:25 2.13 *************** *** 1,3 **** ! /* Grammar subroutines needed by parser */ --- 1,3 ---- ! #include "Python.h" /* Grammar subroutines needed by parser */ *************** *** 40,44 **** else if (ISNONTERMINAL(lb->lb_type)) { if (lb->lb_str == NULL) { ! sprintf(buf, "NT%d", lb->lb_type); return buf; } --- 40,44 ---- else if (ISNONTERMINAL(lb->lb_type)) { if (lb->lb_str == NULL) { ! PyOS_snprintf(buf, sizeof(buf), "NT%d", lb->lb_type); return buf; } *************** *** 50,55 **** return _PyParser_TokenNames[lb->lb_type]; else { ! sprintf(buf, "%.32s(%.32s)", ! _PyParser_TokenNames[lb->lb_type], lb->lb_str); return buf; } --- 50,56 ---- return _PyParser_TokenNames[lb->lb_type]; else { ! PyOS_snprintf(buf, sizeof(buf), "%.32s(%.32s)", ! _PyParser_TokenNames[lb->lb_type], ! lb->lb_str); return buf; } From bwarsaw@users.sourceforge.net Wed Nov 28 21:10:43 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 28 Nov 2001 13:10:43 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python compile.c,2.231,2.232 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv18695 Modified Files: compile.c Log Message: code_repr(), com_addop_varname(), com_list_comprehension(), com_arglist(), symtable_check_unoptimized(), symtable_params(), symtable_global(), symtable_list_comprehension(): Conversion of sprintf() to PyOS_snprintf() for buffer overrun avoidance. Index: compile.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/compile.c,v retrieving revision 2.231 retrieving revision 2.232 diff -C2 -d -r2.231 -r2.232 *** compile.c 2001/11/28 11:47:00 2.231 --- compile.c 2001/11/28 21:10:39 2.232 *************** *** 121,126 **** if (co->co_name && PyString_Check(co->co_name)) name = PyString_AS_STRING(co->co_name); ! sprintf(buf, "", ! name, co, filename, lineno); return PyString_FromString(buf); } --- 121,127 ---- if (co->co_name && PyString_Check(co->co_name)) name = PyString_AS_STRING(co->co_name); ! PyOS_snprintf(buf, sizeof(buf), ! "", ! name, co, filename, lineno); return PyString_FromString(buf); } *************** *** 1021,1025 **** case NAME_CLOSURE: { char buf[500]; ! sprintf(buf, DEL_CLOSURE_ERROR, name); com_error(c, PyExc_SyntaxError, buf); i = 255; --- 1022,1027 ---- case NAME_CLOSURE: { char buf[500]; ! PyOS_snprintf(buf, sizeof(buf), ! DEL_CLOSURE_ERROR, name); com_error(c, PyExc_SyntaxError, buf); i = 255; *************** *** 1367,1372 **** { /* listmaker: test list_for */ ! char tmpname[12]; ! sprintf(tmpname, "_[%d]", ++c->c_tmpname); com_addoparg(c, BUILD_LIST, 0); com_addbyte(c, DUP_TOP); /* leave the result on the stack */ --- 1369,1374 ---- { /* listmaker: test list_for */ ! char tmpname[30]; ! PyOS_snprintf(tmpname, sizeof(tmpname), "_[%d]", ++c->c_tmpname); com_addoparg(c, BUILD_LIST, 0); com_addbyte(c, DUP_TOP); /* leave the result on the stack */ *************** *** 3790,3794 **** int nch, i, narg; int complex = 0; ! char nbuf[10]; REQ(n, varargslist); /* varargslist: --- 3792,3796 ---- int nch, i, narg; int complex = 0; ! char nbuf[30]; REQ(n, varargslist); /* varargslist: *************** *** 3804,3808 **** fp = CHILD(ch, 0); if (TYPE(fp) != NAME) { ! sprintf(nbuf, ".%d", i); complex = 1; } --- 3806,3810 ---- fp = CHILD(ch, 0); if (TYPE(fp) != NAME) { ! PyOS_snprintf(nbuf, sizeof(nbuf), ".%d", i); complex = 1; } *************** *** 4456,4484 **** if (ste->ste_child_free) { if (ste->ste_optimized == OPT_IMPORT_STAR) ! sprintf(buf, ILLEGAL_IMPORT_STAR, ! PyString_AS_STRING(ste->ste_name), ! ILLEGAL_CONTAINS); else if (ste->ste_optimized == (OPT_BARE_EXEC | OPT_EXEC)) ! sprintf(buf, ILLEGAL_BARE_EXEC, ! PyString_AS_STRING(ste->ste_name), ! ILLEGAL_CONTAINS); else { ! sprintf(buf, ILLEGAL_EXEC_AND_IMPORT_STAR, ! PyString_AS_STRING(ste->ste_name), ! ILLEGAL_CONTAINS); } } else { if (ste->ste_optimized == OPT_IMPORT_STAR) ! sprintf(buf, ILLEGAL_IMPORT_STAR, ! PyString_AS_STRING(ste->ste_name), ! ILLEGAL_IS); else if (ste->ste_optimized == (OPT_BARE_EXEC | OPT_EXEC)) ! sprintf(buf, ILLEGAL_BARE_EXEC, ! PyString_AS_STRING(ste->ste_name), ! ILLEGAL_IS); else { ! sprintf(buf, ILLEGAL_EXEC_AND_IMPORT_STAR, ! PyString_AS_STRING(ste->ste_name), ! ILLEGAL_IS); } } --- 4458,4492 ---- if (ste->ste_child_free) { if (ste->ste_optimized == OPT_IMPORT_STAR) ! PyOS_snprintf(buf, sizeof(buf), ! ILLEGAL_IMPORT_STAR, ! PyString_AS_STRING(ste->ste_name), ! ILLEGAL_CONTAINS); else if (ste->ste_optimized == (OPT_BARE_EXEC | OPT_EXEC)) ! PyOS_snprintf(buf, sizeof(buf), ! ILLEGAL_BARE_EXEC, ! PyString_AS_STRING(ste->ste_name), ! ILLEGAL_CONTAINS); else { ! PyOS_snprintf(buf, sizeof(buf), ! ILLEGAL_EXEC_AND_IMPORT_STAR, ! PyString_AS_STRING(ste->ste_name), ! ILLEGAL_CONTAINS); } } else { if (ste->ste_optimized == OPT_IMPORT_STAR) ! PyOS_snprintf(buf, sizeof(buf), ! ILLEGAL_IMPORT_STAR, ! PyString_AS_STRING(ste->ste_name), ! ILLEGAL_IS); else if (ste->ste_optimized == (OPT_BARE_EXEC | OPT_EXEC)) ! PyOS_snprintf(buf, sizeof(buf), ! ILLEGAL_BARE_EXEC, ! PyString_AS_STRING(ste->ste_name), ! ILLEGAL_IS); else { ! PyOS_snprintf(buf, sizeof(buf), ! ILLEGAL_EXEC_AND_IMPORT_STAR, ! PyString_AS_STRING(ste->ste_name), ! ILLEGAL_IS); } } *************** *** 5232,5237 **** symtable_add_def(st, STR(CHILD(c, 0)), DEF_PARAM); else { ! char nbuf[10]; ! sprintf(nbuf, ".%d", i); symtable_add_def(st, nbuf, DEF_PARAM); complex = i; --- 5240,5245 ---- symtable_add_def(st, STR(CHILD(c, 0)), DEF_PARAM); else { ! char nbuf[30]; ! PyOS_snprintf(nbuf, sizeof(nbuf), ".%d", i); symtable_add_def(st, nbuf, DEF_PARAM); complex = i; *************** *** 5319,5326 **** else { if (flags & DEF_LOCAL) ! sprintf(buf, GLOBAL_AFTER_ASSIGN, ! name); else ! sprintf(buf, GLOBAL_AFTER_USE, name); symtable_warn(st, buf); } --- 5327,5336 ---- else { if (flags & DEF_LOCAL) ! PyOS_snprintf(buf, sizeof(buf), ! GLOBAL_AFTER_ASSIGN, ! name); else ! PyOS_snprintf(buf, sizeof(buf), ! GLOBAL_AFTER_USE, name); symtable_warn(st, buf); } *************** *** 5333,5339 **** symtable_list_comprehension(struct symtable *st, node *n) { ! char tmpname[12]; ! sprintf(tmpname, "_[%d]", st->st_tmpname); symtable_add_def(st, tmpname, DEF_LOCAL); symtable_assign(st, CHILD(n, 1), 0); --- 5343,5349 ---- symtable_list_comprehension(struct symtable *st, node *n) { ! char tmpname[30]; ! PyOS_snprintf(tmpname, sizeof(tmpname), "_[%d]", st->st_tmpname); symtable_add_def(st, tmpname, DEF_LOCAL); symtable_assign(st, CHILD(n, 1), 0); From jhylton@users.sourceforge.net Wed Nov 28 21:30:06 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 13:30:06 -0800 Subject: [Python-checkins] CVS: python/dist/src/RISCOS/Modules getpath_riscos.c,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/RISCOS/Modules In directory usw-pr-cvs1:/tmp/cvs-serv25184 Modified Files: getpath_riscos.c Log Message: Use strncpy() instead of sprintf() in calculate_path(). Also reformat calculate_path() using the standard format. Index: getpath_riscos.c =================================================================== RCS file: /cvsroot/python/python/dist/src/RISCOS/Modules/getpath_riscos.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** getpath_riscos.c 2001/10/24 20:12:29 1.3 --- getpath_riscos.c 2001/11/28 21:30:04 1.4 *************** *** 2,23 **** #include "osdefs.h" ! static char *prefix,*exec_prefix,*progpath,*module_search_path=0; static void calculate_path() ! { char *pypath=getenv("Python$Path"); ! if(pypath) ! { module_search_path=malloc(strlen(pypath)+1); ! if (module_search_path) sprintf(module_search_path,"%s",pypath); ! else ! { /* We can't exit, so print a warning and limp along */ ! fprintf(stderr, "Not enough memory for dynamic PYTHONPATH.\n"); ! fprintf(stderr, "Using default static PYTHONPATH.\n"); ! } ! } ! if(!module_search_path) module_search_path = ".Lib"; ! prefix=""; ! exec_prefix=prefix; ! progpath=Py_GetProgramName(); } --- 2,27 ---- #include "osdefs.h" ! static char *prefix, *exec_prefix, *progpath, *module_search_path=NULL; static void calculate_path() ! { ! char *pypath = getenv("Python$Path"); ! if (pypath) { ! int pathlen = strlen(pypath); ! module_search_path = malloc(pathlen + 1); ! if (module_search_path) ! strncpy(module_search_path, pypath, pathlen); ! else { ! fprintf(stderr, ! "Not enough memory for dynamic PYTHONPATH.\n" ! "Using default static PYTHONPATH.\n"); ! } ! } ! if (!module_search_path) ! module_search_path = ".Lib"; ! prefix = ""; ! exec_prefix = prefix; ! progpath = Py_GetProgramName(); } From bwarsaw@users.sourceforge.net Wed Nov 28 21:34:36 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 28 Nov 2001 13:34:36 -0800 Subject: [Python-checkins] CVS: python/dist/src/Parser grammar1.c,2.13,2.14 Message-ID: Update of /cvsroot/python/python/dist/src/Parser In directory usw-pr-cvs1:/tmp/cvs-serv26492 Modified Files: grammar1.c Log Message: Reverting last change so we don't have to think about the assert macro redefinition problem. Index: grammar1.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Parser/grammar1.c,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -d -r2.13 -r2.14 *** grammar1.c 2001/11/28 21:04:25 2.13 --- grammar1.c 2001/11/28 21:34:34 2.14 *************** *** 1,3 **** ! #include "Python.h" /* Grammar subroutines needed by parser */ --- 1,3 ---- ! /* Grammar subroutines needed by parser */ *************** *** 40,44 **** else if (ISNONTERMINAL(lb->lb_type)) { if (lb->lb_str == NULL) { ! PyOS_snprintf(buf, sizeof(buf), "NT%d", lb->lb_type); return buf; } --- 40,44 ---- else if (ISNONTERMINAL(lb->lb_type)) { if (lb->lb_str == NULL) { ! sprintf(buf, "NT%d", lb->lb_type); return buf; } *************** *** 50,56 **** return _PyParser_TokenNames[lb->lb_type]; else { ! PyOS_snprintf(buf, sizeof(buf), "%.32s(%.32s)", ! _PyParser_TokenNames[lb->lb_type], ! lb->lb_str); return buf; } --- 50,55 ---- return _PyParser_TokenNames[lb->lb_type]; else { ! sprintf(buf, "%.32s(%.32s)", ! _PyParser_TokenNames[lb->lb_type], lb->lb_str); return buf; } From bwarsaw@users.sourceforge.net Wed Nov 28 21:35:51 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 28 Nov 2001 13:35:51 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python dynload_aix.c,2.10,2.11 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv26817 Modified Files: dynload_aix.c Log Message: aix_loaderror(): Conversion of sprintf() to PyOS_snprintf() for buffer overrun avoidance. Index: dynload_aix.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/dynload_aix.c,v retrieving revision 2.10 retrieving revision 2.11 diff -C2 -d -r2.10 -r2.11 *** dynload_aix.c 2000/09/04 00:54:56 2.10 --- dynload_aix.c 2001/11/28 21:35:49 2.11 *************** *** 147,151 **** #define ERRBUF_APPEND(s) strncat(errbuf, s, sizeof(errbuf)-strlen(errbuf)-1) ! sprintf(errbuf, "from module %.200s ", pathname); if (!loadquery(L_GETMESSAGES, &message[0], sizeof(message))) { --- 147,151 ---- #define ERRBUF_APPEND(s) strncat(errbuf, s, sizeof(errbuf)-strlen(errbuf)-1) ! PyOS_snprintf(errbuf, sizeof(errbuf), "from module %.200s ", pathname); if (!loadquery(L_GETMESSAGES, &message[0], sizeof(message))) { From bwarsaw@users.sourceforge.net Wed Nov 28 21:36:30 2001 From: bwarsaw@users.sourceforge.net (Barry Warsaw) Date: Wed, 28 Nov 2001 13:36:30 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python symtable.c,2.6,2.7 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv27015 Modified Files: symtable.c Log Message: ste_repr(): Conversion of sprintf() to PyOS_snprintf() for buffer overrun avoidance. Index: symtable.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/symtable.c,v retrieving revision 2.6 retrieving revision 2.7 diff -C2 -d -r2.6 -r2.7 *** symtable.c 2001/09/20 20:46:19 2.6 --- symtable.c 2001/11/28 21:36:28 2.7 *************** *** 86,93 **** char buf[256]; ! sprintf(buf, "", ! PyString_AS_STRING(ste->ste_name), ! PyInt_AS_LONG(ste->ste_id), ! ste->ste_lineno); return PyString_FromString(buf); } --- 86,94 ---- char buf[256]; ! PyOS_snprintf(buf, sizeof(buf), ! "", ! PyString_AS_STRING(ste->ste_name), ! PyInt_AS_LONG(ste->ste_id), ! ste->ste_lineno); return PyString_FromString(buf); } From jhylton@users.sourceforge.net Wed Nov 28 21:44:55 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 13:44:55 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python sysmodule.c,2.95,2.96 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv29617/Python Modified Files: sysmodule.c Log Message: Use PyOS_vsnprintf() and check its return value. If it returns -1 (which indicates overflow on old Linux platforms and perhaps on Windows) or size greater than buffer, write a message indicating that the previous message was truncated. Index: sysmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/sysmodule.c,v retrieving revision 2.95 retrieving revision 2.96 diff -C2 -d -r2.95 -r2.96 *** sysmodule.c 2001/11/09 20:59:39 2.95 --- sysmodule.c 2001/11/28 21:44:53 2.96 *************** *** 1024,1032 **** else { char buffer[1001]; ! if (vsprintf(buffer, format, va) >= sizeof(buffer)) ! Py_FatalError("PySys_WriteStdout/err: buffer overrun"); if (PyFile_WriteString(buffer, file) != 0) { PyErr_Clear(); fputs(buffer, fp); } } --- 1024,1039 ---- else { char buffer[1001]; ! int written = PyOS_vsnprintf(buffer, sizeof(buffer), ! format, va); if (PyFile_WriteString(buffer, file) != 0) { PyErr_Clear(); fputs(buffer, fp); + } + if (written == -1 || written > sizeof(buffer)) { + const char *truncated = "... truncated"; + if (PyFile_WriteString(truncated, file) != 0) { + PyErr_Clear(); + fputs(truncated, fp); + } } } From jhylton@users.sourceforge.net Wed Nov 28 21:47:01 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 13:47:01 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python getargs.c,2.86,2.87 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv30222/Python Modified Files: getargs.c Log Message: Use PyOS_snprintf() at some cost even though it was correct before. seterror() uses a char array and a pointer to the current position in that array. Use snprintf() and compute the amount of space left in the buffer based on the current pointer position. Index: getargs.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getargs.c,v retrieving revision 2.86 retrieving revision 2.87 diff -C2 -d -r2.86 -r2.87 *** getargs.c 2001/11/28 20:29:22 2.86 --- getargs.c 2001/11/28 21:46:59 2.87 *************** *** 225,239 **** return; else if (message == NULL) { - /* XXX snprintf */ if (fname != NULL) { ! sprintf(p, "%.200s() ", fname); p += strlen(p); } if (iarg != 0) { ! sprintf(p, "argument %d", iarg); i = 0; p += strlen(p); while (levels[i] > 0 && (int)(p-buf) < 220) { ! sprintf(p, ", item %d", levels[i]-1); p += strlen(p); i++; --- 225,240 ---- return; else if (message == NULL) { if (fname != NULL) { ! PyOS_snprintf(p, sizeof(buf), "%.200s() ", fname); p += strlen(p); } if (iarg != 0) { ! PyOS_snprintf(p, sizeof(buf) - (buf - p), ! "argument %d", iarg); i = 0; p += strlen(p); while (levels[i] > 0 && (int)(p-buf) < 220) { ! PyOS_snprintf(p, sizeof(buf) - (buf - p), ! ", item %d", levels[i]-1); p += strlen(p); i++; *************** *** 241,248 **** } else { ! sprintf(p, "argument"); p += strlen(p); } ! sprintf(p, " %.256s", msg); message = buf; } --- 242,249 ---- } else { ! PyOS_snprintf(p, sizeof(buf) - (buf - p), "argument"); p += strlen(p); } ! PyOS_snprintf(p, sizeof(buf) - (buf - p), " %.256s", msg); message = buf; } From jhylton@users.sourceforge.net Wed Nov 28 21:49:53 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 13:49:53 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules cPickle.c,2.70,2.71 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv31165 Modified Files: cPickle.c Log Message: Use PyOS_snprintf() instead of sprintf(). Index: cPickle.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/cPickle.c,v retrieving revision 2.70 retrieving revision 2.71 diff -C2 -d -r2.70 -r2.71 *** cPickle.c 2001/11/15 23:45:26 2.70 --- cPickle.c 2001/11/28 21:49:51 2.71 *************** *** 670,674 **** if (!self->bin) { s[0] = GET; ! sprintf(s + 1, "%ld\n", c_value); len = strlen(s); } --- 670,674 ---- if (!self->bin) { s[0] = GET; ! PyOS_snprintf(s + 1, sizeof(s) - 1, "%ld\n", c_value); len = strlen(s); } *************** *** 745,749 **** if (!self->bin) { c_str[0] = PUT; ! sprintf(c_str + 1, "%d\n", p); len = strlen(c_str); } --- 745,749 ---- if (!self->bin) { c_str[0] = PUT; ! PyOS_snprintf(c_str + 1, sizeof(c_str) - 1, "%d\n", p); len = strlen(c_str); } *************** *** 959,963 **** */ c_str[0] = INT; ! sprintf(c_str + 1, "%ld\n", l); if ((*self->write_func)(self, c_str, strlen(c_str)) < 0) return -1; --- 959,963 ---- */ c_str[0] = INT; ! PyOS_snprintf(c_str + 1, sizeof(c_str) - 1, "%ld\n", l); if ((*self->write_func)(self, c_str, strlen(c_str)) < 0) return -1; *************** *** 1122,1126 **** char c_str[250]; c_str[0] = FLOAT; ! sprintf(c_str + 1, "%.17g\n", x); if ((*self->write_func)(self, c_str, strlen(c_str)) < 0) --- 1122,1126 ---- char c_str[250]; c_str[0] = FLOAT; ! PyOS_snprintf(c_str + 1, sizeof(c_str) - 1, "%.17g\n", x); if ((*self->write_func)(self, c_str, strlen(c_str)) < 0) From tim_one@users.sourceforge.net Wed Nov 28 22:07:32 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 28 Nov 2001 14:07:32 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python thread_beos.h,2.7,2.8 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv4133/python/Python Modified Files: thread_beos.h Log Message: More sprintf -> PyOS_snprintf. Index: thread_beos.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/thread_beos.h,v retrieving revision 2.7 retrieving revision 2.8 diff -C2 -d -r2.7 -r2.8 *** thread_beos.h 2001/10/16 21:13:49 2.7 --- thread_beos.h 2001/11/28 22:07:30 2.8 *************** *** 124,128 **** /* We are so very thread-safe... */ this_thread = atomic_add( &thread_count, 1 ); ! sprintf( name, "python thread (%d)", this_thread ); tid = spawn_thread( (thread_func)func, name, --- 124,129 ---- /* We are so very thread-safe... */ this_thread = atomic_add( &thread_count, 1 ); ! PyOS_snprintf(name, sizeof(name), ! "python thread (%d)", this_thread ); tid = spawn_thread( (thread_func)func, name, *************** *** 223,227 **** this_lock = atomic_add( &lock_count, 1 ); ! sprintf( name, "python lock (%d)", this_lock ); retval = benaphore_create( name, lock ); --- 224,228 ---- this_lock = atomic_add( &lock_count, 1 ); ! PyOS_snprintf(name, sizeof(name), "python lock (%d)", this_lock); retval = benaphore_create( name, lock ); From tim_one@users.sourceforge.net Wed Nov 28 22:07:33 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 28 Nov 2001 14:07:33 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules almodule.c,1.33,1.34 posixmodule.c,2.211,2.212 socketmodule.c,1.198,1.199 stropmodule.c,2.83,2.84 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv4133/python/Modules Modified Files: almodule.c posixmodule.c socketmodule.c stropmodule.c Log Message: More sprintf -> PyOS_snprintf. Index: almodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/almodule.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** almodule.c 2001/11/03 10:48:43 1.33 --- almodule.c 2001/11/28 22:07:30 1.34 *************** *** 1520,1524 **** if (pvs[i].sizeOut < 0) { char buf[32]; ! sprintf(buf, "problem with param %d", i); PyErr_SetString(ErrorObject, buf); goto error; --- 1520,1525 ---- if (pvs[i].sizeOut < 0) { char buf[32]; ! PyOS_snprintf(buf, sizeof(buf), ! "problem with param %d", i); PyErr_SetString(ErrorObject, buf); goto error; Index: posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.211 retrieving revision 2.212 diff -C2 -d -r2.211 -r2.212 *** posixmodule.c 2001/11/28 20:32:57 2.211 --- posixmodule.c 2001/11/28 22:07:30 2.212 *************** *** 2556,2560 **** s2 = (char *)_alloca(x); ZeroMemory(s2, x); ! sprintf(s2, "%s%s%s", s1, s3, cmdstring); } else { --- 2556,2560 ---- s2 = (char *)_alloca(x); ZeroMemory(s2, x); ! PyOS_snprintf(s2, x, "%s%s%s", s1, s3, cmdstring); } else { *************** *** 2609,2614 **** s2 = (char *)_alloca(x); ZeroMemory(s2, x); ! sprintf( ! s2, "%s \"%s%s%s\"", modulepath, --- 2609,2614 ---- s2 = (char *)_alloca(x); ZeroMemory(s2, x); ! PyOS_snprintf( ! s2, x, "%s \"%s%s%s\"", modulepath, Index: socketmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v retrieving revision 1.198 retrieving revision 1.199 diff -C2 -d -r1.198 -r1.199 *** socketmodule.c 2001/11/28 20:27:42 1.198 --- socketmodule.c 2001/11/28 22:07:30 1.199 *************** *** 3090,3094 **** } ! sprintf(reason, "OS/2 TCP/IP Error# %d", sock_errno()); PyErr_SetString(PyExc_ImportError, reason); --- 3090,3095 ---- } ! PyOS_snprintf(reason, sizeof(reason), ! "OS/2 TCP/IP Error# %d", sock_errno()); PyErr_SetString(PyExc_ImportError, reason); Index: stropmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/stropmodule.c,v retrieving revision 2.83 retrieving revision 2.84 diff -C2 -d -r2.83 -r2.84 *** stropmodule.c 2001/11/28 20:27:42 2.83 --- stropmodule.c 2001/11/28 22:07:30 2.84 *************** *** 779,783 **** } else if (errno != 0) { ! sprintf(buffer, "atoi() literal too large: %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; --- 779,784 ---- } else if (errno != 0) { ! PyOS_snprintf(buffer, sizeof(buffer), ! "atoi() literal too large: %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); return NULL; *************** *** 829,833 **** end++; if (*end != '\0') { ! sprintf(buffer, "invalid literal for atol(): %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); Py_DECREF(x); --- 830,835 ---- end++; if (*end != '\0') { ! PyOS_snprintf(buffer, sizeof(buffer), ! "invalid literal for atol(): %.200s", s); PyErr_SetString(PyExc_ValueError, buffer); Py_DECREF(x); From tim_one@users.sourceforge.net Wed Nov 28 22:13:27 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 28 Nov 2001 14:13:27 -0800 Subject: [Python-checkins] CVS: python/dist/src/Include fileobject.h,2.24,2.25 Message-ID: Update of /cvsroot/python/python/dist/src/Include In directory usw-pr-cvs1:/tmp/cvs-serv5668/python/Include Modified Files: fileobject.h Log Message: PyFile_WriteString(): change prototype so that the string arg is const char* instead of char*. The change is conceptually correct, and indirectly fixes a compiler wng introduced when somebody else innocently passed a const char* to this function. Index: fileobject.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Include/fileobject.h,v retrieving revision 2.24 retrieving revision 2.25 diff -C2 -d -r2.24 -r2.25 *** fileobject.h 2001/09/13 05:38:55 2.24 --- fileobject.h 2001/11/28 22:13:25 2.25 *************** *** 22,26 **** extern DL_IMPORT(int) PyFile_WriteObject(PyObject *, PyObject *, int); extern DL_IMPORT(int) PyFile_SoftSpace(PyObject *, int); ! extern DL_IMPORT(int) PyFile_WriteString(char *, PyObject *); extern DL_IMPORT(int) PyObject_AsFileDescriptor(PyObject *); --- 22,26 ---- extern DL_IMPORT(int) PyFile_WriteObject(PyObject *, PyObject *, int); extern DL_IMPORT(int) PyFile_SoftSpace(PyObject *, int); ! extern DL_IMPORT(int) PyFile_WriteString(const char *, PyObject *); extern DL_IMPORT(int) PyObject_AsFileDescriptor(PyObject *); From tim_one@users.sourceforge.net Wed Nov 28 22:13:27 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 28 Nov 2001 14:13:27 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects fileobject.c,2.139,2.140 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv5668/python/Objects Modified Files: fileobject.c Log Message: PyFile_WriteString(): change prototype so that the string arg is const char* instead of char*. The change is conceptually correct, and indirectly fixes a compiler wng introduced when somebody else innocently passed a const char* to this function. Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.139 retrieving revision 2.140 diff -C2 -d -r2.139 -r2.140 *** fileobject.c 2001/11/09 20:59:14 2.139 --- fileobject.c 2001/11/28 22:13:25 2.140 *************** *** 1635,1639 **** int ! PyFile_WriteString(char *s, PyObject *f) { if (f == NULL) { --- 1635,1639 ---- int ! PyFile_WriteString(const char *s, PyObject *f) { if (f == NULL) { From jhylton@users.sourceforge.net Wed Nov 28 22:14:39 2001 From: jhylton@users.sourceforge.net (Jeremy Hylton) Date: Wed, 28 Nov 2001 14:14:39 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python getargs.c,2.87,2.88 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv6765 Modified Files: getargs.c Log Message: Two screwups fixed for sizeof(char *) instead of sizeof(char []). Also change all the helper functions to pass along the size of the msgbuf and use PyOS_snprintf() when writing into the buffer. Index: getargs.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getargs.c,v retrieving revision 2.87 retrieving revision 2.88 diff -C2 -d -r2.87 -r2.88 *** getargs.c 2001/11/28 21:46:59 2.87 --- getargs.c 2001/11/28 22:14:37 2.88 *************** *** 17,24 **** static int vgetargs1(PyObject *, char *, va_list *, int); static void seterror(int, char *, int *, char *, char *); ! static char *convertitem(PyObject *, char **, va_list *, int *, char *); static char *converttuple(PyObject *, char **, va_list *, ! int *, char *, int); ! static char *convertsimple(PyObject *, char **, va_list *, char *); static int convertbuffer(PyObject *, void **p, char **); --- 17,25 ---- static int vgetargs1(PyObject *, char *, va_list *, int); static void seterror(int, char *, int *, char *, char *); ! static char *convertitem(PyObject *, char **, va_list *, int *, char *, ! size_t); static char *converttuple(PyObject *, char **, va_list *, ! int *, char *, size_t, int); ! static char *convertsimple(PyObject *, char **, va_list *, char *, size_t); static int convertbuffer(PyObject *, void **p, char **); *************** *** 152,156 **** return 0; } ! msg = convertitem(args, &format, p_va, levels, msgbuf); if (msg == NULL) return 1; --- 153,158 ---- return 0; } ! msg = convertitem(args, &format, p_va, levels, msgbuf, ! sizeof(msgbuf)); if (msg == NULL) return 1; *************** *** 195,199 **** format++; msg = convertitem(PyTuple_GET_ITEM(args, i), &format, p_va, ! levels, msgbuf); if (msg) { seterror(i+1, msg, levels, fname, message); --- 197,201 ---- format++; msg = convertitem(PyTuple_GET_ITEM(args, i), &format, p_va, ! levels, msgbuf, sizeof(msgbuf)); if (msg) { seterror(i+1, msg, levels, fname, message); *************** *** 272,276 **** static char * converttuple(PyObject *arg, char **p_format, va_list *p_va, int *levels, ! char *msgbuf, int toplevel) { int level = 0; --- 274,278 ---- static char * converttuple(PyObject *arg, char **p_format, va_list *p_va, int *levels, ! char *msgbuf, size_t bufsize, int toplevel) { int level = 0; *************** *** 299,303 **** if (!PySequence_Check(arg) || PyString_Check(arg)) { levels[0] = 0; ! PyOS_snprintf(msgbuf, sizeof(msgbuf), toplevel ? "expected %d arguments, not %.50s" : "must be %d-item sequence, not %.50s", --- 301,305 ---- if (!PySequence_Check(arg) || PyString_Check(arg)) { levels[0] = 0; ! PyOS_snprintf(msgbuf, bufsize, toplevel ? "expected %d arguments, not %.50s" : "must be %d-item sequence, not %.50s", *************** *** 309,313 **** if ((i = PySequence_Size(arg)) != n) { levels[0] = 0; ! PyOS_snprintf(msgbuf, sizeof(msgbuf), toplevel ? "expected %d arguments, not %d" : "must be sequence of length %d, not %d", --- 311,315 ---- if ((i = PySequence_Size(arg)) != n) { levels[0] = 0; ! PyOS_snprintf(msgbuf, bufsize, toplevel ? "expected %d arguments, not %d" : "must be sequence of length %d, not %d", *************** *** 321,325 **** PyObject *item; item = PySequence_GetItem(arg, i); ! msg = convertitem(item, &format, p_va, levels+1, msgbuf); /* PySequence_GetItem calls tp->sq_item, which INCREFs */ Py_XDECREF(item); --- 323,328 ---- PyObject *item; item = PySequence_GetItem(arg, i); ! msg = convertitem(item, &format, p_va, levels+1, msgbuf, ! bufsize); /* PySequence_GetItem calls tp->sq_item, which INCREFs */ Py_XDECREF(item); *************** *** 339,343 **** static char * convertitem(PyObject *arg, char **p_format, va_list *p_va, int *levels, ! char *msgbuf) { char *msg; --- 342,346 ---- static char * convertitem(PyObject *arg, char **p_format, va_list *p_va, int *levels, ! char *msgbuf, size_t bufsize) { char *msg; *************** *** 346,355 **** if (*format == '(' /* ')' */) { format++; ! msg = converttuple(arg, &format, p_va, levels, msgbuf, 0); if (msg == NULL) format++; } else { ! msg = convertsimple(arg, &format, p_va, msgbuf); if (msg != NULL) levels[0] = 0; --- 349,359 ---- if (*format == '(' /* ')' */) { format++; ! msg = converttuple(arg, &format, p_va, levels, msgbuf, ! bufsize, 0); if (msg == NULL) format++; } else { ! msg = convertsimple(arg, &format, p_va, msgbuf, bufsize); if (msg != NULL) levels[0] = 0; *************** *** 368,379 **** static char * ! converterr(char *expected, PyObject *arg, char *msgbuf) { assert(expected != NULL); assert(arg != NULL); ! /* XXX use snprintf? */ ! sprintf(msgbuf, ! "must be %.50s, not %.50s", expected, ! arg == Py_None ? "None" : arg->ob_type->tp_name); return msgbuf; } --- 372,382 ---- static char * ! converterr(char *expected, PyObject *arg, char *msgbuf, size_t bufsize) { assert(expected != NULL); assert(arg != NULL); ! PyOS_snprintf(msgbuf, bufsize, ! "must be %.50s, not %.50s", expected, ! arg == Py_None ? "None" : arg->ob_type->tp_name); return msgbuf; } *************** *** 389,393 **** static char * ! convertsimple(PyObject *arg, char **p_format, va_list *p_va, char *msgbuf) { char *format = *p_format; --- 392,397 ---- static char * ! convertsimple(PyObject *arg, char **p_format, va_list *p_va, char *msgbuf, ! size_t bufsize) { char *format = *p_format; *************** *** 401,414 **** long ival = PyInt_AsLong(arg); if (ival == -1 && PyErr_Occurred()) ! return converterr("integer", arg, msgbuf); else if (ival < 0) { PyErr_SetString(PyExc_OverflowError, "unsigned byte integer is less than minimum"); ! return converterr("integer", arg, msgbuf); } else if (ival > UCHAR_MAX) { PyErr_SetString(PyExc_OverflowError, "unsigned byte integer is greater than maximum"); ! return converterr("integer", arg, msgbuf); } else --- 405,418 ---- long ival = PyInt_AsLong(arg); if (ival == -1 && PyErr_Occurred()) ! return converterr("integer", arg, msgbuf, bufsize); else if (ival < 0) { PyErr_SetString(PyExc_OverflowError, "unsigned byte integer is less than minimum"); ! return converterr("integer", arg, msgbuf, bufsize); } else if (ival > UCHAR_MAX) { PyErr_SetString(PyExc_OverflowError, "unsigned byte integer is greater than maximum"); ! return converterr("integer", arg, msgbuf, bufsize); } else *************** *** 422,435 **** long ival = PyInt_AsLong(arg); if (ival == -1 && PyErr_Occurred()) ! return converterr("integer", arg, msgbuf); else if (ival < SCHAR_MIN) { PyErr_SetString(PyExc_OverflowError, "byte-sized integer bitfield is less than minimum"); ! return converterr("integer", arg, msgbuf); } else if (ival > (int)UCHAR_MAX) { PyErr_SetString(PyExc_OverflowError, "byte-sized integer bitfield is greater than maximum"); ! return converterr("integer", arg, msgbuf); } else --- 426,439 ---- long ival = PyInt_AsLong(arg); if (ival == -1 && PyErr_Occurred()) ! return converterr("integer", arg, msgbuf, bufsize); else if (ival < SCHAR_MIN) { PyErr_SetString(PyExc_OverflowError, "byte-sized integer bitfield is less than minimum"); ! return converterr("integer", arg, msgbuf, bufsize); } else if (ival > (int)UCHAR_MAX) { PyErr_SetString(PyExc_OverflowError, "byte-sized integer bitfield is greater than maximum"); ! return converterr("integer", arg, msgbuf, bufsize); } else *************** *** 442,455 **** long ival = PyInt_AsLong(arg); if (ival == -1 && PyErr_Occurred()) ! return converterr("integer", arg, msgbuf); else if (ival < SHRT_MIN) { PyErr_SetString(PyExc_OverflowError, "signed short integer is less than minimum"); ! return converterr("integer", arg, msgbuf); } else if (ival > SHRT_MAX) { PyErr_SetString(PyExc_OverflowError, "signed short integer is greater than maximum"); ! return converterr("integer", arg, msgbuf); } else --- 446,459 ---- long ival = PyInt_AsLong(arg); if (ival == -1 && PyErr_Occurred()) ! return converterr("integer", arg, msgbuf, bufsize); else if (ival < SHRT_MIN) { PyErr_SetString(PyExc_OverflowError, "signed short integer is less than minimum"); ! return converterr("integer", arg, msgbuf, bufsize); } else if (ival > SHRT_MAX) { PyErr_SetString(PyExc_OverflowError, "signed short integer is greater than maximum"); ! return converterr("integer", arg, msgbuf, bufsize); } else *************** *** 463,476 **** long ival = PyInt_AsLong(arg); if (ival == -1 && PyErr_Occurred()) ! return converterr("integer", arg, msgbuf); else if (ival < SHRT_MIN) { PyErr_SetString(PyExc_OverflowError, "short integer bitfield is less than minimum"); ! return converterr("integer", arg, msgbuf); } else if (ival > USHRT_MAX) { PyErr_SetString(PyExc_OverflowError, "short integer bitfield is greater than maximum"); ! return converterr("integer", arg, msgbuf); } else --- 467,480 ---- long ival = PyInt_AsLong(arg); if (ival == -1 && PyErr_Occurred()) ! return converterr("integer", arg, msgbuf, bufsize); else if (ival < SHRT_MIN) { PyErr_SetString(PyExc_OverflowError, "short integer bitfield is less than minimum"); ! return converterr("integer", arg, msgbuf, bufsize); } else if (ival > USHRT_MAX) { PyErr_SetString(PyExc_OverflowError, "short integer bitfield is greater than maximum"); ! return converterr("integer", arg, msgbuf, bufsize); } else *************** *** 483,496 **** long ival = PyInt_AsLong(arg); if (ival == -1 && PyErr_Occurred()) ! return converterr("integer", arg, msgbuf); else if (ival > INT_MAX) { PyErr_SetString(PyExc_OverflowError, "signed integer is greater than maximum"); ! return converterr("integer", arg, msgbuf); } else if (ival < INT_MIN) { PyErr_SetString(PyExc_OverflowError, "signed integer is less than minimum"); ! return converterr("integer", arg, msgbuf); } else --- 487,500 ---- long ival = PyInt_AsLong(arg); if (ival == -1 && PyErr_Occurred()) ! return converterr("integer", arg, msgbuf, bufsize); else if (ival > INT_MAX) { PyErr_SetString(PyExc_OverflowError, "signed integer is greater than maximum"); ! return converterr("integer", arg, msgbuf, bufsize); } else if (ival < INT_MIN) { PyErr_SetString(PyExc_OverflowError, "signed integer is less than minimum"); ! return converterr("integer", arg, msgbuf, bufsize); } else *************** *** 503,507 **** long ival = PyInt_AsLong(arg); if (ival == -1 && PyErr_Occurred()) ! return converterr("integer", arg, msgbuf); else *p = ival; --- 507,511 ---- long ival = PyInt_AsLong(arg); if (ival == -1 && PyErr_Occurred()) ! return converterr("integer", arg, msgbuf, bufsize); else *p = ival; *************** *** 514,518 **** LONG_LONG ival = PyLong_AsLongLong( arg ); if( ival == (LONG_LONG)-1 && PyErr_Occurred() ) { ! return converterr("long", arg, msgbuf); } else { *p = ival; --- 518,522 ---- LONG_LONG ival = PyLong_AsLongLong( arg ); if( ival == (LONG_LONG)-1 && PyErr_Occurred() ) { ! return converterr("long", arg, msgbuf, bufsize); } else { *p = ival; *************** *** 526,530 **** double dval = PyFloat_AsDouble(arg); if (PyErr_Occurred()) ! return converterr("float", arg, msgbuf); else *p = (float) dval; --- 530,534 ---- double dval = PyFloat_AsDouble(arg); if (PyErr_Occurred()) ! return converterr("float", arg, msgbuf, bufsize); else *p = (float) dval; *************** *** 536,540 **** double dval = PyFloat_AsDouble(arg); if (PyErr_Occurred()) ! return converterr("float", arg, msgbuf); else *p = dval; --- 540,544 ---- double dval = PyFloat_AsDouble(arg); if (PyErr_Occurred()) ! return converterr("float", arg, msgbuf, bufsize); else *p = dval; *************** *** 548,552 **** cval = PyComplex_AsCComplex(arg); if (PyErr_Occurred()) ! return converterr("complex", arg, msgbuf); else *p = cval; --- 552,556 ---- cval = PyComplex_AsCComplex(arg); if (PyErr_Occurred()) ! return converterr("complex", arg, msgbuf, bufsize); else *p = cval; *************** *** 560,564 **** *p = PyString_AS_STRING(arg)[0]; else ! return converterr("char", arg, msgbuf); break; } --- 564,568 ---- *p = PyString_AS_STRING(arg)[0]; else ! return converterr("char", arg, msgbuf, bufsize); break; } *************** *** 578,582 **** if (uarg == NULL) return converterr(CONV_UNICODE, ! arg, msgbuf); *p = PyString_AS_STRING(uarg); *q = PyString_GET_SIZE(uarg); --- 582,586 ---- if (uarg == NULL) return converterr(CONV_UNICODE, ! arg, msgbuf, bufsize); *p = PyString_AS_STRING(uarg); *q = PyString_GET_SIZE(uarg); *************** *** 587,591 **** int count = convertbuffer(arg, p, &buf); if (count < 0) ! return converterr(buf, arg, msgbuf); *q = count; } --- 591,595 ---- int count = convertbuffer(arg, p, &buf); if (count < 0) ! return converterr(buf, arg, msgbuf, bufsize); *q = count; } *************** *** 601,613 **** if (uarg == NULL) return converterr(CONV_UNICODE, ! arg, msgbuf); *p = PyString_AS_STRING(uarg); } #endif else ! return converterr("string", arg, msgbuf); if ((int)strlen(*p) != PyString_Size(arg)) return converterr("string without null bytes", ! arg, msgbuf); } break; --- 605,617 ---- if (uarg == NULL) return converterr(CONV_UNICODE, ! arg, msgbuf, bufsize); *p = PyString_AS_STRING(uarg); } #endif else ! return converterr("string", arg, msgbuf, bufsize); if ((int)strlen(*p) != PyString_Size(arg)) return converterr("string without null bytes", ! arg, msgbuf, bufsize); } break; *************** *** 632,636 **** if (uarg == NULL) return converterr(CONV_UNICODE, ! arg, msgbuf); *p = PyString_AS_STRING(uarg); *q = PyString_GET_SIZE(uarg); --- 636,640 ---- if (uarg == NULL) return converterr(CONV_UNICODE, ! arg, msgbuf, bufsize); *p = PyString_AS_STRING(uarg); *q = PyString_GET_SIZE(uarg); *************** *** 641,645 **** int count = convertbuffer(arg, p, &buf); if (count < 0) ! return converterr(buf, arg, msgbuf); *q = count; } --- 645,649 ---- int count = convertbuffer(arg, p, &buf); if (count < 0) ! return converterr(buf, arg, msgbuf, bufsize); *q = count; } *************** *** 657,661 **** if (uarg == NULL) return converterr(CONV_UNICODE, ! arg, msgbuf); *p = PyString_AS_STRING(uarg); } --- 661,665 ---- if (uarg == NULL) return converterr(CONV_UNICODE, ! arg, msgbuf, bufsize); *p = PyString_AS_STRING(uarg); } *************** *** 663,667 **** else return converterr("string or None", ! arg, msgbuf); if (*format == '#') { int *q = va_arg(*p_va, int *); --- 667,671 ---- else return converterr("string or None", ! arg, msgbuf, bufsize); if (*format == '#') { int *q = va_arg(*p_va, int *); *************** *** 676,680 **** return converterr( "string without null bytes or None", ! arg, msgbuf); } break; --- 680,684 ---- return converterr( "string without null bytes or None", ! arg, msgbuf, bufsize); } break; *************** *** 705,714 **** return converterr( "(unknown parser marker combination)", ! arg, msgbuf); buffer = (char **)va_arg(*p_va, char **); format++; if (buffer == NULL) return converterr("(buffer is NULL)", ! arg, msgbuf); /* Encode object */ --- 709,718 ---- return converterr( "(unknown parser marker combination)", ! arg, msgbuf, bufsize); buffer = (char **)va_arg(*p_va, char **); format++; if (buffer == NULL) return converterr("(buffer is NULL)", ! arg, msgbuf, bufsize); /* Encode object */ *************** *** 726,730 **** return converterr( "string or unicode or text buffer", ! arg, msgbuf); /* Encode object; use default error handling */ --- 730,734 ---- return converterr( "string or unicode or text buffer", ! arg, msgbuf, bufsize); /* Encode object; use default error handling */ *************** *** 735,747 **** if (s == NULL) return converterr("(encoding failed)", ! arg, msgbuf); if (!PyString_Check(s)) { Py_DECREF(s); return converterr( "(encoder failed to return a string)", ! arg, msgbuf); } #else ! return converterr("string", arg, msgbuf); #endif } --- 739,751 ---- if (s == NULL) return converterr("(encoding failed)", ! arg, msgbuf, bufsize); if (!PyString_Check(s)) { Py_DECREF(s); return converterr( "(encoder failed to return a string)", ! arg, msgbuf, bufsize); } #else ! return converterr("string", arg, msgbuf, bufsize); #endif } *************** *** 777,781 **** return converterr( "(buffer_len is NULL)", ! arg, msgbuf); if (*buffer == NULL) { *buffer = PyMem_NEW(char, size + 1); --- 781,785 ---- return converterr( "(buffer_len is NULL)", ! arg, msgbuf, bufsize); if (*buffer == NULL) { *buffer = PyMem_NEW(char, size + 1); *************** *** 784,788 **** return converterr( "(memory error)", ! arg, msgbuf); } } else { --- 788,792 ---- return converterr( "(memory error)", ! arg, msgbuf, bufsize); } } else { *************** *** 791,795 **** return converterr( "(buffer overflow)", ! arg, msgbuf); } } --- 795,799 ---- return converterr( "(buffer overflow)", ! arg, msgbuf, bufsize); } } *************** *** 815,824 **** return converterr( "(encoded string without NULL bytes)", ! arg, msgbuf); *buffer = PyMem_NEW(char, size + 1); if (*buffer == NULL) { Py_DECREF(s); return converterr("(memory error)", ! arg, msgbuf); } memcpy(*buffer, --- 819,828 ---- return converterr( "(encoded string without NULL bytes)", ! arg, msgbuf, bufsize); *buffer = PyMem_NEW(char, size + 1); if (*buffer == NULL) { Py_DECREF(s); return converterr("(memory error)", ! arg, msgbuf, bufsize); } memcpy(*buffer, *************** *** 839,843 **** if (count < 0) ! return converterr(buf, arg, msgbuf); *q = count/(sizeof(Py_UNICODE)); format++; --- 843,847 ---- if (count < 0) ! return converterr(buf, arg, msgbuf, bufsize); *q = count/(sizeof(Py_UNICODE)); format++; *************** *** 848,852 **** *p = PyUnicode_AS_UNICODE(arg); else ! return converterr("unicode", arg, msgbuf); } break; --- 852,856 ---- *p = PyUnicode_AS_UNICODE(arg); else ! return converterr("unicode", arg, msgbuf, bufsize); } break; *************** *** 859,863 **** *p = arg; else ! return converterr("string", arg, msgbuf); break; } --- 863,867 ---- *p = arg; else ! return converterr("string", arg, msgbuf, bufsize); break; } *************** *** 869,873 **** *p = arg; else ! return converterr("unicode", arg, msgbuf); break; } --- 873,877 ---- *p = arg; else ! return converterr("unicode", arg, msgbuf, bufsize); break; } *************** *** 884,888 **** *p = arg; else ! return converterr(type->tp_name, arg, msgbuf); } --- 888,892 ---- *p = arg; else ! return converterr(type->tp_name, arg, msgbuf, bufsize); } *************** *** 895,899 **** else return converterr("(unspecified)", ! arg, msgbuf); } --- 899,903 ---- else return converterr("(unspecified)", ! arg, msgbuf, bufsize); } *************** *** 905,909 **** if (! (*convert)(arg, addr)) return converterr("(unspecified)", ! arg, msgbuf); } else { --- 909,913 ---- if (! (*convert)(arg, addr)) return converterr("(unspecified)", ! arg, msgbuf, bufsize); } else { *************** *** 923,932 **** pb->bf_getwritebuffer == NULL || pb->bf_getsegcount == NULL) ! return converterr("read-write buffer", arg, msgbuf); if ((*pb->bf_getsegcount)(arg, NULL) != 1) return converterr("single-segment read-write buffer", ! arg, msgbuf); if ((count = pb->bf_getwritebuffer(arg, 0, p)) < 0) ! return converterr("(unspecified)", arg, msgbuf); if (*format == '#') { int *q = va_arg(*p_va, int *); --- 927,936 ---- pb->bf_getwritebuffer == NULL || pb->bf_getsegcount == NULL) ! return converterr("read-write buffer", arg, msgbuf, bufsize); if ((*pb->bf_getsegcount)(arg, NULL) != 1) return converterr("single-segment read-write buffer", ! arg, msgbuf, bufsize); if ((count = pb->bf_getwritebuffer(arg, 0, p)) < 0) ! return converterr("(unspecified)", arg, msgbuf, bufsize); if (*format == '#') { int *q = va_arg(*p_va, int *); *************** *** 946,950 **** return converterr( "invalid use of 't' format character", ! arg, msgbuf); if (!PyType_HasFeature(arg->ob_type, Py_TPFLAGS_HAVE_GETCHARBUFFER) || --- 950,954 ---- return converterr( "invalid use of 't' format character", ! arg, msgbuf, bufsize); if (!PyType_HasFeature(arg->ob_type, Py_TPFLAGS_HAVE_GETCHARBUFFER) || *************** *** 953,966 **** return converterr( "string or read-only character buffer", ! arg, msgbuf); if (pb->bf_getsegcount(arg, NULL) != 1) return converterr( "string or single-segment read-only buffer", ! arg, msgbuf); count = pb->bf_getcharbuffer(arg, 0, p); if (count < 0) ! return converterr("(unspecified)", arg, msgbuf); *va_arg(*p_va, int *) = count; break; --- 957,970 ---- return converterr( "string or read-only character buffer", ! arg, msgbuf, bufsize); if (pb->bf_getsegcount(arg, NULL) != 1) return converterr( "string or single-segment read-only buffer", ! arg, msgbuf, bufsize); count = pb->bf_getcharbuffer(arg, 0, p); if (count < 0) ! return converterr("(unspecified)", arg, msgbuf, bufsize); *va_arg(*p_va, int *) = count; break; *************** *** 968,972 **** default: ! return converterr("impossible", arg, msgbuf); } --- 972,976 ---- default: ! return converterr("impossible", arg, msgbuf, bufsize); } *************** *** 1158,1162 **** format++; msg = convertitem(PyTuple_GET_ITEM(args, i), &format, p_va, ! levels, msgbuf); if (msg) { seterror(i+1, msg, levels, fname, message); --- 1162,1166 ---- format++; msg = convertitem(PyTuple_GET_ITEM(args, i), &format, p_va, ! levels, msgbuf, sizeof(msgbuf)); if (msg) { seterror(i+1, msg, levels, fname, message); *************** *** 1178,1182 **** if (item != NULL) { Py_INCREF(item); ! msg = convertitem(item, &format, p_va, levels, msgbuf); Py_DECREF(item); if (msg) { --- 1182,1187 ---- if (item != NULL) { Py_INCREF(item); ! msg = convertitem(item, &format, p_va, levels, msgbuf, ! sizeof(msgbuf)); Py_DECREF(item); if (msg) { From tim_one@users.sourceforge.net Wed Nov 28 22:43:47 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 28 Nov 2001 14:43:47 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects floatobject.c,2.107,2.108 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv15756/python/Objects Modified Files: floatobject.c Log Message: PyFloat_AsStringEx(): This function takes an output char* but doesn't pass the buffer length. Stop using it. It should be deprecated, but too late in the release cycle to do that now. New static format_float() does the same thing but requires passing the buffer length too. Use it instead. Index: floatobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/floatobject.c,v retrieving revision 2.107 retrieving revision 2.108 diff -C2 -d -r2.107 -r2.108 *** floatobject.c 2001/11/28 20:52:21 2.107 --- floatobject.c 2001/11/28 22:43:45 2.108 *************** *** 226,231 **** /* Methods */ ! void ! PyFloat_AsStringEx(char *buf, PyFloatObject *v, int precision) { register char *cp; --- 226,231 ---- /* Methods */ ! static void ! format_float(char *buf, size_t buflen, PyFloatObject *v, int precision) { register char *cp; *************** *** 235,239 **** However, %g may print the number as an integer; in such cases, we append ".0" to the string. */ ! sprintf(buf, "%.*g", precision, v->ob_fval); cp = buf; if (*cp == '-') --- 235,241 ---- However, %g may print the number as an integer; in such cases, we append ".0" to the string. */ ! ! assert(PyFloat_Check(v)); ! PyOS_snprintf(buf, buflen, "%.*g", precision, v->ob_fval); cp = buf; if (*cp == '-') *************** *** 252,255 **** --- 254,267 ---- } + /* XXX PyFloat_AsStringEx should not be a public API function (for one + XXX thing, its signature passes a buffer without a length; for another, + XXX it isn't useful outside this file). + */ + void + PyFloat_AsStringEx(char *buf, PyFloatObject *v, int precision) + { + format_float(buf, 100, v, precision); + } + /* Macro and helper that convert PyObject obj to a C double and store the value in dbl; this replaces the functionality of the coercion *************** *** 302,309 **** #define PREC_STR 12 void PyFloat_AsString(char *buf, PyFloatObject *v) { ! PyFloat_AsStringEx(buf, v, PREC_STR); } --- 314,324 ---- #define PREC_STR 12 + /* XXX PyFloat_AsString and PyFloat_AsReprString should be deprecated: + XXX they pass a char buffer without passing a length. + */ void PyFloat_AsString(char *buf, PyFloatObject *v) { ! format_float(buf, 100, v, PREC_STR); } *************** *** 311,315 **** PyFloat_AsReprString(char *buf, PyFloatObject *v) { ! PyFloat_AsStringEx(buf, v, PREC_REPR); } --- 326,330 ---- PyFloat_AsReprString(char *buf, PyFloatObject *v) { ! format_float(buf, 100, v, PREC_REPR); } *************** *** 319,323 **** { char buf[100]; ! PyFloat_AsStringEx(buf, v, flags&Py_PRINT_RAW ? PREC_STR : PREC_REPR); fputs(buf, fp); return 0; --- 334,339 ---- { char buf[100]; ! format_float(buf, sizeof(buf), v, ! (flags & Py_PRINT_RAW) ? PREC_STR : PREC_REPR); fputs(buf, fp); return 0; *************** *** 328,332 **** { char buf[100]; ! PyFloat_AsStringEx(buf, v, PREC_REPR); return PyString_FromString(buf); } --- 344,348 ---- { char buf[100]; ! format_float(buf, sizeof(buf), v, PREC_REPR); return PyString_FromString(buf); } *************** *** 336,340 **** { char buf[100]; ! PyFloat_AsStringEx(buf, v, PREC_STR); return PyString_FromString(buf); } --- 352,356 ---- { char buf[100]; ! format_float(buf, sizeof(buf), v, PREC_STR); return PyString_FromString(buf); } From tim_one@users.sourceforge.net Wed Nov 28 23:16:43 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 28 Nov 2001 15:16:43 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib zipfile.py,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv25761/python/Lib Modified Files: zipfile.py Log Message: SF bug 486480: zipfile __del__ is broken ZipFile.__del__(): call ZipFile.close(), like its docstring says it does. ZipFile.close(): allow calling more than once (as all file-like objects in Python should support). Index: zipfile.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/zipfile.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** zipfile.py 2001/09/21 19:21:45 1.18 --- zipfile.py 2001/11/28 23:16:40 1.19 *************** *** 455,465 **** def __del__(self): """Call the "close()" method in case the user forgot.""" ! if self.fp and not self._filePassed: ! self.fp.close() ! self.fp = None def close(self): """Close the file, and for mode "w" and "a" write the ending records.""" if self.mode in ("w", "a"): # write ending records count = 0 --- 455,465 ---- def __del__(self): """Call the "close()" method in case the user forgot.""" ! self.close() def close(self): """Close the file, and for mode "w" and "a" write the ending records.""" + if self.fp is None: + return if self.mode in ("w", "a"): # write ending records count = 0 From gvanrossum@users.sourceforge.net Thu Nov 29 02:50:18 2001 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 28 Nov 2001 18:50:18 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib bdb.py,1.32,1.33 Message-ID: Update of /cvsroot/python/python/dist/src/Lib In directory usw-pr-cvs1:/tmp/cvs-serv15593 Modified Files: bdb.py Log Message: canonic(): don't use abspath() for filenames looking like <...>; this fixes the problem reported in SF bug #477023 (Jonathan Mark): "pdb: unexpected path confuses Emacs". Index: bdb.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/bdb.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** bdb.py 2001/06/25 18:01:24 1.32 --- bdb.py 2001/11/29 02:50:15 1.33 *************** *** 24,27 **** --- 24,29 ---- def canonic(self, filename): + if filename == "<" + filename[1:-1] + ">": + return filename canonic = self.fncache.get(filename) if not canonic: From tim_one@users.sourceforge.net Thu Nov 29 03:26:39 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 28 Nov 2001 19:26:39 -0800 Subject: [Python-checkins] CVS: python/dist/src/Misc NEWS,1.320,1.321 Message-ID: Update of /cvsroot/python/python/dist/src/Misc In directory usw-pr-cvs1:/tmp/cvs-serv22096/python/Misc Modified Files: NEWS Log Message: SF bug 486278 SystemError: Python/getargs.c:1086: bad. vgetargskeywords(): Now that this routine is checking for bad input (rather than dump core in some cases), some bad calls are raising errors that previously "worked". This patch makes the error strings more revealing, and changes the exceptions from SystemError to RuntimeError (under the theory that SystemError is more of a "can't happen!" assert- like thing, and so inappropriate for bad arguments to a public C API function). Index: NEWS =================================================================== RCS file: /cvsroot/python/python/dist/src/Misc/NEWS,v retrieving revision 1.320 retrieving revision 1.321 diff -C2 -d -r1.320 -r1.321 *** NEWS 2001/11/25 14:50:56 1.320 --- NEWS 2001/11/29 03:26:37 1.321 *************** *** 1,3 **** ! What's New in Python 2.2c1? XXX Release date: ??-Dec-2001 XXX =========================== --- 1,3 ---- ! What's New in Python 2.2c1 XXX Release date: ??-Dec-2001 XXX =========================== *************** *** 22,25 **** --- 22,32 ---- C API + + - PyArg_ParseTupleAndKeywords() requires that the number of entries in + the keyword list equals the number of argument specifiers. This + wasn't checked correctly, and PyArg_ParseTupleAndKeywords could even + dump core in some bad cases. This has been repaired. As a result, + PyArg_ParseTupleAndKeywords may raise RuntimeError in bad cases that + previously went unchallenged. New platforms From tim_one@users.sourceforge.net Thu Nov 29 03:26:39 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Wed, 28 Nov 2001 19:26:39 -0800 Subject: [Python-checkins] CVS: python/dist/src/Python getargs.c,2.88,2.89 Message-ID: Update of /cvsroot/python/python/dist/src/Python In directory usw-pr-cvs1:/tmp/cvs-serv22096/python/Python Modified Files: getargs.c Log Message: SF bug 486278 SystemError: Python/getargs.c:1086: bad. vgetargskeywords(): Now that this routine is checking for bad input (rather than dump core in some cases), some bad calls are raising errors that previously "worked". This patch makes the error strings more revealing, and changes the exceptions from SystemError to RuntimeError (under the theory that SystemError is more of a "can't happen!" assert- like thing, and so inappropriate for bad arguments to a public C API function). Index: getargs.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Python/getargs.c,v retrieving revision 2.88 retrieving revision 2.89 diff -C2 -d -r2.88 -r2.89 *** getargs.c 2001/11/28 22:14:37 2.88 --- getargs.c 2001/11/29 03:26:37 2.89 *************** *** 1050,1054 **** /* Search the format: message <- error msg, if any (else NULL). ! name <- routine name, if any (else NULL). min <- # of required arguments, or -1 if all are required. max <- most arguments (required + optional). --- 1050,1054 ---- /* Search the format: message <- error msg, if any (else NULL). ! fname <- routine name, if any (else NULL). min <- # of required arguments, or -1 if all are required. max <- most arguments (required + optional). *************** *** 1065,1070 **** max++; if (*p == NULL) { ! /* kwlist is too short */ ! PyErr_BadInternalCall(); return 0; } --- 1065,1071 ---- max++; if (*p == NULL) { ! PyErr_SetString(PyExc_RuntimeError, ! "more argument specifiers than " ! "keyword list entries"); return 0; } *************** *** 1082,1087 **** } else if (i == '(') { ! PyErr_SetString(PyExc_SystemError, ! "tuple found in format when using keyword arguments"); return 0; } --- 1083,1089 ---- } else if (i == '(') { ! PyErr_SetString(PyExc_RuntimeError, ! "tuple found in format when using keyword " ! "arguments"); return 0; } *************** *** 1089,1094 **** format = formatsave; if (*p != NULL) { ! /* kwlist is too long */ ! PyErr_BadInternalCall(); return 0; } --- 1091,1097 ---- format = formatsave; if (*p != NULL) { ! PyErr_SetString(PyExc_RuntimeError, ! "more keyword list entries than " ! "argument specifiers"); return 0; } From fdrake@users.sourceforge.net Thu Nov 29 04:30:49 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 28 Nov 2001 20:30:49 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/tools undoc_symbols.py,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools In directory usw-pr-cvs1:/tmp/cvs-serv3967 Modified Files: undoc_symbols.py Log Message: A few small changes: - Change PREFIX to PREFIXES, which contains a sequence of prefix strings. This is useful since we want to look for both Py and PY. - Wrap a long line. - Collect struct tags as well as typedef names. Since we generally only use one of the other, that improves coverage. - Make the script executable on Unix. This could use a better approach to determine if a symbol is documented, and could easily avoid keeping the massive string in memory. That would take time to actually write more code, though, so we'll bail on that for now. Index: undoc_symbols.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/undoc_symbols.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** undoc_symbols.py 2001/11/12 12:52:01 1.3 --- undoc_symbols.py 2001/11/29 04:30:46 1.4 *************** *** 1,3 **** ! """This script prints out a list of undocumented symbols found in Python include files, prefixed by their tag kind. --- 1,6 ---- ! #! /usr/bin/env python ! ! """\ ! This script prints out a list of undocumented symbols found in Python include files, prefixed by their tag kind. *************** *** 12,16 **** # Which kind of tags do we need? ! TAG_KINDS = "dpt" # Doc sections to use --- 15,19 ---- # Which kind of tags do we need? ! TAG_KINDS = "dpst" # Doc sections to use *************** *** 19,23 **** # Only print symbols starting with this prefix, # to get all symbols, use an empty string ! PREFIX = "Py" INCLUDEPATTERN = "*.h" --- 22,26 ---- # Only print symbols starting with this prefix, # to get all symbols, use an empty string ! PREFIXES = ("Py", "PY") INCLUDEPATTERN = "*.h" *************** *** 46,52 **** import os, glob, re, sys, tempfile ! def findnames(file, prefix=""): names = {} ! for line in file.readlines(): if line[0] == '!': continue --- 49,55 ---- import os, glob, re, sys, tempfile ! def findnames(file, prefixes=()): names = {} ! for line in file.xreadlines(): if line[0] == '!': continue *************** *** 55,59 **** if tag == 'd' and name.endswith('_H'): continue ! if name.startswith(prefix): names[name] = tag return names --- 58,67 ---- if tag == 'd' and name.endswith('_H'): continue ! if prefixes: ! sw = name.startswith ! for prefix in prefixes: ! if sw(prefix): ! names[name] = tag ! else: names[name] = tag return names *************** *** 70,74 **** incfiles = os.path.join(incdir, INCLUDEPATTERN) ! fp = os.popen("ctags -IDL_IMPORT --c-types=%s -f - %s" % (TAG_KINDS, incfiles)) dict = findnames(fp, prefix) names = dict.keys() --- 78,83 ---- incfiles = os.path.join(incdir, INCLUDEPATTERN) ! fp = os.popen("ctags -IDL_IMPORT --c-types=%s -f - %s" ! % (TAG_KINDS, incfiles)) dict = findnames(fp, prefix) names = dict.keys() *************** *** 83,85 **** docdir = os.path.normpath(os.path.join(srcdir, "..")) ! print_undoc_symbols(PREFIX, docdir, incdir) --- 92,94 ---- docdir = os.path.normpath(os.path.join(srcdir, "..")) ! print_undoc_symbols(PREFIXES, docdir, incdir) From fdrake@users.sourceforge.net Thu Nov 29 05:02:36 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 28 Nov 2001 21:02:36 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/ext extending.tex,1.6,1.7 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ext In directory usw-pr-cvs1:/tmp/cvs-serv9126/ext Modified Files: extending.tex Log Message: Add an index entry for the discussion of PyEval_CallObject(). This is related to SF bug #485165. Index: extending.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/extending.tex,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** extending.tex 2001/11/28 07:26:15 1.6 --- extending.tex 2001/11/29 05:02:34 1.7 *************** *** 510,521 **** Later, when it is time to call the function, you call the C function ! \cfunction{PyEval_CallObject()}. This function has two arguments, both ! pointers to arbitrary Python objects: the Python function, and the ! argument list. The argument list must always be a tuple object, whose ! length is the number of arguments. To call the Python function with ! no arguments, pass an empty tuple; to call it with one argument, pass ! a singleton tuple. \cfunction{Py_BuildValue()} returns a tuple when its ! format string consists of zero or more format codes between ! parentheses. For example: \begin{verbatim} --- 510,522 ---- Later, when it is time to call the function, you call the C function ! \cfunction{PyEval_CallObject()}.\ttindex{PyEval_CallObject()} This ! function has two arguments, both pointers to arbitrary Python objects: ! the Python function, and the argument list. The argument list must ! always be a tuple object, whose length is the number of arguments. To ! call the Python function with no arguments, pass an empty tuple; to ! call it with one argument, pass a singleton tuple. ! \cfunction{Py_BuildValue()} returns a tuple when its format string ! consists of zero or more format codes between parentheses. For ! example: \begin{verbatim} From fdrake@users.sourceforge.net Thu Nov 29 07:16:21 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Wed, 28 Nov 2001 23:16:21 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/ext extending.tex,1.7,1.8 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/ext In directory usw-pr-cvs1:/tmp/cvs-serv31588/ext Modified Files: extending.tex Log Message: Clarify the description of the creation of an owned reference from an API function. This closes SF bug #486657. Index: extending.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ext/extending.tex,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** extending.tex 2001/11/29 05:02:34 1.7 --- extending.tex 2001/11/29 07:16:19 1.8 *************** *** 1292,1300 **** with the reference. In particular, all functions whose function it is to create a new object, such as \cfunction{PyInt_FromLong()} and ! \cfunction{Py_BuildValue()}, pass ownership to the receiver. Even if in ! fact, in some cases, you don't receive a reference to a brand new ! object, you still receive ownership of the reference. For instance, ! \cfunction{PyInt_FromLong()} maintains a cache of popular values and can ! return a reference to a cached item. Many functions that extract objects from other objects also transfer --- 1292,1300 ---- with the reference. In particular, all functions whose function it is to create a new object, such as \cfunction{PyInt_FromLong()} and ! \cfunction{Py_BuildValue()}, pass ownership to the receiver. Even if ! the object is not actually new, you still receive ownership of a new ! reference to that object. For instance, \cfunction{PyInt_FromLong()} ! maintains a cache of popular values and can return a reference to a ! cached item. Many functions that extract objects from other objects also transfer From fdrake@users.sourceforge.net Thu Nov 29 08:45:24 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 29 Nov 2001 00:45:24 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libre.tex,1.71,1.72 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv18154/lib Modified Files: libre.tex Log Message: New section of regular expression examples contributed by Skip Montanaro, with some extensions and changes from me. This closes SF patch #472825. Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** libre.tex 2001/11/05 21:34:36 1.71 --- libre.tex 2001/11/29 08:45:22 1.72 *************** *** 793,794 **** --- 793,850 ---- The string passed to \function{match()} or \function{search()}. \end{memberdesc} + + \subsection{Examples} + + %\begin{list}{}{\leftmargin 0.7in \labelwidth 0.65in} + + %\item[Simulating scanf] + + \leftline{\strong{Simulating \cfunction{scanf()}}} + + Python does not currently have an equivalent to \cfunction{scanf()}. + \ttindex{scanf()} + Regular expressions are generally more powerful, though also more + verbose, than \cfunction{scanf()} format strings. The table below + offers some more-or-less equivalent mappings between + \cfunction{scanf()} format tokens and regular expressions. + + \begin{tableii}{l|l}{textrm}{\cfunction{scanf()} Token}{Regular Expression} + \lineii{\code{\%c}} + {\regexp{.}} + \lineii{\code{\%5c}} + {\regexp{.\{5\}}} + \lineii{\code{\%d}} + {\regexp{[-+]\e d+}} + \lineii{\code{\%e}, \code{\%E}, \code{\%f}, \code{\%g}} + {\regexp{[-+](\e d+(\e.\e d*)?|\e d*\e.\e d+)([eE]\e d+)?}} + \lineii{\code{\%i}} + {\regexp{[-+](0[xX][\e dA-Fa-f]+|0[0-7]*|\e d+)}} + \lineii{\code{\%o}} + {\regexp{0[0-7]*}} + \lineii{\code{\%s}} + {\regexp{[\textasciicircum\e s]+}} + \lineii{\code{\%u}} + {\regexp{\e d+}} + \lineii{\code{\%x}, \code{\%X}} + {\regexp{0[xX][\e dA-Fa-f]}} + \end{tableii} + + To extract the filename and numbers from a string like + + \begin{verbatim} + /usr/sbin/sendmail - 0 errors, 4 warnings + \end{verbatim} + + you would use a \cfunction{scanf()} format like + + \begin{verbatim} + %s - %d errors, %d warnings + \end{verbatim} + + The equivalent regular expression would be + + \begin{verbatim} + ([^\s]+) - (\d+) errors, (\d+) warnings + \end{verbatim} + + %\end{list} From jackjansen@users.sourceforge.net Thu Nov 29 13:15:12 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:15:12 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts genpluginprojects.py,1.22,1.22.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv20866/Python/Mac/scripts Modified Files: Tag: r22b2-branch genpluginprojects.py Log Message: Added the WeakImport flag to various (ppc) toolbox modules, and CarbonAccessors.o to _Win. This should make everything work again under MacOS 8.1. Index: genpluginprojects.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/genpluginprojects.py,v retrieving revision 1.22 retrieving revision 1.22.2.1 diff -C2 -d -r1.22 -r1.22.2.1 *** genpluginprojects.py 2001/11/06 15:56:56 1.22 --- genpluginprojects.py 2001/11/29 13:15:10 1.22.2.1 *************** *** 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 --- 36,41 ---- sources=[], sourcedirs=[], libraries=[], extradirs=[], ! extraexportsymbols=[], outputdir=":::Lib:lib-dynload", ! libraryflags=None, stdlibraryflags=None): if architecture == "all": # For the time being we generate two project files. Not as nice as *************** *** 91,94 **** --- 92,99 ---- "prefixname" : prefixname, } + if libraryflags: + dict['libraryflags'] = libraryflags + if stdlibraryflags: + dict['stdlibraryflags'] = stdlibraryflags mkcwproject.mkproject(os.path.join(projectdir, project), module, dict, force=FORCEREBUILD, templatename=templatename) *************** *** 125,132 **** 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") --- 130,137 ---- genpluginproject("carbon", "_Ctl", outputdir="::Lib:Carbon") genpluginproject("ppc", "_Ctl", libraries=["ControlsLib", "AppearanceLib"], ! libraryflags="Debug, WeakImport", outputdir="::Lib:Carbon") genpluginproject("carbon", "_Dlg", outputdir="::Lib:Carbon") genpluginproject("ppc", "_Dlg", libraries=["DialogsLib", "AppearanceLib"], ! libraryflags="Debug, WeakImport", outputdir="::Lib:Carbon") genpluginproject("carbon", "_Drag", outputdir="::Lib:Carbon") genpluginproject("ppc", "_Drag", libraries=["DragLib"], outputdir="::Lib:Carbon") *************** *** 139,143 **** 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") --- 144,148 ---- genpluginproject("carbon", "_Menu", outputdir="::Lib:Carbon") genpluginproject("ppc", "_Menu", libraries=["MenusLib", "ContextualMenu", "AppearanceLib"], ! libraryflags="Debug, WeakImport", outputdir="::Lib:Carbon") genpluginproject("all", "_Qd", outputdir="::Lib:Carbon") genpluginproject("ppc", "_Qt", libraries=["QuickTimeLib"], outputdir="::Lib:Carbon") *************** *** 154,159 **** 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") --- 159,164 ---- genpluginproject("carbon", "_Mlte", outputdir="::Lib:Carbon") genpluginproject("carbon", "_Win", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "_Win", libraries=["CarbonAccessors.o", "WindowsLib", "AppearanceLib"], ! libraryflags="Debug, WeakImport", outputdir="::Lib:Carbon") # Carbon Only? genpluginproject("carbon", "_CF", outputdir="::Lib:Carbon") From jackjansen@users.sourceforge.net Thu Nov 29 13:17:10 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:17:10 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Distributions/(vise) Python 2.2.vct,1.5,1.5.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions/(vise) In directory usw-pr-cvs1:/tmp/cvs-serv21028/Python/Mac/Distributions/(vise) Modified Files: Tag: r22b2-branch Python 2.2.vct Log Message: Files used for 2.2b2 release. Index: Python 2.2.vct =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/(vise)/Python 2.2.vct,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 Binary files /tmp/cvshTARjq and /tmp/cvsYsvZ9G differ From jackjansen@users.sourceforge.net Thu Nov 29 13:17:35 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:17:35 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCore.mcp,1.29.2.1,1.29.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv21253/Python/Mac/Build Modified Files: Tag: r22b2-branch PythonCore.mcp Log Message: Files used for 2.2b2 release. Index: PythonCore.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.mcp,v retrieving revision 1.29.2.1 retrieving revision 1.29.2.2 diff -C2 -d -r1.29.2.1 -r1.29.2.2 Binary files /tmp/cvsILs3pQ and /tmp/cvsGWEX6x differ From jackjansen@users.sourceforge.net Thu Nov 29 13:17:44 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:17:44 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac Relnotes,1.27.2.1,1.27.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory usw-pr-cvs1:/tmp/cvs-serv21325/Python/Mac Modified Files: Tag: r22b2-branch Relnotes Log Message: Files used for 2.2b2 release. Index: Relnotes =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Relnotes,v retrieving revision 1.27.2.1 retrieving revision 1.27.2.2 diff -C2 -d -r1.27.2.1 -r1.27.2.2 *** Relnotes 2001/11/26 22:42:15 1.27.2.1 --- Relnotes 2001/11/29 13:17:42 1.27.2.2 *************** *** 17,20 **** --- 17,22 ---- - Command-dot handling has been improved a lot: scripts are now much easier to interrupt, and they only scan for cmd-. while in the foreground. [2.2b2] + - "Copy" from the MacPython console window was always disabled. Fixed. [2.2b2] + - This release should run on MacOS 8.1 again. [2.2b2 build 116] - A new, rather different GUSI I/O library is used. Please report any strange behaviour with I/O to the pythonmac-sig mailing list! [2.2b2] From jackjansen@users.sourceforge.net Thu Nov 29 13:17:49 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:17:49 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Include macbuildno.h,1.21,1.21.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Include In directory usw-pr-cvs1:/tmp/cvs-serv21372/Python/Mac/Include Modified Files: Tag: r22b2-branch macbuildno.h Log Message: Files used for 2.2b2 release. Index: macbuildno.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Include/macbuildno.h,v retrieving revision 1.21 retrieving revision 1.21.2.1 diff -C2 -d -r1.21 -r1.21.2.1 *** macbuildno.h 2001/10/23 22:21:19 1.21 --- macbuildno.h 2001/11/29 13:17:47 1.21.2.1 *************** *** 1 **** ! #define BUILD 111 --- 1 ---- ! #define BUILD 116 From jackjansen@users.sourceforge.net Thu Nov 29 13:19:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:19:11 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Python macglue.c,1.107.2.1,1.107.2.2 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv21852/Python/Mac/Python Modified Files: Tag: r22b2-branch macglue.c Log Message: Edit->Copy from the console window didn't work because we could inadvertantly create two menubars. Fixed. Index: macglue.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macglue.c,v retrieving revision 1.107.2.1 retrieving revision 1.107.2.2 diff -C2 -d -r1.107.2.1 -r1.107.2.2 *** macglue.c 2001/11/18 02:05:34 1.107.2.1 --- macglue.c 2001/11/29 13:19:09 1.107.2.2 *************** *** 730,734 **** if ( (sioux_mbar=GetMenuBar()) == NULL ) { #else ! { #endif /* Sioux menu not installed yet. Do so */ --- 730,734 ---- if ( (sioux_mbar=GetMenuBar()) == NULL ) { #else ! if ( (sioux_mbar=GetMenuBar()) == NULL || GetMenuHandle(SIOUX_APPLEID) == NULL) { #endif /* Sioux menu not installed yet. Do so */ From jackjansen@users.sourceforge.net Thu Nov 29 13:21:39 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:21:39 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/res _Resmodule.c,1.4,1.4.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/res In directory usw-pr-cvs1:/tmp/cvs-serv22707/Python/Mac/Modules/res Modified Files: Tag: r22b2-branch _Resmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Resmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/res/_Resmodule.c,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -C2 -d -r1.4 -r1.4.8.1 *** _Resmodule.c 2001/09/05 15:43:11 1.4 --- _Resmodule.c 2001/11/29 13:21:37 1.4.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 551,555 **** PyTypeObject Resource_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "Resource", /*tp_name*/ --- 547,551 ---- PyTypeObject Resource_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "Resource", /*tp_name*/ From jackjansen@users.sourceforge.net Thu Nov 29 13:21:09 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:21:09 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/win _Winmodule.c,1.4,1.4.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/win In directory usw-pr-cvs1:/tmp/cvs-serv22493/Python/Mac/Modules/win Modified Files: Tag: r22b2-branch _Winmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Winmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/win/_Winmodule.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** _Winmodule.c 2001/11/05 16:16:22 1.4 --- _Winmodule.c 2001/11/29 13:21:06 1.4.2.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ [...1397 lines suppressed...] *************** *** 2633,2636 **** --- 3040,3046 ---- WindowPtr _rv; CGrafPtr port; + #ifndef GetWindowFromPort + PyMac_PRECHECK(GetWindowFromPort); + #endif if (!PyArg_ParseTuple(_args, "O&", GrafObj_Convert, &port)) *************** *** 2661,2664 **** --- 3071,3077 ---- Point thePoint; WindowPtr theWindow; + #ifndef FindWindow + PyMac_PRECHECK(FindWindow); + #endif if (!PyArg_ParseTuple(_args, "O&", PyMac_GetPoint, &thePoint)) From jackjansen@users.sourceforge.net Thu Nov 29 13:21:20 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:21:20 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/waste wastemodule.c,1.18,1.18.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/waste In directory usw-pr-cvs1:/tmp/cvs-serv22584/Python/Mac/Modules/waste Modified Files: Tag: r22b2-branch wastemodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: wastemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/waste/wastemodule.c,v retrieving revision 1.18 retrieving revision 1.18.8.1 diff -C2 -d -r1.18 -r1.18.8.1 *** wastemodule.c 2001/09/05 15:42:53 1.18 --- wastemodule.c 2001/11/29 13:21:18 1.18.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 349,353 **** PyTypeObject WEO_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "WEO", /*tp_name*/ --- 345,349 ---- PyTypeObject WEO_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "WEO", /*tp_name*/ *************** *** 1714,1718 **** PyTypeObject waste_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "waste", /*tp_name*/ --- 1710,1714 ---- PyTypeObject waste_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "waste", /*tp_name*/ From jackjansen@users.sourceforge.net Thu Nov 29 13:21:26 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:21:26 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/te _TEmodule.c,1.3,1.3.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/te In directory usw-pr-cvs1:/tmp/cvs-serv22631/Python/Mac/Modules/te Modified Files: Tag: r22b2-branch _TEmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _TEmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/te/_TEmodule.c,v retrieving revision 1.3 retrieving revision 1.3.8.1 diff -C2 -d -r1.3 -r1.3.8.1 *** _TEmodule.c 2001/09/05 10:29:21 1.3 --- _TEmodule.c 2001/11/29 13:21:24 1.3.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 794,798 **** PyTypeObject TE_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "TE", /*tp_name*/ --- 790,794 ---- PyTypeObject TE_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "TE", /*tp_name*/ From jackjansen@users.sourceforge.net Thu Nov 29 13:21:32 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:21:32 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/snd _Sndmodule.c,1.3,1.3.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/snd In directory usw-pr-cvs1:/tmp/cvs-serv22660/Python/Mac/Modules/snd Modified Files: Tag: r22b2-branch _Sndmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Sndmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/snd/_Sndmodule.c,v retrieving revision 1.3 retrieving revision 1.3.8.1 diff -C2 -d -r1.3 -r1.3.8.1 *** _Sndmodule.c 2001/09/05 10:28:49 1.3 --- _Sndmodule.c 2001/11/29 13:21:30 1.3.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 317,321 **** staticforward PyTypeObject SndChannel_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "SndChannel", /*tp_name*/ --- 313,317 ---- staticforward PyTypeObject SndChannel_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "SndChannel", /*tp_name*/ *************** *** 445,449 **** staticforward PyTypeObject SPB_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "SPB", /*tp_name*/ --- 441,445 ---- staticforward PyTypeObject SPB_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "SPB", /*tp_name*/ From jackjansen@users.sourceforge.net Thu Nov 29 13:22:04 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:22:04 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/qt _Qtmodule.c,1.3,1.3.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qt In directory usw-pr-cvs1:/tmp/cvs-serv22748/Python/Mac/Modules/qt Modified Files: Tag: r22b2-branch _Qtmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Qtmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/_Qtmodule.c,v retrieving revision 1.3 retrieving revision 1.3.8.1 diff -C2 -d -r1.3 -r1.3.8.1 *** _Qtmodule.c 2001/09/05 10:29:38 1.3 --- _Qtmodule.c 2001/11/29 13:22:01 1.3.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 935,939 **** PyTypeObject MovieController_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "MovieController", /*tp_name*/ --- 931,935 ---- PyTypeObject MovieController_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "MovieController", /*tp_name*/ *************** *** 1329,1333 **** PyTypeObject TimeBase_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "TimeBase", /*tp_name*/ --- 1325,1329 ---- PyTypeObject TimeBase_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "TimeBase", /*tp_name*/ *************** *** 1606,1610 **** PyTypeObject UserData_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "UserData", /*tp_name*/ --- 1602,1606 ---- PyTypeObject UserData_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "UserData", /*tp_name*/ *************** *** 2640,2644 **** PyTypeObject Media_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "Media", /*tp_name*/ --- 2636,2640 ---- PyTypeObject Media_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "Media", /*tp_name*/ *************** *** 3727,3731 **** PyTypeObject Track_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "Track", /*tp_name*/ --- 3723,3727 ---- PyTypeObject Track_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "Track", /*tp_name*/ *************** *** 5799,5803 **** PyTypeObject Movie_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "Movie", /*tp_name*/ --- 5795,5799 ---- PyTypeObject Movie_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "Movie", /*tp_name*/ From jackjansen@users.sourceforge.net Thu Nov 29 13:22:11 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:22:11 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/qdoffs _Qdoffsmodule.c,1.3,1.3.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qdoffs In directory usw-pr-cvs1:/tmp/cvs-serv22864/Python/Mac/Modules/qdoffs Modified Files: Tag: r22b2-branch _Qdoffsmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Qdoffsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qdoffs/_Qdoffsmodule.c,v retrieving revision 1.3 retrieving revision 1.3.8.1 diff -C2 -d -r1.3 -r1.3.8.1 *** _Qdoffsmodule.c 2001/09/05 10:29:43 1.3 --- _Qdoffsmodule.c 2001/11/29 13:22:09 1.3.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 139,143 **** PyTypeObject GWorld_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "GWorld", /*tp_name*/ --- 135,139 ---- PyTypeObject GWorld_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "GWorld", /*tp_name*/ From jackjansen@users.sourceforge.net Thu Nov 29 13:22:35 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:22:35 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/mlte _Mltemodule.c,1.4,1.4.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/mlte In directory usw-pr-cvs1:/tmp/cvs-serv22962/Python/Mac/Modules/mlte Modified Files: Tag: r22b2-branch _Mltemodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Mltemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/mlte/_Mltemodule.c,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -C2 -d -r1.4 -r1.4.8.1 *** _Mltemodule.c 2001/09/05 10:29:49 1.4 --- _Mltemodule.c 2001/11/29 13:22:32 1.4.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 132,136 **** --- 128,134 ---- { PyObject *_res = NULL; + #ifndef TXNDeleteObject PyMac_PRECHECK(TXNDeleteObject); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 147,151 **** --- 145,151 ---- UInt32 iHeight; TXNFrameID iTXNFrameID; + #ifndef TXNResizeFrame PyMac_PRECHECK(TXNResizeFrame); + #endif if (!PyArg_ParseTuple(_args, "lll", &iWidth, *************** *** 170,174 **** --- 170,176 ---- SInt32 iRight; TXNFrameID iTXNFrameID; + #ifndef TXNSetFrameBounds PyMac_PRECHECK(TXNSetFrameBounds); + #endif if (!PyArg_ParseTuple(_args, "lllll", &iTop, *************** *** 193,197 **** --- 195,201 ---- PyObject *_res = NULL; EventRecord iEvent; + #ifndef TXNKeyDown PyMac_PRECHECK(TXNKeyDown); + #endif if (!PyArg_ParseTuple(_args, "O&", PyMac_GetEventRecord, &iEvent)) *************** *** 208,212 **** --- 212,218 ---- PyObject *_res = NULL; RgnHandle ioCursorRgn; + #ifndef TXNAdjustCursor PyMac_PRECHECK(TXNAdjustCursor); + #endif if (!PyArg_ParseTuple(_args, "O&", OptResObj_Convert, &ioCursorRgn)) *************** *** 223,227 **** --- 229,235 ---- PyObject *_res = NULL; EventRecord iEvent; + #ifndef TXNClick PyMac_PRECHECK(TXNClick); + #endif if (!PyArg_ParseTuple(_args, "O&", PyMac_GetEventRecord, &iEvent)) *************** *** 241,245 **** --- 249,255 ---- Boolean _rv; EventRecord iEvent; + #ifndef TXNTSMCheck PyMac_PRECHECK(TXNTSMCheck); + #endif if (!PyArg_ParseTuple(_args, "O&", PyMac_GetEventRecord, &iEvent)) *************** *** 256,260 **** --- 266,272 ---- { PyObject *_res = NULL; + #ifndef TXNSelectAll PyMac_PRECHECK(TXNSelectAll); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 269,273 **** --- 281,287 ---- PyObject *_res = NULL; Boolean iBecomingFocused; + #ifndef TXNFocus PyMac_PRECHECK(TXNFocus); + #endif if (!PyArg_ParseTuple(_args, "b", &iBecomingFocused)) *************** *** 283,287 **** --- 297,303 ---- { PyObject *_res = NULL; + #ifndef TXNUpdate PyMac_PRECHECK(TXNUpdate); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 296,300 **** --- 312,318 ---- PyObject *_res = NULL; GWorldPtr iDrawPort; + #ifndef TXNDraw PyMac_PRECHECK(TXNDraw); + #endif if (!PyArg_ParseTuple(_args, "O&", OptGWorldObj_Convert, &iDrawPort)) *************** *** 310,314 **** --- 328,334 ---- { PyObject *_res = NULL; + #ifndef TXNForceUpdate PyMac_PRECHECK(TXNForceUpdate); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 323,327 **** --- 343,349 ---- PyObject *_res = NULL; UInt32 _rv; + #ifndef TXNGetSleepTicks PyMac_PRECHECK(TXNGetSleepTicks); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 335,339 **** --- 357,363 ---- { PyObject *_res = NULL; + #ifndef TXNIdle PyMac_PRECHECK(TXNIdle); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 348,352 **** --- 372,378 ---- PyObject *_res = NULL; EventRecord iEvent; + #ifndef TXNGrowWindow PyMac_PRECHECK(TXNGrowWindow); + #endif if (!PyArg_ParseTuple(_args, "O&", PyMac_GetEventRecord, &iEvent)) *************** *** 363,367 **** --- 389,395 ---- PyObject *_res = NULL; short iPart; + #ifndef TXNZoomWindow PyMac_PRECHECK(TXNZoomWindow); + #endif if (!PyArg_ParseTuple(_args, "h", &iPart)) *************** *** 379,383 **** --- 407,413 ---- Boolean _rv; TXNActionKey oTXNActionKey; + #ifndef TXNCanUndo PyMac_PRECHECK(TXNCanUndo); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 393,397 **** --- 423,429 ---- { PyObject *_res = NULL; + #ifndef TXNUndo PyMac_PRECHECK(TXNUndo); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 407,411 **** --- 439,445 ---- Boolean _rv; TXNActionKey oTXNActionKey; + #ifndef TXNCanRedo PyMac_PRECHECK(TXNCanRedo); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 421,425 **** --- 455,461 ---- { PyObject *_res = NULL; + #ifndef TXNRedo PyMac_PRECHECK(TXNRedo); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 434,438 **** --- 470,476 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNCut PyMac_PRECHECK(TXNCut); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 448,452 **** --- 486,492 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNCopy PyMac_PRECHECK(TXNCopy); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 462,466 **** --- 502,508 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNPaste PyMac_PRECHECK(TXNPaste); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 476,480 **** --- 518,524 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNClear PyMac_PRECHECK(TXNClear); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 491,495 **** --- 535,541 ---- TXNOffset oStartOffset; TXNOffset oEndOffset; + #ifndef TXNGetSelection PyMac_PRECHECK(TXNGetSelection); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 507,511 **** --- 553,559 ---- PyObject *_res = NULL; Boolean iShowEnd; + #ifndef TXNShowSelection PyMac_PRECHECK(TXNShowSelection); + #endif if (!PyArg_ParseTuple(_args, "b", &iShowEnd)) *************** *** 522,526 **** --- 570,576 ---- PyObject *_res = NULL; Boolean _rv; + #ifndef TXNIsSelectionEmpty PyMac_PRECHECK(TXNIsSelectionEmpty); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 537,541 **** --- 587,593 ---- TXNOffset iStartOffset; TXNOffset iEndOffset; + #ifndef TXNSetSelection PyMac_PRECHECK(TXNSetSelection); + #endif if (!PyArg_ParseTuple(_args, "ll", &iStartOffset, *************** *** 558,562 **** --- 610,616 ---- UInt32 iEndOffset; ItemCount oRunCount; + #ifndef TXNCountRunsInRange PyMac_PRECHECK(TXNCountRunsInRange); + #endif if (!PyArg_ParseTuple(_args, "ll", &iStartOffset, *************** *** 577,581 **** --- 631,637 ---- PyObject *_res = NULL; ByteCount _rv; + #ifndef TXNDataSize PyMac_PRECHECK(TXNDataSize); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 593,597 **** --- 649,655 ---- TXNOffset iEndOffset; Handle oDataHandle; + #ifndef TXNGetData PyMac_PRECHECK(TXNGetData); + #endif if (!PyArg_ParseTuple(_args, "ll", &iStartOffset, *************** *** 616,620 **** --- 674,680 ---- Handle oDataHandle; TXNDataType iEncoding; + #ifndef TXNGetDataEncoded PyMac_PRECHECK(TXNGetDataEncoded); + #endif if (!PyArg_ParseTuple(_args, "llO&", &iStartOffset, *************** *** 642,646 **** --- 702,708 ---- TXNOffset iStartOffset; TXNOffset iEndOffset; + #ifndef TXNSetDataFromFile PyMac_PRECHECK(TXNSetDataFromFile); + #endif if (!PyArg_ParseTuple(_args, "hO&lll", &iFileRefNum, *************** *** 672,676 **** --- 734,740 ---- TXNOffset iStartOffset; TXNOffset iEndOffset; + #ifndef TXNSetData PyMac_PRECHECK(TXNSetData); + #endif if (!PyArg_ParseTuple(_args, "O&s#ll", PyMac_GetOSType, &iDataType, *************** *** 695,699 **** --- 759,765 ---- PyObject *_res = NULL; ItemCount _rv; + #ifndef TXNGetChangeCount PyMac_PRECHECK(TXNGetChangeCount); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 714,718 **** --- 780,786 ---- SInt16 iDataReference; SInt16 iResourceReference; + #ifndef TXNSave PyMac_PRECHECK(TXNSave); + #endif if (!PyArg_ParseTuple(_args, "O&O&lO&hh", PyMac_GetOSType, &iType, *************** *** 740,744 **** --- 808,814 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNRevert PyMac_PRECHECK(TXNRevert); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 754,758 **** --- 824,830 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNPageSetup PyMac_PRECHECK(TXNPageSetup); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 768,772 **** --- 840,846 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNPrint PyMac_PRECHECK(TXNPrint); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 782,786 **** --- 856,862 ---- PyObject *_res = NULL; Rect oViewRect; + #ifndef TXNGetViewRect PyMac_PRECHECK(TXNGetViewRect); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 798,802 **** --- 874,880 ---- GWorldPtr iWindow; Boolean iIsActualWindow; + #ifndef TXNAttachObjectToWindow PyMac_PRECHECK(TXNAttachObjectToWindow); + #endif if (!PyArg_ParseTuple(_args, "O&b", GWorldObj_Convert, &iWindow, *************** *** 816,820 **** --- 894,900 ---- PyObject *_res = NULL; Boolean _rv; + #ifndef TXNIsObjectAttachedToWindow PyMac_PRECHECK(TXNIsObjectAttachedToWindow); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 834,838 **** --- 914,920 ---- DragReference iDragReference; Boolean iDifferentObjectSameWindow; + #ifndef TXNDragTracker PyMac_PRECHECK(TXNDragTracker); + #endif if (!PyArg_ParseTuple(_args, "lhO&O&b", &iTXNFrameID, *************** *** 862,866 **** --- 944,950 ---- DragReference iDragReference; Boolean iDifferentObjectSameWindow; + #ifndef TXNDragReceiver PyMac_PRECHECK(TXNDragReceiver); + #endif if (!PyArg_ParseTuple(_args, "lO&O&b", &iTXNFrameID, *************** *** 886,890 **** --- 970,976 ---- TXNFrameID iTXNFrameID; TXNScrollBarState iActiveState; + #ifndef TXNActivate PyMac_PRECHECK(TXNActivate); + #endif if (!PyArg_ParseTuple(_args, "ll", &iTXNFrameID, *************** *** 907,911 **** --- 993,999 ---- SInt16 iMenuID; SInt16 iMenuItem; + #ifndef TXNDoFontMenuSelection PyMac_PRECHECK(TXNDoFontMenuSelection); + #endif if (!PyArg_ParseTuple(_args, "O&hh", TXNFontMenuObj_Convert, &iTXNFontMenuObject, *************** *** 928,932 **** --- 1016,1022 ---- OSStatus _err; TXNFontMenuObject iTXNFontMenuObject; + #ifndef TXNPrepareFontMenu PyMac_PRECHECK(TXNPrepareFontMenu); + #endif if (!PyArg_ParseTuple(_args, "O&", TXNFontMenuObj_Convert, &iTXNFontMenuObject)) *************** *** 1057,1061 **** PyTypeObject TXNObject_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "TXNObject", /*tp_name*/ --- 1147,1151 ---- PyTypeObject TXNObject_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "TXNObject", /*tp_name*/ *************** *** 1120,1124 **** --- 1210,1216 ---- OSStatus _err; MenuHandle oFontMenuHandle; + #ifndef TXNGetFontMenuHandle PyMac_PRECHECK(TXNGetFontMenuHandle); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 1135,1139 **** --- 1227,1233 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNDisposeFontMenuObject PyMac_PRECHECK(TXNDisposeFontMenuObject); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 1169,1173 **** PyTypeObject TXNFontMenuObject_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "TXNFontMenuObject", /*tp_name*/ --- 1263,1267 ---- PyTypeObject TXNFontMenuObject_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "TXNFontMenuObject", /*tp_name*/ *************** *** 1203,1207 **** --- 1297,1303 ---- TXNObject oTXNObject; TXNFrameID oTXNFrameID; + #ifndef TXNNewObject PyMac_PRECHECK(TXNNewObject); + #endif if (!PyArg_ParseTuple(_args, "O&O&O&llO&l", OptFSSpecPtr_Convert, &iFileSpec, *************** *** 1233,1237 **** --- 1329,1335 ---- { PyObject *_res = NULL; + #ifndef TXNTerminateTextension PyMac_PRECHECK(TXNTerminateTextension); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 1246,1250 **** --- 1344,1350 ---- PyObject *_res = NULL; Boolean _rv; + #ifndef TXNIsScrapPastable PyMac_PRECHECK(TXNIsScrapPastable); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 1259,1263 **** --- 1359,1365 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNConvertToPublicScrap PyMac_PRECHECK(TXNConvertToPublicScrap); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 1273,1277 **** --- 1375,1381 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNConvertFromPublicScrap PyMac_PRECHECK(TXNConvertFromPublicScrap); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 1291,1295 **** --- 1395,1401 ---- SInt16 iStartHierMenuID; TXNFontMenuObject oTXNFontMenuObject; + #ifndef TXNNewFontMenuObject PyMac_PRECHECK(TXNNewFontMenuObject); + #endif if (!PyArg_ParseTuple(_args, "O&hh", MenuObj_Convert, &iFontMenuHandle, *************** *** 1312,1316 **** --- 1418,1424 ---- TXNVersionValue _rv; TXNFeatureBits oFeatureFlags; + #ifndef TXNVersionInformation PyMac_PRECHECK(TXNVersionInformation); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; From jackjansen@users.sourceforge.net Thu Nov 29 13:22:48 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:22:48 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/menu _Menumodule.c,1.3,1.3.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/menu In directory usw-pr-cvs1:/tmp/cvs-serv22997/Python/Mac/Modules/menu Modified Files: Tag: r22b2-branch _Menumodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Menumodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/menu/_Menumodule.c,v retrieving revision 1.3 retrieving revision 1.3.8.1 diff -C2 -d -r1.3 -r1.3.8.1 *** _Menumodule.c 2001/09/05 10:29:57 1.3 --- _Menumodule.c 2001/11/29 13:22:46 1.3.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ [...1244 lines suppressed...] *************** *** 2416,2419 **** --- 2781,2787 ---- PyObject *_res = NULL; short menuID; + #ifndef DeleteMenu + PyMac_PRECHECK(DeleteMenu); + #endif if (!PyArg_ParseTuple(_args, "h", &menuID)) *************** *** 2428,2431 **** --- 2796,2802 ---- { PyObject *_res = NULL; + #ifndef DrawMenuBar + PyMac_PRECHECK(DrawMenuBar); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; From jackjansen@users.sourceforge.net Thu Nov 29 13:22:28 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:22:28 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/qd _Qdmodule.c,1.4,1.4.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qd In directory usw-pr-cvs1:/tmp/cvs-serv22897/Python/Mac/Modules/qd Modified Files: Tag: r22b2-branch _Qdmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Qdmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qd/_Qdmodule.c,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -C2 -d -r1.4 -r1.4.8.1 *** _Qdmodule.c 2001/09/05 15:43:33 1.4 --- _Qdmodule.c 2001/11/29 13:22:26 1.4.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 374,378 **** PyTypeObject GrafPort_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "GrafPort", /*tp_name*/ --- 370,374 ---- PyTypeObject GrafPort_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "GrafPort", /*tp_name*/ *************** *** 505,509 **** PyTypeObject BitMap_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "BitMap", /*tp_name*/ --- 501,505 ---- PyTypeObject BitMap_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "BitMap", /*tp_name*/ *************** *** 633,637 **** staticforward PyTypeObject QDGlobalsAccess_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "QDGlobalsAccess", /*tp_name*/ --- 629,633 ---- staticforward PyTypeObject QDGlobalsAccess_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "QDGlobalsAccess", /*tp_name*/ From jackjansen@users.sourceforge.net Thu Nov 29 13:22:54 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:22:54 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/list _Listmodule.c,1.5,1.5.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/list In directory usw-pr-cvs1:/tmp/cvs-serv23030/Python/Mac/Modules/list Modified Files: Tag: r22b2-branch _Listmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Listmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/list/_Listmodule.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** _Listmodule.c 2001/11/05 11:12:12 1.5 --- _Listmodule.c 2001/11/29 13:22:52 1.5.2.1 *************** *** 648,652 **** PyTypeObject List_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "List", /*tp_name*/ --- 648,652 ---- PyTypeObject List_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "List", /*tp_name*/ From jackjansen@users.sourceforge.net Thu Nov 29 13:23:10 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:23:10 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/fm _Fmmodule.c,1.2,1.2.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/fm In directory usw-pr-cvs1:/tmp/cvs-serv23165/Python/Mac/Modules/fm Modified Files: Tag: r22b2-branch _Fmmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Fmmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/fm/_Fmmodule.c,v retrieving revision 1.2 retrieving revision 1.2.8.1 diff -C2 -d -r1.2 -r1.2.8.1 *** _Fmmodule.c 2001/09/05 10:30:25 1.2 --- _Fmmodule.c 2001/11/29 13:23:08 1.2.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- From jackjansen@users.sourceforge.net Thu Nov 29 13:23:15 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:23:15 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/evt _Evtmodule.c,1.2,1.2.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/evt In directory usw-pr-cvs1:/tmp/cvs-serv23202/Python/Mac/Modules/evt Modified Files: Tag: r22b2-branch _Evtmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Evtmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/evt/_Evtmodule.c,v retrieving revision 1.2 retrieving revision 1.2.8.1 diff -C2 -d -r1.2 -r1.2.8.1 *** _Evtmodule.c 2001/09/05 10:30:20 1.2 --- _Evtmodule.c 2001/11/29 13:23:13 1.2.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- From jackjansen@users.sourceforge.net Thu Nov 29 13:23:22 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:23:22 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/drag _Dragmodule.c,1.3,1.3.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/drag In directory usw-pr-cvs1:/tmp/cvs-serv23233/Python/Mac/Modules/drag Modified Files: Tag: r22b2-branch _Dragmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Dragmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/drag/_Dragmodule.c,v retrieving revision 1.3 retrieving revision 1.3.8.1 diff -C2 -d -r1.3 -r1.3.8.1 *** _Dragmodule.c 2001/09/05 10:30:39 1.3 --- _Dragmodule.c 2001/11/29 13:23:20 1.3.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 676,680 **** PyTypeObject DragObj_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "DragObj", /*tp_name*/ --- 672,676 ---- PyTypeObject DragObj_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "DragObj", /*tp_name*/ From jackjansen@users.sourceforge.net Thu Nov 29 13:23:29 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:23:29 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/dlg _Dlgmodule.c,1.4,1.4.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/dlg In directory usw-pr-cvs1:/tmp/cvs-serv23268/Python/Mac/Modules/dlg Modified Files: Tag: r22b2-branch _Dlgmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Dlgmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/dlg/_Dlgmodule.c,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** _Dlgmodule.c 2001/11/05 16:16:34 1.4 --- _Dlgmodule.c 2001/11/29 13:23:27 1.4.2.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 186,189 **** --- 182,188 ---- { PyObject *_res = NULL; + #ifndef DrawDialog + PyMac_PRECHECK(DrawDialog); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 198,201 **** --- 197,203 ---- PyObject *_res = NULL; RgnHandle updateRgn; + #ifndef UpdateDialog + PyMac_PRECHECK(UpdateDialog); + #endif if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &updateRgn)) *************** *** 212,215 **** --- 214,220 ---- PyObject *_res = NULL; DialogItemIndex itemNo; + #ifndef HideDialogItem + PyMac_PRECHECK(HideDialogItem); + #endif if (!PyArg_ParseTuple(_args, "h", &itemNo)) *************** *** 226,229 **** --- 231,237 ---- PyObject *_res = NULL; DialogItemIndex itemNo; + #ifndef ShowDialogItem + PyMac_PRECHECK(ShowDialogItem); + #endif if (!PyArg_ParseTuple(_args, "h", &itemNo)) *************** *** 241,244 **** --- 249,255 ---- DialogItemIndexZeroBased _rv; Point thePt; + #ifndef FindDialogItem + PyMac_PRECHECK(FindDialogItem); + #endif if (!PyArg_ParseTuple(_args, "O&", PyMac_GetPoint, &thePt)) *************** *** 254,257 **** --- 265,271 ---- { PyObject *_res = NULL; + #ifndef DialogCut + PyMac_PRECHECK(DialogCut); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 265,268 **** --- 279,285 ---- { PyObject *_res = NULL; + #ifndef DialogPaste + PyMac_PRECHECK(DialogPaste); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 276,279 **** --- 293,299 ---- { PyObject *_res = NULL; + #ifndef DialogCopy + PyMac_PRECHECK(DialogCopy); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 287,290 **** --- 307,313 ---- { PyObject *_res = NULL; + #ifndef DialogDelete + PyMac_PRECHECK(DialogDelete); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 302,305 **** --- 325,331 ---- Handle item; Rect box; + #ifndef GetDialogItem + PyMac_PRECHECK(GetDialogItem); + #endif if (!PyArg_ParseTuple(_args, "h", &itemNo)) *************** *** 324,327 **** --- 350,356 ---- Handle item; Rect box; + #ifndef SetDialogItem + PyMac_PRECHECK(SetDialogItem); + #endif if (!PyArg_ParseTuple(_args, "hhO&O&", &itemNo, *************** *** 346,349 **** --- 375,381 ---- SInt16 strtSel; SInt16 endSel; + #ifndef SelectDialogItemText + PyMac_PRECHECK(SelectDialogItemText); + #endif if (!PyArg_ParseTuple(_args, "hhh", &itemNo, *************** *** 365,368 **** --- 397,403 ---- Handle theHandle; DITLMethod method; + #ifndef AppendDITL + PyMac_PRECHECK(AppendDITL); + #endif if (!PyArg_ParseTuple(_args, "O&h", ResObj_Convert, &theHandle, *************** *** 381,384 **** --- 416,422 ---- PyObject *_res = NULL; DialogItemIndex _rv; + #ifndef CountDITL + PyMac_PRECHECK(CountDITL); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 393,396 **** --- 431,437 ---- PyObject *_res = NULL; DialogItemIndex numberItems; + #ifndef ShortenDITL + PyMac_PRECHECK(ShortenDITL); + #endif if (!PyArg_ParseTuple(_args, "h", &numberItems)) *************** *** 413,416 **** --- 454,460 ---- Handle itemHandle; Rect box; + #ifndef InsertDialogItem + PyMac_PRECHECK(InsertDialogItem); + #endif if (!PyArg_ParseTuple(_args, "hhO&O&", &afterItem, *************** *** 440,443 **** --- 484,490 ---- DialogItemIndex amountToRemove; Boolean disposeItemData; + #ifndef RemoveDialogItems + PyMac_PRECHECK(RemoveDialogItems); + #endif if (!PyArg_ParseTuple(_args, "hhb", &itemNo, *************** *** 462,465 **** --- 509,515 ---- EventRecord event; DialogItemIndex itemHit; + #ifndef StdFilterProc + PyMac_PRECHECK(StdFilterProc); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 479,482 **** --- 529,535 ---- OSErr _err; DialogItemIndex newItem; + #ifndef SetDialogDefaultItem + PyMac_PRECHECK(SetDialogDefaultItem); + #endif if (!PyArg_ParseTuple(_args, "h", &newItem)) *************** *** 495,498 **** --- 548,554 ---- OSErr _err; DialogItemIndex newItem; + #ifndef SetDialogCancelItem + PyMac_PRECHECK(SetDialogCancelItem); + #endif if (!PyArg_ParseTuple(_args, "h", &newItem)) *************** *** 511,514 **** --- 567,573 ---- OSErr _err; Boolean tracks; + #ifndef SetDialogTracksCursor + PyMac_PRECHECK(SetDialogTracksCursor); + #endif if (!PyArg_ParseTuple(_args, "b", &tracks)) *************** *** 526,529 **** --- 585,591 ---- PyObject *_res = NULL; OSErr _err; + #ifndef AutoSizeDialog + PyMac_PRECHECK(AutoSizeDialog); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 541,544 **** --- 603,609 ---- SInt16 inItemNo; ControlHandle outControl; + #ifndef GetDialogItemAsControl + PyMac_PRECHECK(GetDialogItemAsControl); + #endif if (!PyArg_ParseTuple(_args, "h", &inItemNo)) *************** *** 560,563 **** --- 625,631 ---- SInt16 inHoriz; SInt16 inVert; + #ifndef MoveDialogItem + PyMac_PRECHECK(MoveDialogItem); + #endif if (!PyArg_ParseTuple(_args, "hhh", &inItemNo, *************** *** 582,585 **** --- 650,656 ---- SInt16 inWidth; SInt16 inHeight; + #ifndef SizeDialogItem + PyMac_PRECHECK(SizeDialogItem); + #endif if (!PyArg_ParseTuple(_args, "hhh", &inItemNo, *************** *** 603,606 **** --- 674,680 ---- SInt16 ditlID; DITLMethod method; + #ifndef AppendDialogItemList + PyMac_PRECHECK(AppendDialogItemList); + #endif if (!PyArg_ParseTuple(_args, "hh", &ditlID, *************** *** 622,625 **** --- 696,702 ---- SInt16 inButtonToPress; UInt32 inSecondsToWait; + #ifndef SetDialogTimeout + PyMac_PRECHECK(SetDialogTimeout); + #endif if (!PyArg_ParseTuple(_args, "hl", &inButtonToPress, *************** *** 642,645 **** --- 719,725 ---- UInt32 outSecondsToWait; UInt32 outSecondsRemaining; + #ifndef GetDialogTimeout + PyMac_PRECHECK(GetDialogTimeout); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 661,664 **** --- 741,747 ---- OSStatus _err; EventMask inMask; + #ifndef SetModalDialogEventMask + PyMac_PRECHECK(SetModalDialogEventMask); + #endif if (!PyArg_ParseTuple(_args, "H", &inMask)) *************** *** 677,680 **** --- 760,766 ---- OSStatus _err; EventMask outMask; + #ifndef GetModalDialogEventMask + PyMac_PRECHECK(GetModalDialogEventMask); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 691,694 **** --- 777,783 ---- PyObject *_res = NULL; WindowPtr _rv; + #ifndef GetDialogWindow + PyMac_PRECHECK(GetDialogWindow); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 703,706 **** --- 792,798 ---- PyObject *_res = NULL; TEHandle _rv; + #ifndef GetDialogTextEditHandle + PyMac_PRECHECK(GetDialogTextEditHandle); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 715,718 **** --- 807,813 ---- PyObject *_res = NULL; SInt16 _rv; + #ifndef GetDialogDefaultItem + PyMac_PRECHECK(GetDialogDefaultItem); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 727,730 **** --- 822,828 ---- PyObject *_res = NULL; SInt16 _rv; + #ifndef GetDialogCancelItem + PyMac_PRECHECK(GetDialogCancelItem); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 739,742 **** --- 837,843 ---- PyObject *_res = NULL; SInt16 _rv; + #ifndef GetDialogKeyboardFocusItem + PyMac_PRECHECK(GetDialogKeyboardFocusItem); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 750,753 **** --- 851,857 ---- { PyObject *_res = NULL; + #ifndef SetPortDialogPort + PyMac_PRECHECK(SetPortDialogPort); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 762,765 **** --- 866,872 ---- PyObject *_res = NULL; CGrafPtr _rv; + #ifndef GetDialogPort + PyMac_PRECHECK(GetDialogPort); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 770,773 **** --- 877,897 ---- } + #if !TARGET_API_MAC_CARBON + + static PyObject *DlgObj_SetGrafPortOfDialog(DialogObject *_self, PyObject *_args) + { + PyObject *_res = NULL; + #ifndef SetGrafPortOfDialog + PyMac_PRECHECK(SetGrafPortOfDialog); + #endif + if (!PyArg_ParseTuple(_args, "")) + return NULL; + SetGrafPortOfDialog(_self->ob_itself); + Py_INCREF(Py_None); + _res = Py_None; + return _res; + } + #endif + static PyMethodDef DlgObj_methods[] = { {"DrawDialog", (PyCFunction)DlgObj_DrawDialog, 1, *************** *** 852,855 **** --- 976,983 ---- "() -> (CGrafPtr _rv)"}, + #if !TARGET_API_MAC_CARBON + {"SetGrafPortOfDialog", (PyCFunction)DlgObj_SetGrafPortOfDialog, 1, + "() -> None"}, + #endif {NULL, NULL, 0} }; *************** *** 879,883 **** PyTypeObject Dialog_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "Dialog", /*tp_name*/ --- 1007,1011 ---- PyTypeObject Dialog_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "Dialog", /*tp_name*/ *************** *** 912,915 **** --- 1040,1046 ---- SInt32 refCon; Handle items; + #ifndef NewDialog + PyMac_PRECHECK(NewDialog); + #endif if (!PyArg_ParseTuple(_args, "O&O&bhO&blO&", PyMac_GetRect, &boundsRect, *************** *** 942,945 **** --- 1073,1079 ---- SInt16 dialogID; WindowPtr behind; + #ifndef GetNewDialog + PyMac_PRECHECK(GetNewDialog); + #endif if (!PyArg_ParseTuple(_args, "hO&", &dialogID, *************** *** 966,969 **** --- 1100,1106 ---- SInt32 refCon; Handle items; + #ifndef NewColorDialog + PyMac_PRECHECK(NewColorDialog); + #endif if (!PyArg_ParseTuple(_args, "O&O&bhO&blO&", PyMac_GetRect, &boundsRect, *************** *** 995,998 **** --- 1132,1138 ---- PyObject* modalFilter; DialogItemIndex itemHit; + #ifndef ModalDialog + PyMac_PRECHECK(ModalDialog); + #endif if (!PyArg_ParseTuple(_args, "O", &modalFilter)) *************** *** 1010,1013 **** --- 1150,1156 ---- Boolean _rv; EventRecord theEvent; + #ifndef IsDialogEvent + PyMac_PRECHECK(IsDialogEvent); + #endif if (!PyArg_ParseTuple(_args, "O&", PyMac_GetEventRecord, &theEvent)) *************** *** 1026,1029 **** --- 1169,1175 ---- DialogPtr theDialog; DialogItemIndex itemHit; + #ifndef DialogSelect + PyMac_PRECHECK(DialogSelect); + #endif if (!PyArg_ParseTuple(_args, "O&", PyMac_GetEventRecord, &theEvent)) *************** *** 1045,1048 **** --- 1191,1197 ---- SInt16 alertID; PyObject* modalFilter; + #ifndef Alert + PyMac_PRECHECK(Alert); + #endif if (!PyArg_ParseTuple(_args, "hO", &alertID, *************** *** 1062,1065 **** --- 1211,1217 ---- SInt16 alertID; PyObject* modalFilter; + #ifndef StopAlert + PyMac_PRECHECK(StopAlert); + #endif if (!PyArg_ParseTuple(_args, "hO", &alertID, *************** *** 1079,1082 **** --- 1231,1237 ---- SInt16 alertID; PyObject* modalFilter; + #ifndef NoteAlert + PyMac_PRECHECK(NoteAlert); + #endif if (!PyArg_ParseTuple(_args, "hO", &alertID, *************** *** 1096,1099 **** --- 1251,1257 ---- SInt16 alertID; PyObject* modalFilter; + #ifndef CautionAlert + PyMac_PRECHECK(CautionAlert); + #endif if (!PyArg_ParseTuple(_args, "hO", &alertID, *************** *** 1114,1117 **** --- 1272,1278 ---- Str255 param2; Str255 param3; + #ifndef ParamText + PyMac_PRECHECK(ParamText); + #endif if (!PyArg_ParseTuple(_args, "O&O&O&O&", PyMac_GetStr255, param0, *************** *** 1134,1137 **** --- 1295,1301 ---- Handle item; Str255 text; + #ifndef GetDialogItemText + PyMac_PRECHECK(GetDialogItemText); + #endif if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &item)) *************** *** 1149,1152 **** --- 1313,1319 ---- Handle item; Str255 text; + #ifndef SetDialogItemText + PyMac_PRECHECK(SetDialogItemText); + #endif if (!PyArg_ParseTuple(_args, "O&O&", ResObj_Convert, &item, *************** *** 1164,1167 **** --- 1331,1337 ---- PyObject *_res = NULL; SInt16 _rv; + #ifndef GetAlertStage + PyMac_PRECHECK(GetAlertStage); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 1176,1179 **** --- 1346,1352 ---- PyObject *_res = NULL; SInt16 fontNum; + #ifndef SetDialogFont + PyMac_PRECHECK(SetDialogFont); + #endif if (!PyArg_ParseTuple(_args, "h", &fontNum)) *************** *** 1188,1191 **** --- 1361,1367 ---- { PyObject *_res = NULL; + #ifndef ResetAlertStage + PyMac_PRECHECK(ResetAlertStage); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 1205,1208 **** --- 1381,1387 ---- Str255 param2; Str255 param3; + #ifndef GetParamText + PyMac_PRECHECK(GetParamText); + #endif if (!PyArg_ParseTuple(_args, "O&O&O&O&", PyMac_GetStr255, param0, *************** *** 1234,1237 **** --- 1413,1419 ---- Handle inItemListHandle; UInt32 inFlags; + #ifndef NewFeaturesDialog + PyMac_PRECHECK(NewFeaturesDialog); + #endif if (!PyArg_ParseTuple(_args, "O&O&bhO&blO&l", PyMac_GetRect, &inBoundsRect, *************** *** 1265,1268 **** --- 1447,1453 ---- DialogPtr _rv; WindowPtr window; + #ifndef GetDialogFromWindow + PyMac_PRECHECK(GetDialogFromWindow); + #endif if (!PyArg_ParseTuple(_args, "O&", WinObj_Convert, &window)) From jackjansen@users.sourceforge.net Thu Nov 29 13:23:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:23:38 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/ctl _Ctlmodule.c,1.3,1.3.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/ctl In directory usw-pr-cvs1:/tmp/cvs-serv23311/Python/Mac/Modules/ctl Modified Files: Tag: r22b2-branch _Ctlmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Ctlmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/ctl/_Ctlmodule.c,v retrieving revision 1.3 retrieving revision 1.3.8.1 diff -C2 -d -r1.3 -r1.3.8.1 *** _Ctlmodule.c 2001/09/05 10:30:48 1.3 --- _Ctlmodule.c 2001/11/29 13:23:36 1.3.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ [...1014 lines suppressed...] *************** *** 2412,2415 **** --- 2708,2714 ---- WindowPtr theWindow; Boolean tracks; + #ifndef IsAutomaticControlDragTrackingEnabledForWindow + PyMac_PRECHECK(IsAutomaticControlDragTrackingEnabledForWindow); + #endif if (!PyArg_ParseTuple(_args, "O&", WinObj_Convert, &theWindow)) *************** *** 2429,2432 **** --- 2728,2734 ---- ControlHandle _rv; Handle h; + #ifndef as_Control + PyMac_PRECHECK(as_Control); + #endif if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &h)) From jackjansen@users.sourceforge.net Thu Nov 29 13:23:44 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:23:44 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/cm _Cmmodule.c,1.3,1.3.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/cm In directory usw-pr-cvs1:/tmp/cvs-serv23359/Python/Mac/Modules/cm Modified Files: Tag: r22b2-branch _Cmmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Cmmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/cm/_Cmmodule.c,v retrieving revision 1.3 retrieving revision 1.3.8.1 diff -C2 -d -r1.3 -r1.3.8.1 *** _Cmmodule.c 2001/09/05 10:30:53 1.3 --- _Cmmodule.c 2001/11/29 13:23:42 1.3.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 292,296 **** PyTypeObject ComponentInstance_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "ComponentInstance", /*tp_name*/ --- 288,292 ---- PyTypeObject ComponentInstance_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "ComponentInstance", /*tp_name*/ *************** *** 619,623 **** PyTypeObject Component_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "Component", /*tp_name*/ --- 615,619 ---- PyTypeObject Component_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "Component", /*tp_name*/ From jackjansen@users.sourceforge.net Thu Nov 29 13:23:56 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:23:56 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/cf _CFmodule.c,1.5,1.5.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/cf In directory usw-pr-cvs1:/tmp/cvs-serv23392/Python/Mac/Modules/cf Modified Files: Tag: r22b2-branch _CFmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _CFmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/cf/_CFmodule.c,v retrieving revision 1.5 retrieving revision 1.5.2.1 diff -C2 -d -r1.5 -r1.5.2.1 *** _CFmodule.c 2001/11/05 14:39:05 1.5 --- _CFmodule.c 2001/11/29 13:23:53 1.5.2.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ [...1061 lines suppressed...] *************** *** 3042,3046 **** --- 3224,3230 ---- PyObject *_res = NULL; CFTypeID _rv; + #ifndef CFURLGetTypeID PyMac_PRECHECK(CFURLGetTypeID); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 3060,3064 **** --- 3244,3250 ---- CFStringEncoding encoding; CFURLRef baseURL; + #ifndef CFURLCreateWithBytes PyMac_PRECHECK(CFURLCreateWithBytes); + #endif if (!PyArg_ParseTuple(_args, "s#lO&", &URLBytes__in__, &URLBytes__in_len__, From jackjansen@users.sourceforge.net Thu Nov 29 13:23:01 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:23:01 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/icn _Icnmodule.c,1.2,1.2.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/icn In directory usw-pr-cvs1:/tmp/cvs-serv23064/Python/Mac/Modules/icn Modified Files: Tag: r22b2-branch _Icnmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Icnmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/icn/_Icnmodule.c,v retrieving revision 1.2 retrieving revision 1.2.8.1 diff -C2 -d -r1.2 -r1.2.8.1 *** _Icnmodule.c 2001/09/05 10:30:09 1.2 --- _Icnmodule.c 2001/11/29 13:22:58 1.2.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- From jackjansen@users.sourceforge.net Thu Nov 29 13:23:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:23:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/help _Helpmodule.c,1.2,1.2.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/help In directory usw-pr-cvs1:/tmp/cvs-serv23127/Python/Mac/Modules/help Modified Files: Tag: r22b2-branch _Helpmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Helpmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/help/_Helpmodule.c,v retrieving revision 1.2 retrieving revision 1.2.8.1 diff -C2 -d -r1.2 -r1.2.8.1 *** _Helpmodule.c 2001/09/05 10:30:13 1.2 --- _Helpmodule.c 2001/11/29 13:23:03 1.2.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- From jackjansen@users.sourceforge.net Thu Nov 29 13:24:10 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:24:10 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/ae _AEmodule.c,1.4,1.4.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/ae In directory usw-pr-cvs1:/tmp/cvs-serv23513/Python/Mac/Modules/ae Modified Files: Tag: r22b2-branch _AEmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _AEmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/ae/_AEmodule.c,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -C2 -d -r1.4 -r1.4.8.1 *** _AEmodule.c 2001/09/05 10:31:13 1.4 --- _AEmodule.c 2001/11/29 13:24:07 1.4.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 785,789 **** PyTypeObject AEDesc_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "AEDesc", /*tp_name*/ --- 781,785 ---- PyTypeObject AEDesc_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "AEDesc", /*tp_name*/ From jackjansen@users.sourceforge.net Thu Nov 29 13:24:03 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:24:03 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/app _Appmodule.c,1.2,1.2.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/app In directory usw-pr-cvs1:/tmp/cvs-serv23444/Python/Mac/Modules/app Modified Files: Tag: r22b2-branch _Appmodule.c Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: _Appmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/app/_Appmodule.c,v retrieving revision 1.2 retrieving revision 1.2.8.1 diff -C2 -d -r1.2 -r1.2.8.1 *** _Appmodule.c 2001/09/05 10:31:07 1.2 --- _Appmodule.c 2001/11/29 13:24:01 1.2.8.1 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- From jackjansen@users.sourceforge.net Thu Nov 29 13:32:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:32:36 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/win winsupport.py,1.28,1.28.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/win In directory usw-pr-cvs1:/tmp/cvs-serv26090/Python/Mac/Modules/win Modified Files: Tag: r22b2-branch winsupport.py Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: winsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/win/winsupport.py,v retrieving revision 1.28 retrieving revision 1.28.2.1 diff -C2 -d -r1.28 -r1.28.2.1 *** winsupport.py 2001/11/05 16:16:15 1.28 --- winsupport.py 2001/11/29 13:32:34 1.28.2.1 *************** *** 196,201 **** # Create the generator classes used to populate the lists ! Function = OSErrFunctionGenerator ! Method = OSErrMethodGenerator # Create and populate the lists --- 196,201 ---- # Create the generator classes used to populate the lists ! Function = OSErrWeakLinkFunctionGenerator ! Method = OSErrWeakLinkMethodGenerator # Create and populate the lists From jackjansen@users.sourceforge.net Thu Nov 29 13:32:41 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:32:41 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/menu menusupport.py,1.12,1.12.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/menu In directory usw-pr-cvs1:/tmp/cvs-serv26124/Python/Mac/Modules/menu Modified Files: Tag: r22b2-branch menusupport.py Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: menusupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/menu/menusupport.py,v retrieving revision 1.12 retrieving revision 1.12.8.1 diff -C2 -d -r1.12 -r1.12.8.1 *** menusupport.py 2001/08/23 13:50:01 1.12 --- menusupport.py 2001/11/29 13:32:39 1.12.8.1 *************** *** 82,87 **** # Create the generator classes used to populate the lists ! Function = OSErrFunctionGenerator ! Method = OSErrMethodGenerator # Create and populate the lists --- 82,87 ---- # Create the generator classes used to populate the lists ! Function = OSErrWeakLinkFunctionGenerator ! Method = OSErrWeakLinkMethodGenerator # Create and populate the lists From jackjansen@users.sourceforge.net Thu Nov 29 13:32:48 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:32:48 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/dlg dlgsupport.py,1.26,1.26.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/dlg In directory usw-pr-cvs1:/tmp/cvs-serv26181/Python/Mac/Modules/dlg Modified Files: Tag: r22b2-branch dlgsupport.py Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: dlgsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/dlg/dlgsupport.py,v retrieving revision 1.26 retrieving revision 1.26.2.1 diff -C2 -d -r1.26 -r1.26.2.1 *** dlgsupport.py 2001/11/05 16:16:39 1.26 --- dlgsupport.py 2001/11/29 13:32:46 1.26.2.1 *************** *** 246,251 **** # Create the generator classes used to populate the lists ! Function = OSErrFunctionGenerator ! Method = OSErrMethodGenerator # Create and populate the lists --- 246,251 ---- # Create the generator classes used to populate the lists ! Function = OSErrWeakLinkFunctionGenerator ! Method = OSErrWeakLinkMethodGenerator # Create and populate the lists From jackjansen@users.sourceforge.net Thu Nov 29 13:32:54 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:32:54 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/ctl ctlsupport.py,1.42,1.42.8.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/ctl In directory usw-pr-cvs1:/tmp/cvs-serv26218/Python/Mac/Modules/ctl Modified Files: Tag: r22b2-branch ctlsupport.py Log Message: Use the WeakLink generators where it makes sense. This allows the resulting module to be imported on older versions of MacOS that do not support all routines encasulated in the module. Using a routine thats unavailable results in a RuntimeError, "Routine not available on this platform". Index: ctlsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/ctl/ctlsupport.py,v retrieving revision 1.42 retrieving revision 1.42.8.1 diff -C2 -d -r1.42 -r1.42.8.1 *** ctlsupport.py 2001/09/05 10:31:42 1.42 --- ctlsupport.py 2001/11/29 13:32:52 1.42.8.1 *************** *** 337,342 **** # Create the generator classes used to populate the lists ! Function = OSErrFunctionGenerator ! Method = OSErrMethodGenerator # Create and populate the lists --- 337,342 ---- # Create the generator classes used to populate the lists ! Function = OSErrWeakLinkFunctionGenerator ! Method = OSErrWeakLinkMethodGenerator # Create and populate the lists From jackjansen@users.sourceforge.net Thu Nov 29 13:33:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:33:38 -0800 Subject: [Python-checkins] CVS: python/dist/src/Tools/bgen/bgen macsupport.py,1.23,1.23.12.1 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/bgen/bgen In directory usw-pr-cvs1:/tmp/cvs-serv26473/Python/Tools/bgen/bgen Modified Files: Tag: r22b2-branch macsupport.py Log Message: Changed the weaklink generators so they can handle macros (by not testing). Index: macsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/macsupport.py,v retrieving revision 1.23 retrieving revision 1.23.12.1 diff -C2 -d -r1.23 -r1.23.12.1 *** macsupport.py 2001/07/01 22:09:29 1.23 --- macsupport.py 2001/11/29 13:33:36 1.23.12.1 *************** *** 158,162 **** --- 158,164 ---- def precheck(self): + Output('#ifndef %s', self.name) Output('PyMac_PRECHECK(%s);', self.name) + Output('#endif') class WeakLinkFunctionGenerator(WeakLinkMixIn, FunctionGenerator): pass From jackjansen@users.sourceforge.net Thu Nov 29 13:35:19 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:35:19 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/mkcwproject/template-carbon template.prj.xml,1.3.2.3,1.3.2.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-carbon In directory usw-pr-cvs1:/tmp/cvs-serv26964/Python/Mac/Lib/mkcwproject/template-carbon Modified Files: Tag: r22b2-branch template.prj.xml Log Message: Silly error in weaklink support. Index: template.prj.xml =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-carbon/template.prj.xml,v retrieving revision 1.3.2.3 retrieving revision 1.3.2.4 diff -C2 -d -r1.3.2.3 -r1.3.2.4 *** template.prj.xml 2001/11/26 23:04:53 1.3.2.3 --- template.prj.xml 2001/11/29 13:35:16 1.3.2.4 *************** *** 980,985 **** CarbonLib MacOS ! %(stdlibraryflags)s ! --- 980,985 ---- CarbonLib MacOS ! Library ! %(stdlibraryflags)s From jackjansen@users.sourceforge.net Thu Nov 29 13:35:52 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Thu, 29 Nov 2001 05:35:52 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac ReadMe,1.36,1.36.2.1 Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory usw-pr-cvs1:/tmp/cvs-serv27134/Python/Mac Modified Files: Tag: r22b2-branch ReadMe Log Message: Tweaks for MacPython 2.2b2 Index: ReadMe =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/ReadMe,v retrieving revision 1.36 retrieving revision 1.36.2.1 diff -C2 -d -r1.36 -r1.36.2.1 *** ReadMe 2001/10/31 10:13:52 1.36 --- ReadMe 2001/11/29 13:35:50 1.36.2.1 *************** *** 1,3 **** ! How to install Python 2.2b1 on your Macintosh --------------------------------------------- --- 1,3 ---- ! How to install Python 2.2b2 on your Macintosh --------------------------------------------- *************** *** 129,137 **** Python and "import test.regrtest ; test.regrtest.main()". test_time will fail because MacPython accepts bogus values for mktime(), this will be fixed later (it is not a very serious problem). - test_descrtut will fail because of a problem with the test itself. - Three tests will fail on MacOS9 with MemoryErrors: test_longexp, test_sha and test_zlib (on MacOSX these should pass). --- 129,138 ---- Python and "import test.regrtest ; test.regrtest.main()". + test_frozen will fail in MacPython because of different handling on + frozen modules. This should not be a problem in normal use. + test_time will fail because MacPython accepts bogus values for mktime(), this will be fixed later (it is not a very serious problem). Three tests will fail on MacOS9 with MemoryErrors: test_longexp, test_sha and test_zlib (on MacOSX these should pass). *************** *** 161,165 **** Two items are installed in the system folder: the interpreter shared libraries PythonCore and PythonCoreCarbon lives in the Extensions ! folder and the "Python 2.2b1 Preferences" file in the Python subfolder in the Preferences folder. All the rest of Python lives in the folder you installed in. --- 162,166 ---- Two items are installed in the system folder: the interpreter shared libraries PythonCore and PythonCoreCarbon lives in the Extensions ! folder and the "Python 2.2b2 Preferences" file in the Python subfolder in the Preferences folder. All the rest of Python lives in the folder you installed in. *************** *** 211,217 **** are lost and you have to set them again. ! After you are satisfied that 2.2b1 works as expected you can trash anything in the system folder that has "python" in the name and not ! "2.2b1". The ConfigurePython... applets will try to detect incompatible --- 212,218 ---- are lost and you have to set them again. ! After you are satisfied that 2.2b2 works as expected you can trash anything in the system folder that has "python" in the name and not ! "2.2b2". The ConfigurePython... applets will try to detect incompatible From loewis@users.sourceforge.net Thu Nov 29 18:08:33 2001 From: loewis@users.sourceforge.net (Martin v. L?wis) Date: Thu, 29 Nov 2001 10:08:33 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules gcmodule.c,2.30,2.31 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv517 Modified Files: gcmodule.c Log Message: Use identity instead of equality when looking for referrers. Fixes #485781. Index: gcmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/gcmodule.c,v retrieving revision 2.30 retrieving revision 2.31 diff -C2 -d -r2.30 -r2.31 *** gcmodule.c 2001/11/24 09:24:51 2.30 --- gcmodule.c 2001/11/29 18:08:31 2.31 *************** *** 651,657 **** referrersvisit(PyObject* obj, PyObject *objs) { ! if (PySequence_Contains(objs, obj)) { ! return 1; ! } return 0; } --- 651,658 ---- referrersvisit(PyObject* obj, PyObject *objs) { ! int i; ! for (i = 0; i < PyTuple_GET_SIZE(objs); i++) ! if (PyTuple_GET_ITEM(objs, i) == obj) ! return 1; return 0; } From fdrake@users.sourceforge.net Thu Nov 29 19:04:52 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 29 Nov 2001 11:04:52 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libdifflib.tex,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv16829/lib Modified Files: libdifflib.tex Log Message: writeline() --> writelines() This closes SF bug #487147. Index: libdifflib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libdifflib.tex,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** libdifflib.tex 2001/10/26 03:04:23 1.10 --- libdifflib.tex 2001/11/29 19:04:50 1.11 *************** *** 467,471 **** \method{readlines()} method of file-like objects. The delta generated also consists of newline-terminated strings, ready to be printed as-is ! via the \method{writeline()} method of a file-like object. \end{methoddesc} --- 467,471 ---- \method{readlines()} method of file-like objects. The delta generated also consists of newline-terminated strings, ready to be printed as-is ! via the \method{writelines()} method of a file-like object. \end{methoddesc} From fdrake@users.sourceforge.net Thu Nov 29 20:23:16 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 29 Nov 2001 12:23:16 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libre.tex,1.72,1.73 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv7584/lib Modified Files: libre.tex Log Message: Neil Schemenauer suggested a small improvement to one of the example REs. Index: libre.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libre.tex,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** libre.tex 2001/11/29 08:45:22 1.72 --- libre.tex 2001/11/29 20:23:14 1.73 *************** *** 823,827 **** {\regexp{0[0-7]*}} \lineii{\code{\%s}} ! {\regexp{[\textasciicircum\e s]+}} \lineii{\code{\%u}} {\regexp{\e d+}} --- 823,827 ---- {\regexp{0[0-7]*}} \lineii{\code{\%s}} ! {\regexp{\e S+}} \lineii{\code{\%u}} {\regexp{\e d+}} From fdrake@users.sourceforge.net Thu Nov 29 20:48:46 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 29 Nov 2001 12:48:46 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libos.tex,1.71,1.72 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv15265/lib Modified Files: libos.tex Log Message: Various cleanups & markup fixes, mostly relating to the stat and statvfs result object changes. Index: libos.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libos.tex,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -d -r1.71 -r1.72 *** libos.tex 2001/11/28 07:26:15 1.71 --- libos.tex 2001/11/29 20:48:44 1.72 *************** *** 60,72 **** attribute, \member{filename}, which is the file name passed to the function. - - When exceptions are strings, the string for the exception is - \code{'OSError'}. \end{excdesc} \begin{datadesc}{name} The name of the operating system dependent module imported. The ! following names have currently been registered: \code{'posix'}, \code{'nt'}, ! \code{'dos'}, \code{'mac'}, \code{'os2'}, \code{'ce'}, \code{'java'}. \end{datadesc} --- 60,70 ---- attribute, \member{filename}, which is the file name passed to the function. \end{excdesc} \begin{datadesc}{name} The name of the operating system dependent module imported. The ! following names have currently been registered: \code{'posix'}, ! \code{'nt'}, \code{'dos'}, \code{'mac'}, \code{'os2'}, \code{'ce'}, ! \code{'java'}, \code{'riscos'}. \end{datadesc} *************** *** 746,792 **** \begin{funcdesc}{stat}{path} Perform a \cfunction{stat()} system call on the given path. The ! return value is a tuple of at least 10 integers giving the most ! important (and portable) members of the \emph{stat} structure, in the order ! \code{st_mode}, ! \code{st_ino}, ! \code{st_dev}, ! \code{st_nlink}, ! \code{st_uid}, ! \code{st_gid}, ! \code{st_size}, ! \code{st_atime}, ! \code{st_mtime}, ! \code{st_ctime}. More items may be added at the end by some implementations. Note that on the Mac OS, the time values are floating point values, like all time values on the Mac OS. (On Windows, some items are filled with dummy values.) Availability: Macintosh, \UNIX, Windows. ! Note: The standard module \refmodule{stat}\refstmodindex{stat} defines ! functions and constants that are useful for extracting information ! from a \ctype{stat} structure. \end{funcdesc} \begin{funcdesc}{statvfs}{path} Perform a \cfunction{statvfs()} system call on the given path. The ! return value is a tuple of 10 integers giving the most common ! members of the \ctype{statvfs} structure, in the order ! \code{f_bsize}, ! \code{f_frsize}, ! \code{f_blocks}, ! \code{f_bfree}, ! \code{f_bavail}, ! \code{f_files}, ! \code{f_ffree}, ! \code{f_favail}, ! \code{f_flag}, ! \code{f_namemax}. Availability: \UNIX. ! Note: The standard module \module{statvfs}\refstmodindex{statvfs} defines constants that are useful for extracting information ! from a \ctype{statvfs} structure. \end{funcdesc} --- 744,830 ---- \begin{funcdesc}{stat}{path} Perform a \cfunction{stat()} system call on the given path. The ! return value is an object whose attributes correspond to the members of ! the \ctype{stat} structure, namely: ! \member{st_mode} (protection bits), ! \member{st_ino} (inode number), ! \member{st_dev} (device), ! \member{st_nlink} (number of hard links, ! \member{st_uid} (user ID of owner), ! \member{st_gid} (group ID of owner), ! \member{st_size} (size of file, in bytes), ! \member{st_atime} (time of most recent access), ! \member{st_mtime} (time of most recent content modification), ! \member{st_ctime} ! (time of most recent content modification or metadata change). ! ! On some Unix systems (such as Linux), the following attributes may ! also be available: ! \member{st_blocks} (number of blocks allocated for file), ! \member{st_blksize} (filesystem blocksize), ! \member{st_rdev} (type of device if an inode device). ! ! On Mac OS systems, the following attributes may also be available: ! \member{st_rsize}, ! \member{st_creator}, ! \member{st_type}. ! ! On RISCOS systems, the following attributes are also available: ! \member{st_ftype} (file type), ! \member{st_attrs} (attributes), ! \member{st_obtype} (object type). ! ! For backward compatibility, the return value of \function{stat()} is ! also accessible as a tuple of at least 10 integers giving the most ! important (and portable) members of the \ctype{stat} structure, in the order ! \member{st_mode}, ! \member{st_ino}, ! \member{st_dev}, ! \member{st_nlink}, ! \member{st_uid}, ! \member{st_gid}, ! \member{st_size}, ! \member{st_atime}, ! \member{st_mtime}, ! \member{st_ctime}. More items may be added at the end by some implementations. Note that on the Mac OS, the time values are floating point values, like all time values on the Mac OS. + The standard module \refmodule{stat}\refstmodindex{stat} defines + functions and constants that are useful for extracting information + from a \ctype{stat} structure. (On Windows, some items are filled with dummy values.) Availability: Macintosh, \UNIX, Windows. ! \versionchanged ! [Added access to values as attributes of the returned object]{2.2} \end{funcdesc} \begin{funcdesc}{statvfs}{path} Perform a \cfunction{statvfs()} system call on the given path. The ! return value is an object whose attributes describe the filesystem on ! the given path, and correspond to the members of the ! \ctype{statvfs} structure, namely: ! \member{f_frsize}, ! \member{f_blocks}, ! \member{f_bfree}, ! \member{f_bavail}, ! \member{f_files}, ! \member{f_ffree}, ! \member{f_favail}, ! \member{f_flag}, ! \member{f_namemax}. Availability: \UNIX. ! For backward compatibility, the return value is also accessible as a ! tuple whose values correspond to the attributes, in the order given above. ! The standard module \refmodule{statvfs}\refstmodindex{statvfs} defines constants that are useful for extracting information ! from a \ctype{statvfs} structure when accessing it as a sequence; this ! remains useful when writing code that needs to work with versions of ! Python that don't support accessing the fields as attributes. ! ! \versionchanged ! [Added access to values as attributes of the returned object]{2.2} \end{funcdesc} *************** *** 934,938 **** controlling terminal. Return a pair of \code{(\var{pid}, \var{fd})}, where \var{pid} is \code{0} in the child, the new child's process id ! in the parent, and \code{fd} is the file descriptor of the master end of the pseudo-terminal. For a more portable approach, use the \refmodule{pty} module. --- 972,976 ---- controlling terminal. Return a pair of \code{(\var{pid}, \var{fd})}, where \var{pid} is \code{0} in the child, the new child's process id ! in the parent, and \var{fd} is the file descriptor of the master end of the pseudo-terminal. For a more portable approach, use the \refmodule{pty} module. *************** *** 1267,1272 **** \begin{datadesc}{defpath} ! The default search path used by \function{exec*p*()} if the environment ! doesn't have a \code{'PATH'} key. \end{datadesc} --- 1305,1311 ---- \begin{datadesc}{defpath} ! The default search path used by \function{exec*p*()} and ! \function{spawn*p*()} if the environment doesn't have a \code{'PATH'} ! key. \end{datadesc} *************** *** 1274,1278 **** The string used to separate (or, rather, terminate) lines on the current platform. This may be a single character, such as \code{'\e ! n'} for \POSIX{} or \code{'\e r'} for the Mac OS, or multiple characters, for example, \code{'\e r\e n'} for DOS and Windows. \end{datadesc} --- 1313,1317 ---- The string used to separate (or, rather, terminate) lines on the current platform. This may be a single character, such as \code{'\e ! n'} for \POSIX{} or \code{'\e r'} for Mac OS, or multiple characters, for example, \code{'\e r\e n'} for DOS and Windows. \end{datadesc} From fdrake@users.sourceforge.net Thu Nov 29 21:09:10 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 29 Nov 2001 13:09:10 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib tkinter.tex,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv21926/lib Modified Files: tkinter.tex Log Message: More information about Tix support, contributed by Mike Clarkson. Index: tkinter.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/tkinter.tex,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tkinter.tex 2001/11/28 07:26:15 1.4 --- tkinter.tex 2001/11/29 21:09:08 1.5 *************** *** 1404,1407 **** --- 1404,1508 ---- %end{latexonly} + \subsection{Tix Commands} + + \begin{classdesc}{tixCommand}{} + The \ulink{tix commands} + {http://tix.sourceforge.net/dist/current/man/html/TixCmd/tix.htm} + provide access to miscellaneous elements of \refmodule{Tix}'s internal + state and the \refmodule{Tix} application context. Most of the information + manipulated by these methods pertains to the application as a whole, + or to a screen or display, rather than to a particular window. + + To view the current settings, the common usage is: + \begin{verbatim} + import Tix + root = Tix.Tk() + print root.tix_configure() + \end{verbatim} + \end{classdesc} + + \begin{methoddesc}{tix_configure}{\optional{cnf,} **kw} + Query or modify the configuration options of the Tix application + context. If no option is specified, returns a dictionary all of the + available options. If option is specified with no value, then the + method returns a list describing the one named option (this list will + be identical to the corresponding sublist of the value returned if no + option is specified). If one or more option-value pairs are + specified, then the method modifies the given option(s) to have the + given value(s); in this case the method returns an empty string. + Option may be any of the configuration options. + \end{methoddesc} + + \begin{methoddesc}{tix_cget}{option} + Returns the current value of the configuration option given by + \var{option}. Option may be any of the configuration options. + \end{methoddesc} + + \begin{methoddesc}{tix_getbitmap}{name} + Locates a bitmap file of the name \code{name.xpm} or \code{name} in + one of the bitmap directories (see the \method{tix_addbitmapdir()} + method). By using \method{tix_getbitmap()}, you can avoid hard + coding the pathnames of the bitmap files in your application. When + successful, it returns the complete pathname of the bitmap file, + prefixed with the character \samp{@}. The returned value can be used to + configure the \code{bitmap} option of the Tk and Tix widgets. + \end{methoddesc} + + \begin{methoddesc}{tix_addbitmapdir}{directory} + Tix maintains a list of directories under which the + \method{tix_getimage()} and \method{tix_getbitmap()} methods will + search for image files. The standard bitmap directory is + \file{\$TIX_LIBRARY/bitmaps}. The \method{tix_addbitmapdir()} method + adds \var{directory} into this list. By using this method, the image + files of an applications can also be located using the + \method{tix_getimage()} or \method{tix_getbitmap()} method. + \end{methoddesc} + + \begin{methoddesc}{tix_filedialog}{\optional{dlgclass}} + Returns the file selection dialog that may be shared among different + calls from this application. This method will create a file selection + dialog widget when it is called the first time. This dialog will be + returned by all subsequent calls to \method{tix_filedialog()}. An + optional dlgclass parameter can be passed as a string to specified + what type of file selection dialog widget is desired. Possible + options are \code{tix}, \code{FileSelectDialog} or + \code{tixExFileSelectDialog}. + \end{methoddesc} + + + \begin{methoddesc}{tix_getimage}{self, name} + Locates an image file of the name \file{name.xpm}, \file{name.xbm} or + \file{name.ppm} in one of the bitmap directories (see the + \method{tix_addbitmapdir()} method above). If more than one file with + the same name (but different extensions) exist, then the image type is + chosen according to the depth of the X display: xbm images are chosen + on monochrome displays and color images are chosen on color + displays. By using \method{tix_getimage()}, you can avoid hard coding + the pathnames of the image files in your application. When successful, + this method returns the name of the newly created image, which can be + used to configure the \code{image} option of the Tk and Tix widgets. + \end{methoddesc} + + \begin{methoddesc}{tix_option_get}{name} + Gets the options manitained by the Tix scheme mechanism. + \end{methoddesc} + + \begin{methoddesc}{tix_resetoptions}{newScheme, newFontSet\optional{, + newScmPrio}} + Resets the scheme and fontset of the Tix application to + \var{newScheme} and \var{newFontSet}, respectively. This affects only + those widgets created after this call. Therefore, it is best to call + the resetoptions method before the creation of any widgets in a Tix + application. + + The optional parameter \var{newScmPrio} can be given to reset the + priority level of the Tk options set by the Tix schemes. + + Because of the way Tk handles the X option database, after Tix has + been has imported and inited, it is not possible to reset the color + schemes and font sets using the \method{tix_config()} method. + Instead, the \method{tix_resetoptions()} method must be used. + \end{methoddesc} + \input{libturtle} From fdrake@users.sourceforge.net Thu Nov 29 22:43:01 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 29 Nov 2001 14:43:01 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/api concrete.tex,1.2,1.3 refcounts.dat,1.37,1.38 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/api In directory usw-pr-cvs1:/tmp/cvs-serv18035/api Modified Files: concrete.tex refcounts.dat Log Message: Update the signature of PyFile_WriteString(). Index: concrete.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/concrete.tex,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** concrete.tex 2001/11/26 21:29:17 1.2 --- concrete.tex 2001/11/29 22:42:59 1.3 *************** *** 1933,1937 **** \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 --- 1933,1937 ---- \end{cfuncdesc} ! \begin{cfuncdesc}{int}{PyFile_WriteString}{const 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 Index: refcounts.dat =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/api/refcounts.dat,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** refcounts.dat 2001/11/26 21:29:17 1.37 --- refcounts.dat 2001/11/29 22:42:59 1.38 *************** *** 315,319 **** PyFile_WriteString:int::: ! PyFile_WriteString:char*:s:: PyFile_WriteString:PyFileObject*:p:0: PyFile_WriteString:int:flags:: --- 315,319 ---- PyFile_WriteString:int::: ! PyFile_WriteString:const char*:s:: PyFile_WriteString:PyFileObject*:p:0: PyFile_WriteString:int:flags:: From fdrake@users.sourceforge.net Fri Nov 30 06:06:42 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 29 Nov 2001 22:06:42 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc ACKS,1.30,1.31 Message-ID: Update of /cvsroot/python/python/dist/src/Doc In directory usw-pr-cvs1:/tmp/cvs-serv30102 Modified Files: ACKS Log Message: Updated documentation for the new httplib interface, by Kalle Svensson. This closes SF bug #458447. Index: ACKS =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/ACKS,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** ACKS 2001/11/19 04:35:58 1.30 --- ACKS 2001/11/30 06:06:40 1.31 *************** *** 168,171 **** --- 168,172 ---- Mark Summerfield Reuben Sumner + Kalle Svensson Jim Tittsler Martijn Vries From fdrake@users.sourceforge.net Fri Nov 30 06:06:42 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Thu, 29 Nov 2001 22:06:42 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib libhttplib.tex,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv30102/lib Modified Files: libhttplib.tex Log Message: Updated documentation for the new httplib interface, by Kalle Svensson. This closes SF bug #458447. Index: libhttplib.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libhttplib.tex,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** libhttplib.tex 2001/11/09 05:03:05 1.27 --- libhttplib.tex 2001/11/30 06:06:40 1.28 *************** *** 14,71 **** support.} ! The module defines one class, \class{HTTP}: ! \begin{classdesc}{HTTP}{\optional{host\optional{, port}}} ! An \class{HTTP} instance ! represents one transaction with an HTTP server. It should be ! instantiated passing it a host and optional port number. If no port ! number is passed, the port is extracted from the host string if it has ! the form \code{\var{host}:\var{port}}, else the default HTTP port (80) ! is used. If no host is passed, no connection is made, and the ! \method{connect()} method should be used to connect to a server. For ! example, the following calls all create instances that connect to the ! server at the same host and port: \begin{verbatim} ! >>> h1 = httplib.HTTP('www.cwi.nl') ! >>> h2 = httplib.HTTP('www.cwi.nl:80') ! >>> h3 = httplib.HTTP('www.cwi.nl', 80) \end{verbatim} ! Once an \class{HTTP} instance has been connected to an HTTP server, it ! should be used as follows: ! \begin{enumerate} ! \item Make exactly one call to the \method{putrequest()} method. ! \item Make zero or more calls to the \method{putheader()} method. ! \item Call the \method{endheaders()} method (this can be omitted if ! step 4 makes no calls). ! \item Optional calls to the \method{send()} method. ! \item Call the \method{getreply()} method. ! \item Call the \method{getfile()} method and read the data off the ! file object that it returns. ! \end{enumerate} ! \end{classdesc} ! \begin{datadesc}{HTTP_PORT} ! The default port for the HTTP protocol (always \code{80}). ! \end{datadesc} ! \begin{datadesc}{HTTPS_PORT} ! The default port for the HTTPS protocol (always \code{443}). ! \end{datadesc} ! \subsection{HTTP Objects \label{http-objects}} ! \class{HTTP} instances have the following methods: \begin{methoddesc}{set_debuglevel}{level} --- 14,119 ---- support.} ! The constants defined in this module are: ! \begin{datadesc}{HTTP_PORT} ! The default port for the HTTP protocol (always \code{80}). ! \end{datadesc} ! ! \begin{datadesc}{HTTPS_PORT} ! The default port for the HTTPS protocol (always \code{443}). ! \end{datadesc} ! ! The module provides the following classes: ! ! \begin{classdesc}{HTTPConnection}{host\optional{, port}} ! An \class{HTTPConnection} instance represents one transaction with an HTTP ! server. It should be instantiated passing it a host and optional port number. ! If no port number is passed, the port is extracted from the host string if it ! has the form \code{\var{host}:\var{port}}, else the default HTTP port (80) is ! used. For example, the following calls all create instances that connect to ! the server at the same host and port: \begin{verbatim} ! >>> h1 = httplib.HTTPConnection('www.cwi.nl') ! >>> h2 = httplib.HTTPConnection('www.cwi.nl:80') ! >>> h3 = httplib.HTTPConnection('www.cwi.nl', 80) \end{verbatim} + \end{classdesc} ! \begin{classdesc}{HTTPSConnection}{host\optional{, port}} ! A subclass of \class{HTTPConnection} that uses SSL for communication with ! secure servers. Default port is \code{443}. ! \end{classdesc} ! The following exceptions are raised as appropriate: ! \begin{excdesc}{HTTPException} ! The base class of the other exceptions in this module. It is a ! subclass of \exception{Exception}. ! \end{excdesc} ! \begin{excdesc}{NotConnected} ! A subclass of \exception{HTTPException}. ! \end{excdesc} ! \begin{excdesc}{UnknownProtocol} ! A subclass of \exception{HTTPException}. ! \end{excdesc} ! \begin{excdesc}{UnknownTransferEncoding} ! A subclass of \exception{HTTPException}. ! \end{excdesc} ! \begin{excdesc}{IllegalKeywordArgument} ! A subclass of \exception{HTTPException}. ! \end{excdesc} ! \begin{excdesc}{UnimplementedFileMode} ! A subclass of \exception{HTTPException}. ! \end{excdesc} ! \begin{excdesc}{IncompleteRead} ! A subclass of \exception{HTTPException}. ! \end{excdesc} ! \begin{excdesc}{ImproperConnectionState} ! A subclass of \exception{HTTPException}. ! \end{excdesc} ! \begin{excdesc}{CannotSendRequest} ! A subclass of \exception{ImproperConnectionState}. ! \end{excdesc} + \begin{excdesc}{CannotSendHeader} + A subclass of \exception{ImproperConnectionState}. + \end{excdesc} ! \begin{excdesc}{ResponseNotReady} ! A subclass of \exception{ImproperConnectionState}. ! \end{excdesc} ! \begin{excdesc}{BadStatusLine} ! A subclass of \exception{HTTPException}. Raised if a server responds with a ! HTTP status code that we don't understand. ! \end{excdesc} ! ! ! \subsection{HTTPConnection Objects \label{httpconnection-objects}} ! ! \class{HTTPConnection} instances have the following methods: ! ! \begin{methoddesc}{request}{method, url\optional{, body\optional{, headers}}} ! This will send a request to the server using the HTTP request method ! \var{method} and the selector \var{url}. If the \var{body} argument is ! present, it should be a string of data to send after the headers are finished. ! The header Content-Length is automatically set to the correct value. ! The \var{headers} argument should be a mapping of extra HTTP headers to send ! with the request. ! \end{methoddesc} + \begin{methoddesc}{getresponse}{} + Should be called after a request is sent to get the response from the server. + Returns an \class{HTTPResponse} instance. + \end{methoddesc} \begin{methoddesc}{set_debuglevel}{level} *************** *** 75,83 **** \end{methoddesc} ! \begin{methoddesc}{connect}{host\optional{, port}} ! Connect to the server given by \var{host} and \var{port}. See the ! introduction to the \refmodule{httplib} module for information on the ! default ports. This should be called directly only if the instance ! was instantiated without passing a host. \end{methoddesc} --- 123,132 ---- \end{methoddesc} ! \begin{methoddesc}{connect}{} ! Connect to the server specified when the object was created. ! \end{methoddesc} ! ! \begin{methoddesc}{close}{} ! Close the connection to the server. \end{methoddesc} *************** *** 92,100 **** been made. It sends a line to the server consisting of the \var{request} string, the \var{selector} string, and the HTTP version ! (\code{HTTP/1.0}). \end{methoddesc} \begin{methoddesc}{putheader}{header, argument\optional{, ...}} ! Send an \rfc{822} style header to the server. It sends a line to the server consisting of the header, a colon and a space, and the first argument. If more arguments are given, continuation lines are sent, --- 141,149 ---- been made. It sends a line to the server consisting of the \var{request} string, the \var{selector} string, and the HTTP version ! (\code{HTTP/1.1}). \end{methoddesc} \begin{methoddesc}{putheader}{header, argument\optional{, ...}} ! Send an \rfc{822}-style header to the server. It sends a line to the server consisting of the header, a colon and a space, and the first argument. If more arguments are given, continuation lines are sent, *************** *** 106,127 **** \end{methoddesc} ! \begin{methoddesc}{getreply}{} ! Complete the request by shutting down the sending end of the socket, ! read the reply from the server, and return a triple ! \code{(\var{replycode}, \var{message}, \var{headers})}. Here, ! \var{replycode} is the integer reply code from the request (e.g., ! \code{200} if the request was handled properly); \var{message} is the ! message string corresponding to the reply code; and \var{headers} is ! an instance of the class \class{mimetools.Message} containing the ! headers received from the server. See the description of the ! \refmodule{mimetools}\refstmodindex{mimetools} module. \end{methoddesc} ! \begin{methoddesc}{getfile}{} ! Return a file object from which the data returned by the server can be ! read, using the \method{read()}, \method{readline()} or ! \method{readlines()} methods. \end{methoddesc} \subsection{Examples \label{httplib-examples}} --- 155,188 ---- \end{methoddesc} ! ! \subsection{HTTPResponse Objects \label{httpresponse-objects}} ! ! \class{HTTPResponse} instances have the following methods and attributes: ! ! \begin{methoddesc}{read}{} ! Reads and returns the response body. \end{methoddesc} ! \begin{methoddesc}{getheader}{name\optional{, default}} ! Get the contents of the header \var{name}, or \var{default} if there is no ! matching header. \end{methoddesc} + \begin{datadesc}{msg} + A \class{mimetools.Message} instance containing the response headers. + \end{datadesc} + + \begin{datadesc}{version} + HTTP protocol version used by server. 10 for HTTP/1.0, 11 for HTTP/1.1. + \end{datadesc} + + \begin{datadesc}{status} + Status code returned by server. + \end{datadesc} + + \begin{datadesc}{reason} + Reason phrase returned by server. + \end{datadesc} + \subsection{Examples \label{httplib-examples}} *************** *** 131,145 **** \begin{verbatim} >>> import httplib ! >>> h = httplib.HTTP('www.cwi.nl') ! >>> h.putrequest('GET', '/index.html') ! >>> h.putheader('Accept', 'text/html') ! >>> h.putheader('Accept', 'text/plain') ! >>> h.putheader('Host', 'www.cwi.nl') ! >>> h.endheaders() ! >>> errcode, errmsg, headers = h.getreply() ! >>> print errcode # Should be 200 ! >>> f = h.getfile() ! >>> data = f.read() # Get the raw HTML ! >>> f.close() \end{verbatim} --- 192,207 ---- \begin{verbatim} >>> import httplib ! >>> conn = httplib.HTTPConnection("www.python.org") ! >>> conn.request("GET", "/index.html") ! >>> r1 = conn.getresponse() ! >>> print r1.status, r1.reason ! 200 OK ! >>> data1 = r1.read() ! >>> conn.request("GET", "/parrot.spam") ! >>> r2 = conn.getresponse() ! >>> print r2.status, r2.reason ! 404 Not Found ! >>> data2 = r2.read() ! >>> conn.close() \end{verbatim} *************** *** 149,162 **** >>> import httplib, urllib >>> params = urllib.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0}) ! >>> h = httplib.HTTP("www.musi-cal.com:80") ! >>> h.putrequest("POST", "/cgi-bin/query") ! >>> h.putheader("Content-type", "application/x-www-form-urlencoded") ! >>> h.putheader("Content-length", "%d" % len(params)) ! >>> h.putheader('Accept', 'text/plain') ! >>> h.putheader('Host', 'www.musi-cal.com') ! >>> h.endheaders() ! >>> h.send(params) ! >>> reply, msg, hdrs = h.getreply() ! >>> print reply # should be 200 ! >>> data = h.getfile().read() # get the raw HTML \end{verbatim} --- 211,222 ---- >>> import httplib, urllib >>> params = urllib.urlencode({'spam': 1, 'eggs': 2, 'bacon': 0}) ! >>> headers = {"Content-type": "application/x-www-form-urlencoded", ! ... "Accept": "text/plain"} ! >>> conn = httplib.HTTPConnection("musi-cal.mojam.com:80") ! >>> conn.request("POST", "/cgi-bin/query", params, headers) ! >>> response = h.getresponse() ! >>> print response.status, response.reason ! 200 OK ! >>> data = response.read() ! >>> conn.close() \end{verbatim} From tim_one@users.sourceforge.net Fri Nov 30 07:23:07 2001 From: tim_one@users.sourceforge.net (Tim Peters) Date: Thu, 29 Nov 2001 23:23:07 -0800 Subject: [Python-checkins] CVS: python/dist/src/Modules unicodedata.c,2.13,2.14 Message-ID: Update of /cvsroot/python/python/dist/src/Modules In directory usw-pr-cvs1:/tmp/cvs-serv20346/python/Modules Modified Files: unicodedata.c Log Message: unicodedata_decomposition(): sprintf -> PyOS_snprintf. Index: unicodedata.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/unicodedata.c,v retrieving revision 2.13 retrieving revision 2.14 diff -C2 -d -r2.13 -r2.14 *** unicodedata.c 2001/07/19 21:11:13 2.13 --- unicodedata.c 2001/11/30 07:23:05 2.14 *************** *** 228,232 **** } ! /* high byte is of hex bytes (usually one or two), low byte is prefix code (from*/ count = decomp_data[index] >> 8; --- 228,232 ---- } ! /* high byte is number of hex bytes (usually one or two), low byte is prefix code (from*/ count = decomp_data[index] >> 8; *************** *** 242,246 **** if (i) decomp[i++] = ' '; ! sprintf(decomp + i, "%04X", decomp_data[++index]); i += strlen(decomp + i); } --- 242,248 ---- if (i) decomp[i++] = ' '; ! assert((size_t)i < sizeof(decomp)); ! PyOS_snprintf(decomp + i, sizeof(decomp) - i, "%04X", ! decomp_data[++index]); i += strlen(decomp + i); } From jackjansen@users.sourceforge.net Fri Nov 30 14:16:37 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:16:37 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Python macglue.c,1.107,1.108 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Python In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Python Modified Files: macglue.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: macglue.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Python/macglue.c,v retrieving revision 1.107 retrieving revision 1.108 diff -C2 -d -r1.107 -r1.108 *** macglue.c 2001/11/10 00:41:43 1.107 --- macglue.c 2001/11/30 14:16:34 1.108 *************** *** 506,511 **** (char)q->evtQMessage == '.' && (q->evtQModifiers & cmdKey) != 0) { ! if ( flush ) ! FlushEvents(keyDownMask, 0); interrupted = 1; break; --- 506,510 ---- (char)q->evtQMessage == '.' && (q->evtQModifiers & cmdKey) != 0) { ! FlushEvents(keyDownMask, 0); interrupted = 1; break; *************** *** 518,523 **** PyErr_CheckSignals() { - int xxx, xxx_old; - if (schedparams.enabled) { if ( interrupted || (unsigned long)LMGetTicks() > schedparams.next_check ) { --- 517,520 ---- *************** *** 530,535 **** if ( PyMac_Yield() < 0) return -1; - xxx = LMGetTicks(); - xxx_old = schedparams.next_check; schedparams.next_check = (unsigned long)LMGetTicks() + schedparams.check_interval; --- 527,530 ---- *************** *** 735,739 **** if ( (sioux_mbar=GetMenuBar()) == NULL ) { #else ! { #endif /* Sioux menu not installed yet. Do so */ --- 730,734 ---- if ( (sioux_mbar=GetMenuBar()) == NULL ) { #else ! if ( (sioux_mbar=GetMenuBar()) == NULL || GetMenuHandle(SIOUX_APPLEID) == NULL) { #endif /* Sioux menu not installed yet. Do so */ From jackjansen@users.sourceforge.net Fri Nov 30 14:16:37 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:16:37 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Tools/IDE Widgets.rsrc,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Tools/IDE In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Tools/IDE Modified Files: Widgets.rsrc Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: Widgets.rsrc =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Tools/IDE/Widgets.rsrc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsQ2nTGR and /tmp/cvsi0jahz differ From jackjansen@users.sourceforge.net Fri Nov 30 14:16:37 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:16:37 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/mwerks mwerks_carbon_config.h,1.8,1.9 mwerks_small_config.h,1.14,1.15 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/mwerks In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/mwerks Modified Files: mwerks_carbon_config.h mwerks_small_config.h Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: mwerks_carbon_config.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/mwerks/mwerks_carbon_config.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** mwerks_carbon_config.h 2001/08/07 15:13:16 1.8 --- mwerks_carbon_config.h 2001/11/30 14:16:35 1.9 *************** *** 30,33 **** --- 30,34 ---- /* #define USE_ZLIB /* Include the zlib module */ #define USE_APPEARANCE /* Enable Appearance support */ + #define WITH_HOTSHOT /* Enable hotshot profiler */ #define USE_MSL_MALLOC /* Disable private malloc. Also disables next two defines */ Index: mwerks_small_config.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/mwerks/mwerks_small_config.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mwerks_small_config.h 2001/08/07 15:14:28 1.14 --- mwerks_small_config.h 2001/11/30 14:16:35 1.15 *************** *** 26,29 **** --- 26,30 ---- #define USE_APPEARANCE /* Enable Appearance support */ #define WITHOUT_FRAMEWORKS /* Use old-style Universal Header includes, not Carbon/Carbon.h */ + #define WITH_HOTSHOT /* Enable hotshot profiler */ #define USE_MSL_MALLOC /* Disable private malloc. Also disables next two defines */ From jackjansen@users.sourceforge.net Fri Nov 30 14:16:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:16:38 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/scripts fullbuild.py,1.76,1.77 genpluginprojects.py,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/scripts In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/scripts Modified Files: fullbuild.py genpluginprojects.py Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: fullbuild.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/fullbuild.py,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** fullbuild.py 2001/11/06 15:56:49 1.76 --- fullbuild.py 2001/11/30 14:16:35 1.77 *************** *** 293,297 **** (":Mac:Build:zlib.carbon.mcp", "zlib.carbon"), (":Mac:Build:_dummy_tkinter.mcp", "_tkinter.carbon"), ! (":Mac:Build:hfsplus.mcp", "hfsplus.carbon"), ## (":Extensions:Imaging:_tkinter.carbon.mcp", "_tkinter.carbon"), (":Mac:Build:ColorPicker.carbon.mcp", "ColorPicker.carbon"), --- 293,297 ---- (":Mac:Build:zlib.carbon.mcp", "zlib.carbon"), (":Mac:Build:_dummy_tkinter.mcp", "_tkinter.carbon"), ! (":Mac:Build:hfsplus.carbon.mcp", "hfsplus.carbon"), ## (":Extensions:Imaging:_tkinter.carbon.mcp", "_tkinter.carbon"), (":Mac:Build:ColorPicker.carbon.mcp", "ColorPicker.carbon"), Index: genpluginprojects.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/scripts/genpluginprojects.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** genpluginprojects.py 2001/11/06 15:56:56 1.22 --- genpluginprojects.py 2001/11/30 14:16:36 1.23 *************** *** 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 --- 36,41 ---- sources=[], sourcedirs=[], libraries=[], extradirs=[], ! extraexportsymbols=[], outputdir=":::Lib:lib-dynload", ! libraryflags=None, stdlibraryflags=None): if architecture == "all": # For the time being we generate two project files. Not as nice as *************** *** 91,94 **** --- 92,99 ---- "prefixname" : prefixname, } + if libraryflags: + dict['libraryflags'] = libraryflags + if stdlibraryflags: + dict['stdlibraryflags'] = stdlibraryflags mkcwproject.mkproject(os.path.join(projectdir, project), module, dict, force=FORCEREBUILD, templatename=templatename) *************** *** 125,132 **** 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") --- 130,137 ---- genpluginproject("carbon", "_Ctl", outputdir="::Lib:Carbon") genpluginproject("ppc", "_Ctl", libraries=["ControlsLib", "AppearanceLib"], ! libraryflags="Debug, WeakImport", outputdir="::Lib:Carbon") genpluginproject("carbon", "_Dlg", outputdir="::Lib:Carbon") genpluginproject("ppc", "_Dlg", libraries=["DialogsLib", "AppearanceLib"], ! libraryflags="Debug, WeakImport", outputdir="::Lib:Carbon") genpluginproject("carbon", "_Drag", outputdir="::Lib:Carbon") genpluginproject("ppc", "_Drag", libraries=["DragLib"], outputdir="::Lib:Carbon") *************** *** 139,143 **** 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") --- 144,148 ---- genpluginproject("carbon", "_Menu", outputdir="::Lib:Carbon") genpluginproject("ppc", "_Menu", libraries=["MenusLib", "ContextualMenu", "AppearanceLib"], ! libraryflags="Debug, WeakImport", outputdir="::Lib:Carbon") genpluginproject("all", "_Qd", outputdir="::Lib:Carbon") genpluginproject("ppc", "_Qt", libraries=["QuickTimeLib"], outputdir="::Lib:Carbon") *************** *** 154,159 **** 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") --- 159,164 ---- genpluginproject("carbon", "_Mlte", outputdir="::Lib:Carbon") genpluginproject("carbon", "_Win", outputdir="::Lib:Carbon") ! genpluginproject("ppc", "_Win", libraries=["CarbonAccessors.o", "WindowsLib", "AppearanceLib"], ! libraryflags="Debug, WeakImport", outputdir="::Lib:Carbon") # Carbon Only? genpluginproject("carbon", "_CF", outputdir="::Lib:Carbon") From jackjansen@users.sourceforge.net Fri Nov 30 14:16:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:16:38 -0800 Subject: [Python-checkins] CVS: python/dist/src/Objects fileobject.c,2.140,2.141 Message-ID: Update of /cvsroot/python/python/dist/src/Objects In directory usw-pr-cvs1:/tmp/cvs-serv22285/Objects Modified Files: fileobject.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: fileobject.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Objects/fileobject.c,v retrieving revision 2.140 retrieving revision 2.141 diff -C2 -d -r2.140 -r2.141 *** fileobject.c 2001/11/28 22:13:25 2.140 --- fileobject.c 2001/11/30 14:16:36 2.141 *************** *** 122,128 **** if (f->f_fp == NULL) { #ifdef NO_FOPEN_ERRNO ! /* Metroworks only, not testable, so unchanged */ if (errno == 0) { ! PyErr_SetString(PyExc_IOError, "Cannot open file"); return NULL; } --- 122,133 ---- if (f->f_fp == NULL) { #ifdef NO_FOPEN_ERRNO ! /* Metroworks only, wich does not always sets errno */ if (errno == 0) { ! PyObject *v; ! v = Py_BuildValue("(is)", 0, "Cannot open file"); ! if (v != NULL) { ! PyErr_SetObject(PyExc_IOError, v); ! Py_DECREF(v); ! } return NULL; } From jackjansen@users.sourceforge.net Fri Nov 30 14:16:38 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:16:38 -0800 Subject: [Python-checkins] CVS: python/dist/src/Tools/bgen/bgen macsupport.py,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Tools/bgen/bgen In directory usw-pr-cvs1:/tmp/cvs-serv22285/Tools/bgen/bgen Modified Files: macsupport.py Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: macsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/bgen/bgen/macsupport.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** macsupport.py 2001/07/01 22:09:29 1.23 --- macsupport.py 2001/11/30 14:16:36 1.24 *************** *** 158,162 **** --- 158,164 ---- def precheck(self): + Output('#ifndef %s', self.name) Output('PyMac_PRECHECK(%s);', self.name) + Output('#endif') class WeakLinkFunctionGenerator(WeakLinkMixIn, FunctionGenerator): pass From jackjansen@users.sourceforge.net Fri Nov 30 14:16:37 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:16:37 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/win _Winmodule.c,1.4,1.5 winsupport.py,1.28,1.29 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/win In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/win Modified Files: _Winmodule.c winsupport.py Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _Winmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/win/_Winmodule.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** _Winmodule.c 2001/11/05 16:16:22 1.4 --- _Winmodule.c 2001/11/30 14:16:34 1.5 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ [...1397 lines suppressed...] *************** *** 2633,2636 **** --- 3040,3046 ---- WindowPtr _rv; CGrafPtr port; + #ifndef GetWindowFromPort + PyMac_PRECHECK(GetWindowFromPort); + #endif if (!PyArg_ParseTuple(_args, "O&", GrafObj_Convert, &port)) *************** *** 2661,2664 **** --- 3071,3077 ---- Point thePoint; WindowPtr theWindow; + #ifndef FindWindow + PyMac_PRECHECK(FindWindow); + #endif if (!PyArg_ParseTuple(_args, "O&", PyMac_GetPoint, &thePoint)) Index: winsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/win/winsupport.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** winsupport.py 2001/11/05 16:16:15 1.28 --- winsupport.py 2001/11/30 14:16:34 1.29 *************** *** 196,201 **** # Create the generator classes used to populate the lists ! Function = OSErrFunctionGenerator ! Method = OSErrMethodGenerator # Create and populate the lists --- 196,201 ---- # Create the generator classes used to populate the lists ! Function = OSErrWeakLinkFunctionGenerator ! Method = OSErrWeakLinkMethodGenerator # Create and populate the lists From jackjansen@users.sourceforge.net Fri Nov 30 14:16:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:16:36 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/waste wastemodule.c,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/waste In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/waste Modified Files: wastemodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: wastemodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/waste/wastemodule.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** wastemodule.c 2001/09/05 15:42:53 1.18 --- wastemodule.c 2001/11/30 14:16:34 1.19 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 349,353 **** PyTypeObject WEO_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "WEO", /*tp_name*/ --- 345,349 ---- PyTypeObject WEO_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "WEO", /*tp_name*/ *************** *** 1714,1718 **** PyTypeObject waste_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "waste", /*tp_name*/ --- 1710,1714 ---- PyTypeObject waste_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "waste", /*tp_name*/ From jackjansen@users.sourceforge.net Fri Nov 30 14:16:36 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:16:36 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/te _TEmodule.c,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/te In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/te Modified Files: _TEmodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _TEmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/te/_TEmodule.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** _TEmodule.c 2001/09/05 10:29:21 1.3 --- _TEmodule.c 2001/11/30 14:16:34 1.4 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 794,798 **** PyTypeObject TE_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "TE", /*tp_name*/ --- 790,794 ---- PyTypeObject TE_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "TE", /*tp_name*/ From jackjansen@users.sourceforge.net Fri Nov 30 14:16:59 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:16:59 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/test regrtest.py,1.66,1.67 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/test In directory usw-pr-cvs1:/tmp/cvs-serv22285/Lib/test Modified Files: regrtest.py Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: regrtest.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/test/regrtest.py,v retrieving revision 1.66 retrieving revision 1.67 diff -C2 -d -r1.66 -r1.67 *** regrtest.py 2001/10/30 05:56:40 1.66 --- regrtest.py 2001/11/30 14:16:26 1.67 *************** *** 525,528 **** --- 525,529 ---- test_commands test_crypt + test_curses test_dbm test_dl From jackjansen@users.sourceforge.net Fri Nov 30 14:16:59 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:16:59 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac ReadMe,1.36,1.37 Relnotes,1.27,1.28 Message-ID: Update of /cvsroot/python/python/dist/src/Mac In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac Modified Files: ReadMe Relnotes Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: ReadMe =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/ReadMe,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** ReadMe 2001/10/31 10:13:52 1.36 --- ReadMe 2001/11/30 14:16:27 1.37 *************** *** 1,3 **** ! How to install Python 2.2b1 on your Macintosh --------------------------------------------- --- 1,3 ---- ! How to install Python 2.2b2 on your Macintosh --------------------------------------------- *************** *** 129,137 **** Python and "import test.regrtest ; test.regrtest.main()". test_time will fail because MacPython accepts bogus values for mktime(), this will be fixed later (it is not a very serious problem). - test_descrtut will fail because of a problem with the test itself. - Three tests will fail on MacOS9 with MemoryErrors: test_longexp, test_sha and test_zlib (on MacOSX these should pass). --- 129,138 ---- Python and "import test.regrtest ; test.regrtest.main()". + test_frozen will fail in MacPython because of different handling on + frozen modules. This should not be a problem in normal use. + test_time will fail because MacPython accepts bogus values for mktime(), this will be fixed later (it is not a very serious problem). Three tests will fail on MacOS9 with MemoryErrors: test_longexp, test_sha and test_zlib (on MacOSX these should pass). *************** *** 161,165 **** Two items are installed in the system folder: the interpreter shared libraries PythonCore and PythonCoreCarbon lives in the Extensions ! folder and the "Python 2.2b1 Preferences" file in the Python subfolder in the Preferences folder. All the rest of Python lives in the folder you installed in. --- 162,166 ---- Two items are installed in the system folder: the interpreter shared libraries PythonCore and PythonCoreCarbon lives in the Extensions ! folder and the "Python 2.2b2 Preferences" file in the Python subfolder in the Preferences folder. All the rest of Python lives in the folder you installed in. *************** *** 211,217 **** are lost and you have to set them again. ! After you are satisfied that 2.2b1 works as expected you can trash anything in the system folder that has "python" in the name and not ! "2.2b1". The ConfigurePython... applets will try to detect incompatible --- 212,218 ---- are lost and you have to set them again. ! After you are satisfied that 2.2b2 works as expected you can trash anything in the system folder that has "python" in the name and not ! "2.2b2". The ConfigurePython... applets will try to detect incompatible Index: Relnotes =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Relnotes,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** Relnotes 2001/10/23 22:20:30 1.27 --- Relnotes 2001/11/30 14:16:27 1.28 *************** *** 1,7 **** ! Changes in 2.2b1 since 2.1.1 ---------------------------- These release notes refer to Mac-specific changes only. See NEWS (in the Misc folder) ! for machine-independent changes. Changes that were already in 2.2a3 are flagged as such. --- 1,7 ---- ! Changes in 2.2b2 since 2.1.1 ---------------------------- These release notes refer to Mac-specific changes only. See NEWS (in the Misc folder) ! for machine-independent changes. Changes that are new in 2.2b2 are flagged as such. *************** *** 11,31 **** 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. [2.2a3] - On input MacPython now accepts either \n (unix style) or \r (mac style) newlines for text files. This behaviour can be turned off with a preference. ! This is an experimental feature; again: feedback is requested. [2.2a3] - 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. [2.2a3] - 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. [2.2a3] ! - Garbage collection and the gc module have (finally) been enabled. [2.2a3] - EasyDialogs.ProgressBar now has indeterminate progressbars if you specify maxval=0. ! This is also the new default. Patch supplied by Dean Draayer. [2.2a3] - There are new preferences for enabling old-style division warnings and for accepting unix-style newlines in text input files. These can also be set during ! startup, and in addition you can select very verbose import tracing. [2.2a3] ! - Various outdated scripts have been moved to :Mac:Unsupported. [2.2a3] ! - Various outdated items from :Mac:Lib:test have been removed. [2.2a3] - C Developers: you know have control over the Python console if you are embedding MacPython in another application, thanks to Alexandre Parenteau. :Mac:Demo:embed.html --- 11,41 ---- 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 behaviour can be turned off with a preference. ! This is an experimental feature; again: feedback is requested. ! - Command-dot handling has been improved a lot: scripts are now much easier to interrupt, ! and they only scan for cmd-. while in the foreground. [2.2b2] ! - "Copy" from the MacPython console window was always disabled. Fixed. [2.2b2] ! - This release should run on MacOS 8.1 again. [2.2b2 build 116] ! - A new, rather different GUSI I/O library is used. Please report any strange behaviour ! with I/O to the pythonmac-sig mailing list! [2.2b2] - 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. ! - A new, experimental module hfsplus is included, which gives access to some of the ! functionality of the HFS+ API. [2.2b2] - 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. - There are new preferences for enabling old-style division warnings and for accepting unix-style newlines in text input files. These can also be set during ! startup, and in addition you can select very verbose import tracing. ! - The NavServices override for StandardFile has moved from early startup to the ! time you import macfs. This speeds up MacPython startup. ! - Various outdated scripts have been moved to :Mac:Unsupported. ! - Various outdated items from :Mac:Lib:test have been removed. - C Developers: you know have control over the Python console if you are embedding MacPython in another application, thanks to Alexandre Parenteau. :Mac:Demo:embed.html *************** *** 49,53 **** http://www.cwi.nl/~jack/macpython.html. ! - MacPython 2.2a3 (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. --- 59,63 ---- http://www.cwi.nl/~jack/macpython.html. ! - MacPython 2.2b2 (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. *************** *** 57,62 **** you cannot access it from Python). - Aliases may not work in sys.path entries. - - Under Carbon on OS9 only you may occasionally see a spurious KeyboardInterrupt. I have absolutely - no clue as to what is causing this. - PythonInterpreter used interactively will eat a lot of processor cycles. You should use PythonIDE for interactive work and PythonInterpreter for scripts only. This is especially --- 67,70 ---- From jackjansen@users.sourceforge.net Fri Nov 30 14:17:02 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:02 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Distributions dev.exclude,1.7,1.8 dev.include,1.22,1.23 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Distributions Modified Files: dev.exclude dev.include Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: dev.exclude =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/dev.exclude,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** dev.exclude 2001/10/23 22:19:39 1.7 --- dev.exclude 2001/11/30 14:16:29 1.8 *************** *** 7,10 **** --- 7,11 ---- *.idb *.pyc + *.pyo *.slb *.xMAP *************** *** 17,19 **** CVS [(]*[)] - *.pyo --- 18,19 ---- Index: dev.include =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/dev.include,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** dev.include 2001/10/23 22:19:52 1.22 --- dev.include 2001/11/30 14:16:29 1.23 *************** *** 224,227 **** --- 224,233 ---- (':Mac:Build:_dummy_tkinter.mcp', None) (':Mac:Build:_dummy_tkinter.mcp.exp', None) + (':Mac:Build:_hotshot.carbon.mcp', None) + (':Mac:Build:_hotshot.carbon.mcp.exp', None) + (':Mac:Build:_hotshot.carbon.mcp.xml', None) + (':Mac:Build:_hotshot.mcp', None) + (':Mac:Build:_hotshot.mcp.exp', None) + (':Mac:Build:_hotshot.mcp.xml', None) (':Mac:Build:_symtable.carbon.mcp', None) (':Mac:Build:_symtable.carbon.mcp.exp', None) *************** *** 424,427 **** --- 430,434 ---- (':Modules:_curses_panel.c', None) (':Modules:_cursesmodule.c', None) + (':Modules:_hotshot.c', None) (':Modules:_localemodule.c', None) (':Modules:_sre.c', None) *************** *** 590,598 **** (':setup.py', None) (':site-packages', None) ! (':Mac:Build:_hotshot.mcp.xml', None) ! (':Mac:Build:_hotshot.mcp.exp', None) ! (':Mac:Build:_hotshot.mcp', None) ! (':Mac:Build:_hotshot.carbon.mcp.xml', None) ! (':Mac:Build:_hotshot.carbon.mcp.exp', None) ! (':Mac:Build:_hotshot.carbon.mcp', None) ! (':Modules:_hotshot.c', None) --- 597,602 ---- (':setup.py', None) (':site-packages', None) ! (':Mac:Build:hfsplus.carbon.mcp.xml', None) ! (':Mac:Build:hfsplus.carbon.mcp.exp', None) ! (':Mac:Build:hfsplus.carbon.mcp', None) ! (':Mac:mwerks:mwerks_shlib_config.h', '') From jackjansen@users.sourceforge.net Fri Nov 30 14:17:02 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:02 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Build PythonCore.exp,1.21,1.22 PythonCore.mcp,1.29,1.30 PythonCoreCarbon.exp,1.21,1.22 PythonStandSmall.mcp,1.31,1.32 _dummy_tkinter.mcp,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Build In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Build Modified Files: PythonCore.exp PythonCore.mcp PythonCoreCarbon.exp PythonStandSmall.mcp _dummy_tkinter.mcp Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: PythonCore.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.exp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** PythonCore.exp 2001/11/06 15:55:15 1.21 --- PythonCore.exp 2001/11/30 14:16:27 1.22 *************** *** 314,317 **** --- 314,318 ---- PyObject_AsWriteBuffer PyObject_AsReadBuffer + PyObject_CheckReadBuffer PyObject_AsCharBuffer PyObject_DelItem *************** *** 1153,1156 **** --- 1154,1158 ---- sError__11GUSIContext # GUSIContext::sError sHasThreading__11GUSIContext # GUSIContext::sHasThreading + sCreatingCurrentContext__11GUSIContext # GUSIContext::sCreatingCurrentContext sCurrentContext__11GUSIContext # GUSIContext::sCurrentContext sContexts__11GUSIContext # GUSIContext::sContexts *************** *** 1187,1193 **** __dt__18GUSIContextFactoryFv # GUSIContextFactory::~GUSIContextFactory() __ct__18GUSIContextFactoryFv # GUSIContextFactory::GUSIContextFactory() ! __dt__Q23std68auto_ptr<18GUSIContextFactory,Q23std29_Single<18GUSIContextFactory>>Fv # std::auto_ptr>::~auto_ptr() SetInstance__18GUSIContextFactoryFP18GUSIContextFactory # GUSIContextFactory::SetInstance(GUSIContextFactory*) Instance__18GUSIContextFactoryFv # GUSIContextFactory::Instance() GUSINewThread Wakeup__11GUSIProcessFv # GUSIProcess::Wakeup() --- 1189,1196 ---- __dt__18GUSIContextFactoryFv # GUSIContextFactory::~GUSIContextFactory() __ct__18GUSIContextFactoryFv # GUSIContextFactory::GUSIContextFactory() ! DeleteInstance__18GUSIContextFactoryFv # GUSIContextFactory::DeleteInstance() SetInstance__18GUSIContextFactoryFP18GUSIContextFactory # GUSIContextFactory::SetInstance(GUSIContextFactory*) Instance__18GUSIContextFactoryFv # GUSIContextFactory::Instance() + GUSISetupContextFactory GUSINewThread Wakeup__11GUSIProcessFv # GUSIProcess::Wakeup() *************** *** 1238,1241 **** --- 1241,1247 ---- SetInstance__19GUSIDescriptorTableFP19GUSIDescriptorTable # GUSIDescriptorTable::SetInstance(GUSIDescriptorTable*) Instance__19GUSIDescriptorTableFv # GUSIDescriptorTable::Instance() + GUSISetupDescriptorTable + __ct__10GUSIDeviceFv # GUSIDevice::GUSIDevice() + __ct__14GUSINullDeviceFv # GUSINullDevice::GUSINullDevice() Instance__14GUSINullDeviceFv # GUSINullDevice::Instance() GUSIDefaultSetupConsole *************** *** 1367,1370 **** --- 1373,1377 ---- CScratch__12GUSIFileSpecFb # GUSIFileSpec::CScratch(bool) ReadHex__FPCciPc # ReadHex(const char*,int,char*) + GUSIFSXGetVolInfo__FP31GUSIIOPBWrapper<12XVolumeParam> # GUSIFSXGetVolInfo(GUSIIOPBWrapper*) GUSIFSMoveRename GUSIFSCatMove *************** *** 1594,1657 **** Want__14GUSINullDeviceFR13GUSIFileToken # GUSINullDevice::Want(GUSIFileToken&) GUSIwithNullSockets - __vt__13GUSIScatterer # GUSIScatterer::__vt - __vt__20GUSIOTDatagramSocket # GUSIOTDatagramSocket::__vt - __vt__18GUSIOTStreamSocket # GUSIOTStreamSocket::__vt - __vt__12GUSIOTSocket # GUSIOTSocket::__vt - __vt__14GUSIOTStrategy # GUSIOTStrategy::__vt - __vt__21GUSIOTDatagramFactory # GUSIOTDatagramFactory::__vt - __vt__13GUSIOTFactory # GUSIOTFactory::__vt - __vt__19GUSIOTStreamFactory # GUSIOTStreamFactory::__vt - sOK__13GUSIOTFactory # GUSIOTFactory::sOK - __dt__19GUSIOTStreamFactoryFv # GUSIOTStreamFactory::~GUSIOTStreamFactory() - __dt__13GUSIOTFactoryFv # GUSIOTFactory::~GUSIOTFactory() - __dt__21GUSIOTDatagramFactoryFv # GUSIOTDatagramFactory::~GUSIOTDatagramFactory() - select__20GUSIOTDatagramSocketFPbPbPb # GUSIOTDatagramSocket::select(bool*,bool*,bool*) - __dt__Q23std80auto_ptr<24GUSIOTAddr<9TUnitData,5>,Q23std35_Single<24GUSIOTAddr<9TUnitData,5>>>Fv # std::auto_ptr, std::_Single>>::~auto_ptr() - sendto__20GUSIOTDatagramSocketFRC12GUSIGathereriPCvUi # GUSIOTDatagramSocket::sendto(const GUSIGatherer&,int,const void*,unsigned int) - __dt__13GUSIScattererFv # GUSIScatterer::~GUSIScatterer() - recvfrom__20GUSIOTDatagramSocketFRC13GUSIScattereriPvPUi # GUSIOTDatagramSocket::recvfrom(const GUSIScatterer&,int,void*,unsigned int*) - connect__20GUSIOTDatagramSocketFPvUi # GUSIOTDatagramSocket::connect(void*,unsigned int) - getpeername__20GUSIOTDatagramSocketFPvPUi # GUSIOTDatagramSocket::getpeername(void*,unsigned int*) - BindIfUnbound__20GUSIOTDatagramSocketFv # GUSIOTDatagramSocket::BindIfUnbound() - __dt__20GUSIOTDatagramSocketFv # GUSIOTDatagramSocket::~GUSIOTDatagramSocket() - Clone__20GUSIOTDatagramSocketFv # GUSIOTDatagramSocket::Clone() - __ct__20GUSIOTDatagramSocketFP14GUSIOTStrategy # GUSIOTDatagramSocket::GUSIOTDatagramSocket(GUSIOTStrategy*) - shutdown__18GUSIOTStreamSocketFi # GUSIOTStreamSocket::shutdown(int) - select__18GUSIOTStreamSocketFPbPbPb # GUSIOTStreamSocket::select(bool*,bool*,bool*) - sendto__18GUSIOTStreamSocketFRC12GUSIGathereriPCvUi # GUSIOTStreamSocket::sendto(const GUSIGatherer&,int,const void*,unsigned int) - __dt__Q210GUSISocket17AddContextInScopeFv # GUSISocket::AddContextInScope::~AddContextInScope() - recvfrom__18GUSIOTStreamSocketFRC13GUSIScattereriPvPUi # GUSIOTStreamSocket::recvfrom(const GUSIScatterer&,int,void*,unsigned int*) - connect__18GUSIOTStreamSocketFPvUi # GUSIOTStreamSocket::connect(void*,unsigned int) - accept__18GUSIOTStreamSocketFPvPUi # GUSIOTStreamSocket::accept(void*,unsigned int*) - getpeername__18GUSIOTStreamSocketFPvPUi # GUSIOTStreamSocket::getpeername(void*,unsigned int*) - listen__18GUSIOTStreamSocketFi # GUSIOTStreamSocket::listen(int) - MopupEvents__18GUSIOTStreamSocketFv # GUSIOTStreamSocket::MopupEvents() - Close__18GUSIOTStreamSocketFUl # GUSIOTStreamSocket::Close(unsigned long) - __dt__18GUSIOTStreamSocketFv # GUSIOTStreamSocket::~GUSIOTStreamSocket() - close__18GUSIOTStreamSocketFv # GUSIOTStreamSocket::close() - Clone__18GUSIOTStreamSocketFv # GUSIOTStreamSocket::Clone() - __ct__18GUSIOTStreamSocketFP14GUSIOTStrategy # GUSIOTStreamSocket::GUSIOTStreamSocket(GUSIOTStrategy*) - Supports__12GUSIOTSocketFQ210GUSISocket12ConfigOption # GUSIOTSocket::Supports(GUSISocket::ConfigOption) - setsockopt__12GUSIOTSocketFiiPvUi # GUSIOTSocket::setsockopt(int,int,void*,unsigned int) - getsockopt__12GUSIOTSocketFiiPvPUi # GUSIOTSocket::getsockopt(int,int,void*,unsigned int*) - ioctl__12GUSIOTSocketFUiPc # GUSIOTSocket::ioctl(unsigned int,char*) - fcntl__12GUSIOTSocketFiPc # GUSIOTSocket::fcntl(int,char*) - shutdown__12GUSIOTSocketFi # GUSIOTSocket::shutdown(int) - getsockname__12GUSIOTSocketFPvPUi # GUSIOTSocket::getsockname(void*,unsigned int*) - Unbind__12GUSIOTSocketFv # GUSIOTSocket::Unbind() - BindToAddress__12GUSIOTSocketFP20GUSIOTAddr<5TBind,1> # GUSIOTSocket::BindToAddress(GUSIOTAddr*) - bind__12GUSIOTSocketFPvUi # GUSIOTSocket::bind(void*,unsigned int) - __dt__12GUSIOTSocketFv # GUSIOTSocket::~GUSIOTSocket() - close__12GUSIOTSocketFv # GUSIOTSocket::close() - __ct__12GUSIOTSocketFP14GUSIOTStrategy # GUSIOTSocket::GUSIOTSocket(GUSIOTStrategy*) - __dt__Q212GUSIOTSocket4LockFv # GUSIOTSocket::Lock::~Lock() - MopupEvents__12GUSIOTSocketFv # GUSIOTSocket::MopupEvents() - CopyAddress__14GUSIOTStrategyFRC7TNetbufR7TNetbuf # GUSIOTStrategy::CopyAddress(const TNetbuf&,TNetbuf&) - __dt__14GUSIOTStrategyFv # GUSIOTStrategy::~GUSIOTStrategy() - CreateConfiguration__14GUSIOTStrategyFv # GUSIOTStrategy::CreateConfiguration() - socket__21GUSIOTDatagramFactoryFiii # GUSIOTDatagramFactory::socket(int,int,int) - socket__19GUSIOTStreamFactoryFiii # GUSIOTStreamFactory::socket(int,int,int) - Initialize__13GUSIOTFactoryFv # GUSIOTFactory::Initialize() - GUSIOTNotify __vt__15GUSIOTUdpSocket # GUSIOTUdpSocket::__vt __vt__17GUSIOTUdpStrategy # GUSIOTUdpStrategy::__vt --- 1601,1604 ---- *************** *** 1661,1664 **** --- 1608,1612 ---- __vt__16GUSIOTUdpFactory # GUSIOTUdpFactory::__vt __vt__16GUSIOTTcpFactory # GUSIOTTcpFactory::__vt + __vt__13GUSIOTFactory # GUSIOTFactory::__vt sInstance__16GUSIOTUdpFactory # GUSIOTUdpFactory::sInstance sInstance__16GUSIOTTcpFactory # GUSIOTTcpFactory::sInstance *************** *** 1689,1696 **** --- 1637,1647 ---- socket__16GUSIOTUdpFactoryFiii # GUSIOTUdpFactory::socket(int,int,int) Strategy__16GUSIOTUdpFactoryFiii # GUSIOTUdpFactory::Strategy(int,int,int) + __dt__21GUSIOTDatagramFactoryFv # GUSIOTDatagramFactory::~GUSIOTDatagramFactory() Instance__16GUSIOTUdpFactoryFv # GUSIOTUdpFactory::Instance() socket__16GUSIOTTcpFactoryFiii # GUSIOTTcpFactory::socket(int,int,int) __dt__18GUSIOTInetStrategyFv # GUSIOTInetStrategy::~GUSIOTInetStrategy() Strategy__16GUSIOTTcpFactoryFiii # GUSIOTTcpFactory::Strategy(int,int,int) + __dt__13GUSIOTFactoryFv # GUSIOTFactory::~GUSIOTFactory() + __dt__19GUSIOTStreamFactoryFv # GUSIOTStreamFactory::~GUSIOTStreamFactory() Instance__16GUSIOTTcpFactoryFv # GUSIOTTcpFactory::Instance() __vt__11GUSIOTNetDB # GUSIOTNetDB::__vt *************** *** 1721,1726 **** GUSIwithLocalSockets __vt__12GUSIGatherer # GUSIGatherer::__vt get__40GUSISpecificDataFP17GUSISpecificTable # GUSISpecificData::get(GUSISpecificTable*) ! faccess__FPCcPUiPv # faccess(const char*,unsigned int*,void*) fsetfileinfo fgetfileinfo --- 1672,1678 ---- GUSIwithLocalSockets __vt__12GUSIGatherer # GUSIGatherer::__vt + __vt__13GUSIScatterer # GUSIScatterer::__vt get__40GUSISpecificDataFP17GUSISpecificTable # GUSISpecificData::get(GUSISpecificTable*) ! faccess fsetfileinfo fgetfileinfo *************** *** 1805,1808 **** --- 1757,1761 ---- __dt__12GUSIGathererFv # GUSIGatherer::~GUSIGatherer() write + __dt__13GUSIScattererFv # GUSIScatterer::~GUSIScatterer() read close *************** *** 1834,1841 **** bind__13GUSIPPCSocketFPvUi # GUSIPPCSocket::bind(void*,unsigned int) __ct__13GUSIPPCSocketFv # GUSIPPCSocket::GUSIPPCSocket() ! GUSIPPCDone__FP16PPCParamBlockRec # GUSIPPCDone(PPCParamBlockRec*) ! GUSIPPCListenDone__FP16PPCParamBlockRec # GUSIPPCListenDone(PPCParamBlockRec*) ! GUSIPPCRecvDone__FP16PPCParamBlockRec # GUSIPPCRecvDone(PPCParamBlockRec*) ! GUSIPPCSendDone__FP16PPCParamBlockRec # GUSIPPCSendDone(PPCParamBlockRec*) SetupListener__13GUSIPPCSocketFRQ213GUSIPPCSocket8Listener # GUSIPPCSocket::SetupListener(GUSIPPCSocket::Listener&) socket__14GUSIPPCFactoryFiii # GUSIPPCFactory::socket(int,int,int) --- 1787,1794 ---- bind__13GUSIPPCSocketFPvUi # GUSIPPCSocket::bind(void*,unsigned int) __ct__13GUSIPPCSocketFv # GUSIPPCSocket::GUSIPPCSocket() ! GUSIPPCDone ! GUSIPPCListenDone ! GUSIPPCRecvDone ! GUSIPPCSendDone SetupListener__13GUSIPPCSocketFRQ213GUSIPPCSocket8Listener # GUSIPPCSocket::SetupListener(GUSIPPCSocket::Listener&) socket__14GUSIPPCFactoryFiii # GUSIPPCFactory::socket(int,int,int) *************** *** 2004,2007 **** --- 1957,2015 ---- __dt__14GUSISigContextFv # GUSISigContext::~GUSISigContext() __ct__14GUSISigContextFPC14GUSISigContext # GUSISigContext::GUSISigContext(const GUSISigContext*) + __vt__20GUSIOTDatagramSocket # GUSIOTDatagramSocket::__vt + __vt__18GUSIOTStreamSocket # GUSIOTStreamSocket::__vt + __vt__12GUSIOTSocket # GUSIOTSocket::__vt + __vt__14GUSIOTStrategy # GUSIOTStrategy::__vt + __vt__21GUSIOTDatagramFactory # GUSIOTDatagramFactory::__vt + __vt__19GUSIOTStreamFactory # GUSIOTStreamFactory::__vt + sOK__13GUSIOTFactory # GUSIOTFactory::sOK + select__20GUSIOTDatagramSocketFPbPbPb # GUSIOTDatagramSocket::select(bool*,bool*,bool*) + __dt__Q23std80auto_ptr<24GUSIOTAddr<9TUnitData,5>,Q23std35_Single<24GUSIOTAddr<9TUnitData,5>>>Fv # std::auto_ptr, std::_Single>>::~auto_ptr() + sendto__20GUSIOTDatagramSocketFRC12GUSIGathereriPCvUi # GUSIOTDatagramSocket::sendto(const GUSIGatherer&,int,const void*,unsigned int) + recvfrom__20GUSIOTDatagramSocketFRC13GUSIScattereriPvPUi # GUSIOTDatagramSocket::recvfrom(const GUSIScatterer&,int,void*,unsigned int*) + connect__20GUSIOTDatagramSocketFPvUi # GUSIOTDatagramSocket::connect(void*,unsigned int) + getpeername__20GUSIOTDatagramSocketFPvPUi # GUSIOTDatagramSocket::getpeername(void*,unsigned int*) + BindIfUnbound__20GUSIOTDatagramSocketFv # GUSIOTDatagramSocket::BindIfUnbound() + __dt__20GUSIOTDatagramSocketFv # GUSIOTDatagramSocket::~GUSIOTDatagramSocket() + Clone__20GUSIOTDatagramSocketFv # GUSIOTDatagramSocket::Clone() + __ct__20GUSIOTDatagramSocketFP14GUSIOTStrategy # GUSIOTDatagramSocket::GUSIOTDatagramSocket(GUSIOTStrategy*) + shutdown__18GUSIOTStreamSocketFi # GUSIOTStreamSocket::shutdown(int) + select__18GUSIOTStreamSocketFPbPbPb # GUSIOTStreamSocket::select(bool*,bool*,bool*) + sendto__18GUSIOTStreamSocketFRC12GUSIGathereriPCvUi # GUSIOTStreamSocket::sendto(const GUSIGatherer&,int,const void*,unsigned int) + __dt__Q210GUSISocket17AddContextInScopeFv # GUSISocket::AddContextInScope::~AddContextInScope() + recvfrom__18GUSIOTStreamSocketFRC13GUSIScattereriPvPUi # GUSIOTStreamSocket::recvfrom(const GUSIScatterer&,int,void*,unsigned int*) + connect__18GUSIOTStreamSocketFPvUi # GUSIOTStreamSocket::connect(void*,unsigned int) + accept__18GUSIOTStreamSocketFPvPUi # GUSIOTStreamSocket::accept(void*,unsigned int*) + getpeername__18GUSIOTStreamSocketFPvPUi # GUSIOTStreamSocket::getpeername(void*,unsigned int*) + listen__18GUSIOTStreamSocketFi # GUSIOTStreamSocket::listen(int) + MopupEvents__18GUSIOTStreamSocketFv # GUSIOTStreamSocket::MopupEvents() + Close__18GUSIOTStreamSocketFUl # GUSIOTStreamSocket::Close(unsigned long) + __dt__18GUSIOTStreamSocketFv # GUSIOTStreamSocket::~GUSIOTStreamSocket() + close__18GUSIOTStreamSocketFv # GUSIOTStreamSocket::close() + Clone__18GUSIOTStreamSocketFv # GUSIOTStreamSocket::Clone() + __ct__18GUSIOTStreamSocketFP14GUSIOTStrategy # GUSIOTStreamSocket::GUSIOTStreamSocket(GUSIOTStrategy*) + Supports__12GUSIOTSocketFQ210GUSISocket12ConfigOption # GUSIOTSocket::Supports(GUSISocket::ConfigOption) + setsockopt__12GUSIOTSocketFiiPvUi # GUSIOTSocket::setsockopt(int,int,void*,unsigned int) + getsockopt__12GUSIOTSocketFiiPvPUi # GUSIOTSocket::getsockopt(int,int,void*,unsigned int*) + pre_select__12GUSIOTSocketFbbb # GUSIOTSocket::pre_select(bool,bool,bool) + ioctl__12GUSIOTSocketFUiPc # GUSIOTSocket::ioctl(unsigned int,char*) + fcntl__12GUSIOTSocketFiPc # GUSIOTSocket::fcntl(int,char*) + shutdown__12GUSIOTSocketFi # GUSIOTSocket::shutdown(int) + getsockname__12GUSIOTSocketFPvPUi # GUSIOTSocket::getsockname(void*,unsigned int*) + Unbind__12GUSIOTSocketFv # GUSIOTSocket::Unbind() + BindToAddress__12GUSIOTSocketFP20GUSIOTAddr<5TBind,1> # GUSIOTSocket::BindToAddress(GUSIOTAddr*) + bind__12GUSIOTSocketFPvUi # GUSIOTSocket::bind(void*,unsigned int) + __dt__12GUSIOTSocketFv # GUSIOTSocket::~GUSIOTSocket() + close__12GUSIOTSocketFv # GUSIOTSocket::close() + __ct__12GUSIOTSocketFP14GUSIOTStrategy # GUSIOTSocket::GUSIOTSocket(GUSIOTStrategy*) + __dt__Q212GUSIOTSocket4LockFv # GUSIOTSocket::Lock::~Lock() + MopupEvents__12GUSIOTSocketFv # GUSIOTSocket::MopupEvents() + CopyAddress__14GUSIOTStrategyFRC7TNetbufR7TNetbuf # GUSIOTStrategy::CopyAddress(const TNetbuf&,TNetbuf&) + __dt__14GUSIOTStrategyFv # GUSIOTStrategy::~GUSIOTStrategy() + CreateConfiguration__14GUSIOTStrategyFv # GUSIOTStrategy::CreateConfiguration() + socket__21GUSIOTDatagramFactoryFiii # GUSIOTDatagramFactory::socket(int,int,int) + socket__19GUSIOTStreamFactoryFiii # GUSIOTStreamFactory::socket(int,int,int) + Initialize__13GUSIOTFactoryFv # GUSIOTFactory::Initialize() + GUSIOTNotify atan atan2 *************** *** 2107,2110 **** --- 2115,2119 ---- __dt__Q23std9bad_allocFv # std::bad_alloc::~bad_alloc() qd + exit __console_exit __stdio_exit Index: PythonCore.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCore.mcp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 Binary files /tmp/cvs0zm5Wg and /tmp/cvskpS5cp differ Index: PythonCoreCarbon.exp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonCoreCarbon.exp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** PythonCoreCarbon.exp 2001/11/06 15:55:23 1.21 --- PythonCoreCarbon.exp 2001/11/30 14:16:28 1.22 *************** *** 314,317 **** --- 314,318 ---- PyObject_AsWriteBuffer PyObject_AsReadBuffer + PyObject_CheckReadBuffer PyObject_AsCharBuffer PyObject_DelItem *************** *** 1078,1082 **** GUSIStdioFlush GUSIStdioClose - _fdopen __close_console __close_file --- 1079,1082 ---- *************** *** 1147,1150 **** --- 1147,1151 ---- sError__11GUSIContext # GUSIContext::sError sHasThreading__11GUSIContext # GUSIContext::sHasThreading + sCreatingCurrentContext__11GUSIContext # GUSIContext::sCreatingCurrentContext sCurrentContext__11GUSIContext # GUSIContext::sCurrentContext sContexts__11GUSIContext # GUSIContext::sContexts *************** *** 1155,1161 **** __dt__Q23std76auto_ptr<22GUSIThreadManagerProxy,Q23std33_Single<22GUSIThreadManagerProxy>>Fv # std::auto_ptr>::~auto_ptr() Instance__22GUSIThreadManagerProxyFv # GUSIThreadManagerProxy::Instance() ! SetThreadTerminator__22GUSIThreadManagerProxyFUlPFUlPv_vPv # GUSIThreadManagerProxy::SetThreadTerminator(unsigned long,void (*)(unsigned long, void*),void*) ! SetThreadSwitcher__22GUSIThreadManagerProxyFUlPFUlPv_vPvUc # GUSIThreadManagerProxy::SetThreadSwitcher(unsigned long,void (*)(unsigned long, void*),void*,unsigned char) ! NewThread__22GUSIThreadManagerProxyFUlPFPv_PvPvlUlPPvPUl # GUSIThreadManagerProxy::NewThread(unsigned long,void* (*)(void*),void*,long,unsigned long,void**,unsigned long*) GUSIControl__FP7IOParam # GUSIControl(IOParam*) GUSIFinishIO__FP7IOParam # GUSIFinishIO(IOParam*) --- 1156,1162 ---- __dt__Q23std76auto_ptr<22GUSIThreadManagerProxy,Q23std33_Single<22GUSIThreadManagerProxy>>Fv # std::auto_ptr>::~auto_ptr() Instance__22GUSIThreadManagerProxyFv # GUSIThreadManagerProxy::Instance() ! SetThreadTerminator__22GUSIThreadManagerProxyFUlP30OpaqueThreadTerminationProcPtrPv # GUSIThreadManagerProxy::SetThreadTerminator(unsigned long,OpaqueThreadTerminationProcPtr*,void*) ! SetThreadSwitcher__22GUSIThreadManagerProxyFUlP25OpaqueThreadSwitchProcPtrPvUc # GUSIThreadManagerProxy::SetThreadSwitcher(unsigned long,OpaqueThreadSwitchProcPtr*,void*,unsigned char) ! NewThread__22GUSIThreadManagerProxyFUlP24OpaqueThreadEntryProcPtrPvlUlPPvPUl # GUSIThreadManagerProxy::NewThread(unsigned long,OpaqueThreadEntryProcPtr*,void*,long,unsigned long,void**,unsigned long*) GUSIControl__FP7IOParam # GUSIControl(IOParam*) GUSIFinishIO__FP7IOParam # GUSIFinishIO(IOParam*) *************** *** 1172,1187 **** SwitchOut__11GUSIContextFv # GUSIContext::SwitchOut() SwitchIn__11GUSIContextFv # GUSIContext::SwitchIn() ! SetTerminator__11GUSIContextFPFUlPv_vPv # GUSIContext::SetTerminator(void (*)(unsigned long, void*),void*) GUSISetThreadTerminator ! SetSwitchOut__11GUSIContextFPFUlPv_vPv # GUSIContext::SetSwitchOut(void (*)(unsigned long, void*),void*) ! SetSwitchIn__11GUSIContextFPFUlPv_vPv # GUSIContext::SetSwitchIn(void (*)(unsigned long, void*),void*) GUSISetThreadSwitcher CreateContext__18GUSIContextFactoryFUl # GUSIContextFactory::CreateContext(unsigned long) ! CreateContext__18GUSIContextFactoryFPFPv_PvPvlUlPPvPUl # GUSIContextFactory::CreateContext(void* (*)(void*),void*,long,unsigned long,void**,unsigned long*) __dt__18GUSIContextFactoryFv # GUSIContextFactory::~GUSIContextFactory() __ct__18GUSIContextFactoryFv # GUSIContextFactory::GUSIContextFactory() ! __dt__Q23std68auto_ptr<18GUSIContextFactory,Q23std29_Single<18GUSIContextFactory>>Fv # std::auto_ptr>::~auto_ptr() SetInstance__18GUSIContextFactoryFP18GUSIContextFactory # GUSIContextFactory::SetInstance(GUSIContextFactory*) Instance__18GUSIContextFactoryFv # GUSIContextFactory::Instance() GUSINewThread Wakeup__11GUSIProcessFv # GUSIProcess::Wakeup() --- 1173,1189 ---- SwitchOut__11GUSIContextFv # GUSIContext::SwitchOut() SwitchIn__11GUSIContextFv # GUSIContext::SwitchIn() ! SetTerminator__11GUSIContextFP30OpaqueThreadTerminationProcPtrPv # GUSIContext::SetTerminator(OpaqueThreadTerminationProcPtr*,void*) GUSISetThreadTerminator ! SetSwitchOut__11GUSIContextFP25OpaqueThreadSwitchProcPtrPv # GUSIContext::SetSwitchOut(OpaqueThreadSwitchProcPtr*,void*) ! SetSwitchIn__11GUSIContextFP25OpaqueThreadSwitchProcPtrPv # GUSIContext::SetSwitchIn(OpaqueThreadSwitchProcPtr*,void*) GUSISetThreadSwitcher CreateContext__18GUSIContextFactoryFUl # GUSIContextFactory::CreateContext(unsigned long) ! CreateContext__18GUSIContextFactoryFP24OpaqueThreadEntryProcPtrPvlUlPPvPUl # GUSIContextFactory::CreateContext(OpaqueThreadEntryProcPtr*,void*,long,unsigned long,void**,unsigned long*) __dt__18GUSIContextFactoryFv # GUSIContextFactory::~GUSIContextFactory() __ct__18GUSIContextFactoryFv # GUSIContextFactory::GUSIContextFactory() ! DeleteInstance__18GUSIContextFactoryFv # GUSIContextFactory::DeleteInstance() SetInstance__18GUSIContextFactoryFP18GUSIContextFactory # GUSIContextFactory::SetInstance(GUSIContextFactory*) Instance__18GUSIContextFactoryFv # GUSIContextFactory::Instance() + GUSISetupContextFactory GUSINewThread Wakeup__11GUSIProcessFv # GUSIProcess::Wakeup() *************** *** 1191,1195 **** __dt__11GUSIContextFv # GUSIContext::~GUSIContext() Lookup__11GUSIContextFUl # GUSIContext::Lookup(unsigned long) ! __ct__11GUSIContextFPFPv_PvPvlUlPPvPUl # GUSIContext::GUSIContext(void* (*)(void*),void*,long,unsigned long,void**,unsigned long*) __ct__11GUSIContextFUl # GUSIContext::GUSIContext(unsigned long) FinishSetup__11GUSIContextFv # GUSIContext::FinishSetup() --- 1193,1197 ---- __dt__11GUSIContextFv # GUSIContext::~GUSIContext() Lookup__11GUSIContextFUl # GUSIContext::Lookup(unsigned long) ! __ct__11GUSIContextFP24OpaqueThreadEntryProcPtrPvlUlPPvPUl # GUSIContext::GUSIContext(OpaqueThreadEntryProcPtr*,void*,long,unsigned long,void**,unsigned long*) __ct__11GUSIContextFUl # GUSIContext::GUSIContext(unsigned long) FinishSetup__11GUSIContextFv # GUSIContext::FinishSetup() *************** *** 1232,1235 **** --- 1234,1240 ---- SetInstance__19GUSIDescriptorTableFP19GUSIDescriptorTable # GUSIDescriptorTable::SetInstance(GUSIDescriptorTable*) Instance__19GUSIDescriptorTableFv # GUSIDescriptorTable::Instance() + GUSISetupDescriptorTable + __ct__10GUSIDeviceFv # GUSIDevice::GUSIDevice() + __ct__14GUSINullDeviceFv # GUSINullDevice::GUSINullDevice() Instance__14GUSINullDeviceFv # GUSINullDevice::Instance() GUSIDefaultSetupConsole *************** *** 1361,1364 **** --- 1366,1370 ---- CScratch__12GUSIFileSpecFb # GUSIFileSpec::CScratch(bool) ReadHex__FPCciPc # ReadHex(const char*,int,char*) + GUSIFSXGetVolInfo__FP31GUSIIOPBWrapper<12XVolumeParam> # GUSIFSXGetVolInfo(GUSIIOPBWrapper*) GUSIFSMoveRename GUSIFSCatMove *************** *** 1522,1526 **** __vt__13GUSIScatterer # GUSIScatterer::__vt get__40GUSISpecificDataFP17GUSISpecificTable # GUSISpecificData::get(GUSISpecificTable*) ! faccess__FPCcPUiPv # faccess(const char*,unsigned int*,void*) fsetfileinfo fgetfileinfo --- 1528,1532 ---- __vt__13GUSIScatterer # GUSIScatterer::__vt get__40GUSISpecificDataFP17GUSISpecificTable # GUSISpecificData::get(GUSISpecificTable*) ! faccess fsetfileinfo fgetfileinfo *************** *** 1812,1815 **** --- 1818,1822 ---- setsockopt__12GUSIOTSocketFiiPvUi # GUSIOTSocket::setsockopt(int,int,void*,unsigned int) getsockopt__12GUSIOTSocketFiiPvPUi # GUSIOTSocket::getsockopt(int,int,void*,unsigned int*) + pre_select__12GUSIOTSocketFbbb # GUSIOTSocket::pre_select(bool,bool,bool) ioctl__12GUSIOTSocketFUiPc # GUSIOTSocket::ioctl(unsigned int,char*) fcntl__12GUSIOTSocketFiPc # GUSIOTSocket::fcntl(int,char*) *************** *** 2224,2227 **** --- 2231,2235 ---- _fcreator _chmod + _fdopen __gettype __getcreator Index: PythonStandSmall.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/PythonStandSmall.mcp,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 Binary files /tmp/cvs1L5P2a and /tmp/cvsGjKsec differ Index: _dummy_tkinter.mcp =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Build/_dummy_tkinter.mcp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 Binary files /tmp/cvsxJ1C8j and /tmp/cvsw8bzTt differ From jackjansen@users.sourceforge.net Fri Nov 30 14:17:03 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:03 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Include macbuildno.h,1.21,1.22 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Include In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Include Modified Files: macbuildno.h Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: macbuildno.h =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Include/macbuildno.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** macbuildno.h 2001/10/23 22:21:19 1.21 --- macbuildno.h 2001/11/30 14:16:30 1.22 *************** *** 1 **** ! #define BUILD 111 --- 1 ---- ! #define BUILD 116 From jackjansen@users.sourceforge.net Fri Nov 30 14:17:03 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:03 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/mkcwproject/template-carbon template-alllibraries.xml,1.1,1.2 template.prj.xml,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-carbon In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Lib/mkcwproject/template-carbon Modified Files: template-alllibraries.xml template.prj.xml Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: template-alllibraries.xml =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-carbon/template-alllibraries.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** template-alllibraries.xml 2001/01/23 22:33:30 1.1 --- template-alllibraries.xml 2001/11/30 14:16:31 1.2 *************** *** 4,7 **** MacOS Library ! Debug --- 4,7 ---- MacOS Library ! %(libraryflags)s Index: template.prj.xml =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-carbon/template.prj.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** template.prj.xml 2001/11/10 23:21:55 1.3 --- template.prj.xml 2001/11/30 14:16:31 1.4 *************** *** 102,106 **** SearchPath ! Path%(sysprefix)s:GUSI2Carbon:include: PathFormatMacOS PathRoot%(mac_sysprefixtype)s --- 102,106 ---- SearchPath ! Path%(sysprefix)s:GUSI2:include: PathFormatMacOS PathRoot%(mac_sysprefixtype)s *************** *** 978,992 **** Name - MSL C.Carbon.Lib - MacOS - Library - - - - Name CarbonLib MacOS Library ! --- 978,985 ---- Name CarbonLib MacOS Library ! %(stdlibraryflags)s *************** *** 1014,1022 **** MacOS - - Name - MSL C.Carbon.Lib - MacOS - --- 1007,1010 ---- *************** *** 1049,1058 **** Name PythonCoreCarbon - MacOS - - - %(mac_targetname)s - Name - MSL C.Carbon.Lib MacOS --- 1037,1040 ---- From jackjansen@users.sourceforge.net Fri Nov 30 14:17:03 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:03 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Distributions/(vise) Python 2.2.vct,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Distributions/(vise) In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Distributions/(vise) Modified Files: Python 2.2.vct Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: Python 2.2.vct =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Distributions/(vise)/Python 2.2.vct,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 Binary files /tmp/cvsNiVs9c and /tmp/cvssgaGMk differ From jackjansen@users.sourceforge.net Fri Nov 30 14:17:03 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:03 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules macconfig.c,1.29,1.30 macmodule.c,1.48,1.49 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules Modified Files: macconfig.c macmodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: macconfig.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macconfig.c,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** macconfig.c 2001/11/06 15:56:41 1.29 --- macconfig.c 2001/11/30 14:16:31 1.30 *************** *** 159,162 **** --- 159,165 ---- extern void initthread(); #endif + #ifdef WITH_HOTSHOT + extern void init_hotshot(); + #endif #ifdef USE_PYEXPAT extern void initpyexpat(); *************** *** 288,291 **** --- 291,297 ---- #ifdef WITH_THREAD {"thread", initthread}, + #endif + #ifdef WITH_HOTSHOT + {"_hotshot", init_hotshot}, #endif #ifdef USE_PYEXPAT Index: macmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/macmodule.c,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** macmodule.c 2001/11/06 12:10:05 1.48 --- macmodule.c 2001/11/30 14:16:31 1.49 *************** *** 115,120 **** - static PyObject *MacError; /* Exception mac.error */ - /* Set a MAC-specific error from errno, and return NULL */ --- 115,118 ---- *************** *** 122,126 **** mac_error() { ! return PyErr_SetFromErrno(MacError); } --- 120,124 ---- mac_error() { ! return PyErr_SetFromErrno(PyExc_OSError); } *************** *** 296,301 **** Py_END_ALLOW_THREADS if (res == NULL) { ! PyErr_SetString(MacError, path); ! return NULL; } return PyString_FromString(res); --- 294,298 ---- Py_END_ALLOW_THREADS if (res == NULL) { ! return mac_error(); } return PyString_FromString(res); *************** *** 840,845 **** /* Initialize mac.error exception */ ! MacError = PyErr_NewException("mac.error", NULL, NULL); ! PyDict_SetItemString(d, "error", MacError); PyStructSequence_InitType(&StatResultType, &stat_result_desc); --- 837,841 ---- /* Initialize mac.error exception */ ! PyDict_SetItemString(d, "error", PyExc_OSError); PyStructSequence_InitType(&StatResultType, &stat_result_desc); From jackjansen@users.sourceforge.net Fri Nov 30 14:17:04 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:04 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/cf _CFmodule.c,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/cf In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/cf Modified Files: _CFmodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). 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/11/05 14:39:05 1.5 --- _CFmodule.c 2001/11/30 14:16:31 1.6 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ [...1061 lines suppressed...] *************** *** 3042,3046 **** --- 3224,3230 ---- PyObject *_res = NULL; CFTypeID _rv; + #ifndef CFURLGetTypeID PyMac_PRECHECK(CFURLGetTypeID); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 3060,3064 **** --- 3244,3250 ---- CFStringEncoding encoding; CFURLRef baseURL; + #ifndef CFURLCreateWithBytes PyMac_PRECHECK(CFURLCreateWithBytes); + #endif if (!PyArg_ParseTuple(_args, "s#lO&", &URLBytes__in__, &URLBytes__in_len__, From jackjansen@users.sourceforge.net Fri Nov 30 14:17:03 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:03 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/ae _AEmodule.c,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/ae In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/ae Modified Files: _AEmodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _AEmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/ae/_AEmodule.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** _AEmodule.c 2001/09/05 10:31:13 1.4 --- _AEmodule.c 2001/11/30 14:16:31 1.5 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 785,789 **** PyTypeObject AEDesc_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "AEDesc", /*tp_name*/ --- 781,785 ---- PyTypeObject AEDesc_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "AEDesc", /*tp_name*/ From jackjansen@users.sourceforge.net Fri Nov 30 14:17:03 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:03 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/mkcwproject/template-ppc template-alllibraries.xml,1.1,1.2 template.prj.xml,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-ppc In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Lib/mkcwproject/template-ppc Modified Files: template-alllibraries.xml template.prj.xml Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: template-alllibraries.xml =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-ppc/template-alllibraries.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** template-alllibraries.xml 2001/01/23 22:33:00 1.1 --- template-alllibraries.xml 2001/11/30 14:16:31 1.2 *************** *** 4,7 **** MacOS Library ! Debug --- 4,7 ---- MacOS Library ! %(libraryflags)s Index: template.prj.xml =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/template-ppc/template.prj.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** template.prj.xml 2001/11/10 23:21:47 1.2 --- template.prj.xml 2001/11/30 14:16:31 1.3 *************** *** 713,723 **** Name - MSL C.PPC.Lib - MacOS - Library - Debug - - - Name MathLib MacOS --- 713,716 ---- *************** *** 730,734 **** MacOS Library ! Debug --- 723,727 ---- MacOS Library ! %(stdlibraryflags)s *************** *** 753,761 **** Name - MSL C.PPC.Lib - MacOS - - - Name MathLib MacOS --- 746,749 ---- *************** *** 796,805 **** Name PythonCore - MacOS - - - %(mac_targetname)s - Name - MSL C.PPC.Lib MacOS --- 784,787 ---- From jackjansen@users.sourceforge.net Fri Nov 30 14:17:03 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:03 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Lib/mkcwproject __init__.py,1.10,1.11 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Lib/mkcwproject Modified Files: __init__.py Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Lib/mkcwproject/__init__.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** __init__.py 2001/08/25 12:00:44 1.10 --- __init__.py 2001/11/30 14:16:30 1.11 *************** *** 19,22 **** --- 19,26 ---- if not dictcopy.has_key('mac_outputdir'): dictcopy['mac_outputdir'] = ':lib:' + if not dictcopy.has_key('stdlibraryflags'): + dictcopy['stdlibraryflags'] = 'Debug' + if not dictcopy.has_key('libraryflags'): + dictcopy['libraryflags'] = 'Debug' if not dictcopy.has_key('mac_dllname'): dictcopy['mac_dllname'] = modulename + '.ppc.slb' From jackjansen@users.sourceforge.net Fri Nov 30 14:17:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/qdoffs _Qdoffsmodule.c,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qdoffs In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/qdoffs Modified Files: _Qdoffsmodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _Qdoffsmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qdoffs/_Qdoffsmodule.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** _Qdoffsmodule.c 2001/09/05 10:29:43 1.3 --- _Qdoffsmodule.c 2001/11/30 14:16:33 1.4 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 139,143 **** PyTypeObject GWorld_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "GWorld", /*tp_name*/ --- 135,139 ---- PyTypeObject GWorld_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "GWorld", /*tp_name*/ From jackjansen@users.sourceforge.net Fri Nov 30 14:17:06 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:06 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/snd _Sndmodule.c,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/snd In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/snd Modified Files: _Sndmodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _Sndmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/snd/_Sndmodule.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** _Sndmodule.c 2001/09/05 10:28:49 1.3 --- _Sndmodule.c 2001/11/30 14:16:34 1.4 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 317,321 **** staticforward PyTypeObject SndChannel_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "SndChannel", /*tp_name*/ --- 313,317 ---- staticforward PyTypeObject SndChannel_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "SndChannel", /*tp_name*/ *************** *** 445,449 **** staticforward PyTypeObject SPB_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "SPB", /*tp_name*/ --- 441,445 ---- staticforward PyTypeObject SPB_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "SPB", /*tp_name*/ From jackjansen@users.sourceforge.net Fri Nov 30 14:17:06 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:06 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/res _Resmodule.c,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/res In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/res Modified Files: _Resmodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _Resmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/res/_Resmodule.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** _Resmodule.c 2001/09/05 15:43:11 1.4 --- _Resmodule.c 2001/11/30 14:16:34 1.5 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 551,555 **** PyTypeObject Resource_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "Resource", /*tp_name*/ --- 547,551 ---- PyTypeObject Resource_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "Resource", /*tp_name*/ From jackjansen@users.sourceforge.net Fri Nov 30 14:17:04 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:04 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/cm _Cmmodule.c,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/cm In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/cm Modified Files: _Cmmodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _Cmmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/cm/_Cmmodule.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** _Cmmodule.c 2001/09/05 10:30:53 1.3 --- _Cmmodule.c 2001/11/30 14:16:32 1.4 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 292,296 **** PyTypeObject ComponentInstance_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "ComponentInstance", /*tp_name*/ --- 288,292 ---- PyTypeObject ComponentInstance_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "ComponentInstance", /*tp_name*/ *************** *** 619,623 **** PyTypeObject Component_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "Component", /*tp_name*/ --- 615,619 ---- PyTypeObject Component_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "Component", /*tp_name*/ From jackjansen@users.sourceforge.net Fri Nov 30 14:17:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/menu _Menumodule.c,1.3,1.4 menusupport.py,1.12,1.13 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/menu In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/menu Modified Files: _Menumodule.c menusupport.py Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _Menumodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/menu/_Menumodule.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** _Menumodule.c 2001/09/05 10:29:57 1.3 --- _Menumodule.c 2001/11/30 14:16:33 1.4 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ [...1244 lines suppressed...] *************** *** 2416,2419 **** --- 2781,2787 ---- PyObject *_res = NULL; short menuID; + #ifndef DeleteMenu + PyMac_PRECHECK(DeleteMenu); + #endif if (!PyArg_ParseTuple(_args, "h", &menuID)) *************** *** 2428,2431 **** --- 2796,2802 ---- { PyObject *_res = NULL; + #ifndef DrawMenuBar + PyMac_PRECHECK(DrawMenuBar); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; Index: menusupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/menu/menusupport.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** menusupport.py 2001/08/23 13:50:01 1.12 --- menusupport.py 2001/11/30 14:16:33 1.13 *************** *** 82,87 **** # Create the generator classes used to populate the lists ! Function = OSErrFunctionGenerator ! Method = OSErrMethodGenerator # Create and populate the lists --- 82,87 ---- # Create the generator classes used to populate the lists ! Function = OSErrWeakLinkFunctionGenerator ! Method = OSErrWeakLinkMethodGenerator # Create and populate the lists From jackjansen@users.sourceforge.net Fri Nov 30 14:17:06 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:06 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/qt _Qtmodule.c,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qt In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/qt Modified Files: _Qtmodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _Qtmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qt/_Qtmodule.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** _Qtmodule.c 2001/09/05 10:29:38 1.3 --- _Qtmodule.c 2001/11/30 14:16:33 1.4 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 935,939 **** PyTypeObject MovieController_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "MovieController", /*tp_name*/ --- 931,935 ---- PyTypeObject MovieController_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "MovieController", /*tp_name*/ *************** *** 1329,1333 **** PyTypeObject TimeBase_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "TimeBase", /*tp_name*/ --- 1325,1329 ---- PyTypeObject TimeBase_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "TimeBase", /*tp_name*/ *************** *** 1606,1610 **** PyTypeObject UserData_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "UserData", /*tp_name*/ --- 1602,1606 ---- PyTypeObject UserData_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "UserData", /*tp_name*/ *************** *** 2640,2644 **** PyTypeObject Media_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "Media", /*tp_name*/ --- 2636,2640 ---- PyTypeObject Media_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "Media", /*tp_name*/ *************** *** 3727,3731 **** PyTypeObject Track_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "Track", /*tp_name*/ --- 3723,3727 ---- PyTypeObject Track_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "Track", /*tp_name*/ *************** *** 5799,5803 **** PyTypeObject Movie_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "Movie", /*tp_name*/ --- 5795,5799 ---- PyTypeObject Movie_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "Movie", /*tp_name*/ From jackjansen@users.sourceforge.net Fri Nov 30 14:17:03 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:03 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/app _Appmodule.c,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/app In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/app Modified Files: _Appmodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _Appmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/app/_Appmodule.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** _Appmodule.c 2001/09/05 10:31:07 1.2 --- _Appmodule.c 2001/11/30 14:16:31 1.3 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- From jackjansen@users.sourceforge.net Fri Nov 30 14:17:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/help _Helpmodule.c,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/help In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/help Modified Files: _Helpmodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _Helpmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/help/_Helpmodule.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** _Helpmodule.c 2001/09/05 10:30:13 1.2 --- _Helpmodule.c 2001/11/30 14:16:33 1.3 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- From jackjansen@users.sourceforge.net Fri Nov 30 14:17:04 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:04 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/drag _Dragmodule.c,1.3,1.4 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/drag In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/drag Modified Files: _Dragmodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _Dragmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/drag/_Dragmodule.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** _Dragmodule.c 2001/09/05 10:30:39 1.3 --- _Dragmodule.c 2001/11/30 14:16:32 1.4 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 676,680 **** PyTypeObject DragObj_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "DragObj", /*tp_name*/ --- 672,676 ---- PyTypeObject DragObj_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "DragObj", /*tp_name*/ From jackjansen@users.sourceforge.net Fri Nov 30 14:17:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/qd _Qdmodule.c,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/qd In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/qd Modified Files: _Qdmodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _Qdmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/qd/_Qdmodule.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** _Qdmodule.c 2001/09/05 15:43:33 1.4 --- _Qdmodule.c 2001/11/30 14:16:33 1.5 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 374,378 **** PyTypeObject GrafPort_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "GrafPort", /*tp_name*/ --- 370,374 ---- PyTypeObject GrafPort_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "GrafPort", /*tp_name*/ *************** *** 505,509 **** PyTypeObject BitMap_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "BitMap", /*tp_name*/ --- 501,505 ---- PyTypeObject BitMap_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "BitMap", /*tp_name*/ *************** *** 633,637 **** staticforward PyTypeObject QDGlobalsAccess_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "QDGlobalsAccess", /*tp_name*/ --- 629,633 ---- staticforward PyTypeObject QDGlobalsAccess_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "QDGlobalsAccess", /*tp_name*/ From jackjansen@users.sourceforge.net Fri Nov 30 14:17:04 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:04 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/ctl _Ctlmodule.c,1.3,1.4 ctlsupport.py,1.42,1.43 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/ctl In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/ctl Modified Files: _Ctlmodule.c ctlsupport.py Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _Ctlmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/ctl/_Ctlmodule.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** _Ctlmodule.c 2001/09/05 10:30:48 1.3 --- _Ctlmodule.c 2001/11/30 14:16:32 1.4 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ [...1014 lines suppressed...] *************** *** 2412,2415 **** --- 2708,2714 ---- WindowPtr theWindow; Boolean tracks; + #ifndef IsAutomaticControlDragTrackingEnabledForWindow + PyMac_PRECHECK(IsAutomaticControlDragTrackingEnabledForWindow); + #endif if (!PyArg_ParseTuple(_args, "O&", WinObj_Convert, &theWindow)) *************** *** 2429,2432 **** --- 2728,2734 ---- ControlHandle _rv; Handle h; + #ifndef as_Control + PyMac_PRECHECK(as_Control); + #endif if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &h)) Index: ctlsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/ctl/ctlsupport.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** ctlsupport.py 2001/09/05 10:31:42 1.42 --- ctlsupport.py 2001/11/30 14:16:32 1.43 *************** *** 337,342 **** # Create the generator classes used to populate the lists ! Function = OSErrFunctionGenerator ! Method = OSErrMethodGenerator # Create and populate the lists --- 337,342 ---- # Create the generator classes used to populate the lists ! Function = OSErrWeakLinkFunctionGenerator ! Method = OSErrWeakLinkMethodGenerator # Create and populate the lists From jackjansen@users.sourceforge.net Fri Nov 30 14:17:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/fm _Fmmodule.c,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/fm In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/fm Modified Files: _Fmmodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _Fmmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/fm/_Fmmodule.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** _Fmmodule.c 2001/09/05 10:30:25 1.2 --- _Fmmodule.c 2001/11/30 14:16:32 1.3 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- From jackjansen@users.sourceforge.net Fri Nov 30 14:17:04 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:04 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/evt _Evtmodule.c,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/evt In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/evt Modified Files: _Evtmodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _Evtmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/evt/_Evtmodule.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** _Evtmodule.c 2001/09/05 10:30:20 1.2 --- _Evtmodule.c 2001/11/30 14:16:32 1.3 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- From jackjansen@users.sourceforge.net Fri Nov 30 14:17:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/list _Listmodule.c,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/list In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/list Modified Files: _Listmodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _Listmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/list/_Listmodule.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** _Listmodule.c 2001/11/05 11:12:12 1.5 --- _Listmodule.c 2001/11/30 14:16:33 1.6 *************** *** 648,652 **** PyTypeObject List_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "List", /*tp_name*/ --- 648,652 ---- PyTypeObject List_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "List", /*tp_name*/ From jackjansen@users.sourceforge.net Fri Nov 30 14:17:04 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:04 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/dlg _Dlgmodule.c,1.4,1.5 dlgsupport.py,1.26,1.27 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/dlg In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/dlg Modified Files: _Dlgmodule.c dlgsupport.py Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _Dlgmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/dlg/_Dlgmodule.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** _Dlgmodule.c 2001/11/05 16:16:34 1.4 --- _Dlgmodule.c 2001/11/30 14:16:32 1.5 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 186,189 **** --- 182,188 ---- { PyObject *_res = NULL; + #ifndef DrawDialog + PyMac_PRECHECK(DrawDialog); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 198,201 **** --- 197,203 ---- PyObject *_res = NULL; RgnHandle updateRgn; + #ifndef UpdateDialog + PyMac_PRECHECK(UpdateDialog); + #endif if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &updateRgn)) *************** *** 212,215 **** --- 214,220 ---- PyObject *_res = NULL; DialogItemIndex itemNo; + #ifndef HideDialogItem + PyMac_PRECHECK(HideDialogItem); + #endif if (!PyArg_ParseTuple(_args, "h", &itemNo)) *************** *** 226,229 **** --- 231,237 ---- PyObject *_res = NULL; DialogItemIndex itemNo; + #ifndef ShowDialogItem + PyMac_PRECHECK(ShowDialogItem); + #endif if (!PyArg_ParseTuple(_args, "h", &itemNo)) *************** *** 241,244 **** --- 249,255 ---- DialogItemIndexZeroBased _rv; Point thePt; + #ifndef FindDialogItem + PyMac_PRECHECK(FindDialogItem); + #endif if (!PyArg_ParseTuple(_args, "O&", PyMac_GetPoint, &thePt)) *************** *** 254,257 **** --- 265,271 ---- { PyObject *_res = NULL; + #ifndef DialogCut + PyMac_PRECHECK(DialogCut); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 265,268 **** --- 279,285 ---- { PyObject *_res = NULL; + #ifndef DialogPaste + PyMac_PRECHECK(DialogPaste); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 276,279 **** --- 293,299 ---- { PyObject *_res = NULL; + #ifndef DialogCopy + PyMac_PRECHECK(DialogCopy); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 287,290 **** --- 307,313 ---- { PyObject *_res = NULL; + #ifndef DialogDelete + PyMac_PRECHECK(DialogDelete); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 302,305 **** --- 325,331 ---- Handle item; Rect box; + #ifndef GetDialogItem + PyMac_PRECHECK(GetDialogItem); + #endif if (!PyArg_ParseTuple(_args, "h", &itemNo)) *************** *** 324,327 **** --- 350,356 ---- Handle item; Rect box; + #ifndef SetDialogItem + PyMac_PRECHECK(SetDialogItem); + #endif if (!PyArg_ParseTuple(_args, "hhO&O&", &itemNo, *************** *** 346,349 **** --- 375,381 ---- SInt16 strtSel; SInt16 endSel; + #ifndef SelectDialogItemText + PyMac_PRECHECK(SelectDialogItemText); + #endif if (!PyArg_ParseTuple(_args, "hhh", &itemNo, *************** *** 365,368 **** --- 397,403 ---- Handle theHandle; DITLMethod method; + #ifndef AppendDITL + PyMac_PRECHECK(AppendDITL); + #endif if (!PyArg_ParseTuple(_args, "O&h", ResObj_Convert, &theHandle, *************** *** 381,384 **** --- 416,422 ---- PyObject *_res = NULL; DialogItemIndex _rv; + #ifndef CountDITL + PyMac_PRECHECK(CountDITL); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 393,396 **** --- 431,437 ---- PyObject *_res = NULL; DialogItemIndex numberItems; + #ifndef ShortenDITL + PyMac_PRECHECK(ShortenDITL); + #endif if (!PyArg_ParseTuple(_args, "h", &numberItems)) *************** *** 413,416 **** --- 454,460 ---- Handle itemHandle; Rect box; + #ifndef InsertDialogItem + PyMac_PRECHECK(InsertDialogItem); + #endif if (!PyArg_ParseTuple(_args, "hhO&O&", &afterItem, *************** *** 440,443 **** --- 484,490 ---- DialogItemIndex amountToRemove; Boolean disposeItemData; + #ifndef RemoveDialogItems + PyMac_PRECHECK(RemoveDialogItems); + #endif if (!PyArg_ParseTuple(_args, "hhb", &itemNo, *************** *** 462,465 **** --- 509,515 ---- EventRecord event; DialogItemIndex itemHit; + #ifndef StdFilterProc + PyMac_PRECHECK(StdFilterProc); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 479,482 **** --- 529,535 ---- OSErr _err; DialogItemIndex newItem; + #ifndef SetDialogDefaultItem + PyMac_PRECHECK(SetDialogDefaultItem); + #endif if (!PyArg_ParseTuple(_args, "h", &newItem)) *************** *** 495,498 **** --- 548,554 ---- OSErr _err; DialogItemIndex newItem; + #ifndef SetDialogCancelItem + PyMac_PRECHECK(SetDialogCancelItem); + #endif if (!PyArg_ParseTuple(_args, "h", &newItem)) *************** *** 511,514 **** --- 567,573 ---- OSErr _err; Boolean tracks; + #ifndef SetDialogTracksCursor + PyMac_PRECHECK(SetDialogTracksCursor); + #endif if (!PyArg_ParseTuple(_args, "b", &tracks)) *************** *** 526,529 **** --- 585,591 ---- PyObject *_res = NULL; OSErr _err; + #ifndef AutoSizeDialog + PyMac_PRECHECK(AutoSizeDialog); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 541,544 **** --- 603,609 ---- SInt16 inItemNo; ControlHandle outControl; + #ifndef GetDialogItemAsControl + PyMac_PRECHECK(GetDialogItemAsControl); + #endif if (!PyArg_ParseTuple(_args, "h", &inItemNo)) *************** *** 560,563 **** --- 625,631 ---- SInt16 inHoriz; SInt16 inVert; + #ifndef MoveDialogItem + PyMac_PRECHECK(MoveDialogItem); + #endif if (!PyArg_ParseTuple(_args, "hhh", &inItemNo, *************** *** 582,585 **** --- 650,656 ---- SInt16 inWidth; SInt16 inHeight; + #ifndef SizeDialogItem + PyMac_PRECHECK(SizeDialogItem); + #endif if (!PyArg_ParseTuple(_args, "hhh", &inItemNo, *************** *** 603,606 **** --- 674,680 ---- SInt16 ditlID; DITLMethod method; + #ifndef AppendDialogItemList + PyMac_PRECHECK(AppendDialogItemList); + #endif if (!PyArg_ParseTuple(_args, "hh", &ditlID, *************** *** 622,625 **** --- 696,702 ---- SInt16 inButtonToPress; UInt32 inSecondsToWait; + #ifndef SetDialogTimeout + PyMac_PRECHECK(SetDialogTimeout); + #endif if (!PyArg_ParseTuple(_args, "hl", &inButtonToPress, *************** *** 642,645 **** --- 719,725 ---- UInt32 outSecondsToWait; UInt32 outSecondsRemaining; + #ifndef GetDialogTimeout + PyMac_PRECHECK(GetDialogTimeout); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 661,664 **** --- 741,747 ---- OSStatus _err; EventMask inMask; + #ifndef SetModalDialogEventMask + PyMac_PRECHECK(SetModalDialogEventMask); + #endif if (!PyArg_ParseTuple(_args, "H", &inMask)) *************** *** 677,680 **** --- 760,766 ---- OSStatus _err; EventMask outMask; + #ifndef GetModalDialogEventMask + PyMac_PRECHECK(GetModalDialogEventMask); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 691,694 **** --- 777,783 ---- PyObject *_res = NULL; WindowPtr _rv; + #ifndef GetDialogWindow + PyMac_PRECHECK(GetDialogWindow); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 703,706 **** --- 792,798 ---- PyObject *_res = NULL; TEHandle _rv; + #ifndef GetDialogTextEditHandle + PyMac_PRECHECK(GetDialogTextEditHandle); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 715,718 **** --- 807,813 ---- PyObject *_res = NULL; SInt16 _rv; + #ifndef GetDialogDefaultItem + PyMac_PRECHECK(GetDialogDefaultItem); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 727,730 **** --- 822,828 ---- PyObject *_res = NULL; SInt16 _rv; + #ifndef GetDialogCancelItem + PyMac_PRECHECK(GetDialogCancelItem); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 739,742 **** --- 837,843 ---- PyObject *_res = NULL; SInt16 _rv; + #ifndef GetDialogKeyboardFocusItem + PyMac_PRECHECK(GetDialogKeyboardFocusItem); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 750,753 **** --- 851,857 ---- { PyObject *_res = NULL; + #ifndef SetPortDialogPort + PyMac_PRECHECK(SetPortDialogPort); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 762,765 **** --- 866,872 ---- PyObject *_res = NULL; CGrafPtr _rv; + #ifndef GetDialogPort + PyMac_PRECHECK(GetDialogPort); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 770,773 **** --- 877,897 ---- } + #if !TARGET_API_MAC_CARBON + + static PyObject *DlgObj_SetGrafPortOfDialog(DialogObject *_self, PyObject *_args) + { + PyObject *_res = NULL; + #ifndef SetGrafPortOfDialog + PyMac_PRECHECK(SetGrafPortOfDialog); + #endif + if (!PyArg_ParseTuple(_args, "")) + return NULL; + SetGrafPortOfDialog(_self->ob_itself); + Py_INCREF(Py_None); + _res = Py_None; + return _res; + } + #endif + static PyMethodDef DlgObj_methods[] = { {"DrawDialog", (PyCFunction)DlgObj_DrawDialog, 1, *************** *** 852,855 **** --- 976,983 ---- "() -> (CGrafPtr _rv)"}, + #if !TARGET_API_MAC_CARBON + {"SetGrafPortOfDialog", (PyCFunction)DlgObj_SetGrafPortOfDialog, 1, + "() -> None"}, + #endif {NULL, NULL, 0} }; *************** *** 879,883 **** PyTypeObject Dialog_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "Dialog", /*tp_name*/ --- 1007,1011 ---- PyTypeObject Dialog_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "Dialog", /*tp_name*/ *************** *** 912,915 **** --- 1040,1046 ---- SInt32 refCon; Handle items; + #ifndef NewDialog + PyMac_PRECHECK(NewDialog); + #endif if (!PyArg_ParseTuple(_args, "O&O&bhO&blO&", PyMac_GetRect, &boundsRect, *************** *** 942,945 **** --- 1073,1079 ---- SInt16 dialogID; WindowPtr behind; + #ifndef GetNewDialog + PyMac_PRECHECK(GetNewDialog); + #endif if (!PyArg_ParseTuple(_args, "hO&", &dialogID, *************** *** 966,969 **** --- 1100,1106 ---- SInt32 refCon; Handle items; + #ifndef NewColorDialog + PyMac_PRECHECK(NewColorDialog); + #endif if (!PyArg_ParseTuple(_args, "O&O&bhO&blO&", PyMac_GetRect, &boundsRect, *************** *** 995,998 **** --- 1132,1138 ---- PyObject* modalFilter; DialogItemIndex itemHit; + #ifndef ModalDialog + PyMac_PRECHECK(ModalDialog); + #endif if (!PyArg_ParseTuple(_args, "O", &modalFilter)) *************** *** 1010,1013 **** --- 1150,1156 ---- Boolean _rv; EventRecord theEvent; + #ifndef IsDialogEvent + PyMac_PRECHECK(IsDialogEvent); + #endif if (!PyArg_ParseTuple(_args, "O&", PyMac_GetEventRecord, &theEvent)) *************** *** 1026,1029 **** --- 1169,1175 ---- DialogPtr theDialog; DialogItemIndex itemHit; + #ifndef DialogSelect + PyMac_PRECHECK(DialogSelect); + #endif if (!PyArg_ParseTuple(_args, "O&", PyMac_GetEventRecord, &theEvent)) *************** *** 1045,1048 **** --- 1191,1197 ---- SInt16 alertID; PyObject* modalFilter; + #ifndef Alert + PyMac_PRECHECK(Alert); + #endif if (!PyArg_ParseTuple(_args, "hO", &alertID, *************** *** 1062,1065 **** --- 1211,1217 ---- SInt16 alertID; PyObject* modalFilter; + #ifndef StopAlert + PyMac_PRECHECK(StopAlert); + #endif if (!PyArg_ParseTuple(_args, "hO", &alertID, *************** *** 1079,1082 **** --- 1231,1237 ---- SInt16 alertID; PyObject* modalFilter; + #ifndef NoteAlert + PyMac_PRECHECK(NoteAlert); + #endif if (!PyArg_ParseTuple(_args, "hO", &alertID, *************** *** 1096,1099 **** --- 1251,1257 ---- SInt16 alertID; PyObject* modalFilter; + #ifndef CautionAlert + PyMac_PRECHECK(CautionAlert); + #endif if (!PyArg_ParseTuple(_args, "hO", &alertID, *************** *** 1114,1117 **** --- 1272,1278 ---- Str255 param2; Str255 param3; + #ifndef ParamText + PyMac_PRECHECK(ParamText); + #endif if (!PyArg_ParseTuple(_args, "O&O&O&O&", PyMac_GetStr255, param0, *************** *** 1134,1137 **** --- 1295,1301 ---- Handle item; Str255 text; + #ifndef GetDialogItemText + PyMac_PRECHECK(GetDialogItemText); + #endif if (!PyArg_ParseTuple(_args, "O&", ResObj_Convert, &item)) *************** *** 1149,1152 **** --- 1313,1319 ---- Handle item; Str255 text; + #ifndef SetDialogItemText + PyMac_PRECHECK(SetDialogItemText); + #endif if (!PyArg_ParseTuple(_args, "O&O&", ResObj_Convert, &item, *************** *** 1164,1167 **** --- 1331,1337 ---- PyObject *_res = NULL; SInt16 _rv; + #ifndef GetAlertStage + PyMac_PRECHECK(GetAlertStage); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 1176,1179 **** --- 1346,1352 ---- PyObject *_res = NULL; SInt16 fontNum; + #ifndef SetDialogFont + PyMac_PRECHECK(SetDialogFont); + #endif if (!PyArg_ParseTuple(_args, "h", &fontNum)) *************** *** 1188,1191 **** --- 1361,1367 ---- { PyObject *_res = NULL; + #ifndef ResetAlertStage + PyMac_PRECHECK(ResetAlertStage); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 1205,1208 **** --- 1381,1387 ---- Str255 param2; Str255 param3; + #ifndef GetParamText + PyMac_PRECHECK(GetParamText); + #endif if (!PyArg_ParseTuple(_args, "O&O&O&O&", PyMac_GetStr255, param0, *************** *** 1234,1237 **** --- 1413,1419 ---- Handle inItemListHandle; UInt32 inFlags; + #ifndef NewFeaturesDialog + PyMac_PRECHECK(NewFeaturesDialog); + #endif if (!PyArg_ParseTuple(_args, "O&O&bhO&blO&l", PyMac_GetRect, &inBoundsRect, *************** *** 1265,1268 **** --- 1447,1453 ---- DialogPtr _rv; WindowPtr window; + #ifndef GetDialogFromWindow + PyMac_PRECHECK(GetDialogFromWindow); + #endif if (!PyArg_ParseTuple(_args, "O&", WinObj_Convert, &window)) Index: dlgsupport.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/dlg/dlgsupport.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** dlgsupport.py 2001/11/05 16:16:39 1.26 --- dlgsupport.py 2001/11/30 14:16:32 1.27 *************** *** 246,251 **** # Create the generator classes used to populate the lists ! Function = OSErrFunctionGenerator ! Method = OSErrMethodGenerator # Create and populate the lists --- 246,251 ---- # Create the generator classes used to populate the lists ! Function = OSErrWeakLinkFunctionGenerator ! Method = OSErrWeakLinkMethodGenerator # Create and populate the lists From jackjansen@users.sourceforge.net Fri Nov 30 14:17:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/icn _Icnmodule.c,1.2,1.3 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/icn In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/icn Modified Files: _Icnmodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). Index: _Icnmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Mac/Modules/icn/_Icnmodule.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** _Icnmodule.c 2001/09/05 10:30:09 1.2 --- _Icnmodule.c 2001/11/30 14:16:33 1.3 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- From jackjansen@users.sourceforge.net Fri Nov 30 14:17:05 2001 From: jackjansen@users.sourceforge.net (Jack Jansen) Date: Fri, 30 Nov 2001 06:17:05 -0800 Subject: [Python-checkins] CVS: python/dist/src/Mac/Modules/mlte _Mltemodule.c,1.4,1.5 Message-ID: Update of /cvsroot/python/python/dist/src/Mac/Modules/mlte In directory usw-pr-cvs1:/tmp/cvs-serv22285/Mac/Modules/mlte Modified Files: _Mltemodule.c Log Message: Merged changes made on r22b2-branch between r22b2 and r22b2-mac (the changes from start of branch upto r22b2 were already merged, of course). 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/09/05 10:29:49 1.4 --- _Mltemodule.c 2001/11/30 14:16:33 1.5 *************** *** 6,15 **** - #ifdef _WIN32 - #include "pywintoolbox.h" - #else #include "macglue.h" #include "pymactoolbox.h" - #endif /* Macro to test whether a weak-loaded CFM function exists */ --- 6,11 ---- *************** *** 132,136 **** --- 128,134 ---- { PyObject *_res = NULL; + #ifndef TXNDeleteObject PyMac_PRECHECK(TXNDeleteObject); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 147,151 **** --- 145,151 ---- UInt32 iHeight; TXNFrameID iTXNFrameID; + #ifndef TXNResizeFrame PyMac_PRECHECK(TXNResizeFrame); + #endif if (!PyArg_ParseTuple(_args, "lll", &iWidth, *************** *** 170,174 **** --- 170,176 ---- SInt32 iRight; TXNFrameID iTXNFrameID; + #ifndef TXNSetFrameBounds PyMac_PRECHECK(TXNSetFrameBounds); + #endif if (!PyArg_ParseTuple(_args, "lllll", &iTop, *************** *** 193,197 **** --- 195,201 ---- PyObject *_res = NULL; EventRecord iEvent; + #ifndef TXNKeyDown PyMac_PRECHECK(TXNKeyDown); + #endif if (!PyArg_ParseTuple(_args, "O&", PyMac_GetEventRecord, &iEvent)) *************** *** 208,212 **** --- 212,218 ---- PyObject *_res = NULL; RgnHandle ioCursorRgn; + #ifndef TXNAdjustCursor PyMac_PRECHECK(TXNAdjustCursor); + #endif if (!PyArg_ParseTuple(_args, "O&", OptResObj_Convert, &ioCursorRgn)) *************** *** 223,227 **** --- 229,235 ---- PyObject *_res = NULL; EventRecord iEvent; + #ifndef TXNClick PyMac_PRECHECK(TXNClick); + #endif if (!PyArg_ParseTuple(_args, "O&", PyMac_GetEventRecord, &iEvent)) *************** *** 241,245 **** --- 249,255 ---- Boolean _rv; EventRecord iEvent; + #ifndef TXNTSMCheck PyMac_PRECHECK(TXNTSMCheck); + #endif if (!PyArg_ParseTuple(_args, "O&", PyMac_GetEventRecord, &iEvent)) *************** *** 256,260 **** --- 266,272 ---- { PyObject *_res = NULL; + #ifndef TXNSelectAll PyMac_PRECHECK(TXNSelectAll); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 269,273 **** --- 281,287 ---- PyObject *_res = NULL; Boolean iBecomingFocused; + #ifndef TXNFocus PyMac_PRECHECK(TXNFocus); + #endif if (!PyArg_ParseTuple(_args, "b", &iBecomingFocused)) *************** *** 283,287 **** --- 297,303 ---- { PyObject *_res = NULL; + #ifndef TXNUpdate PyMac_PRECHECK(TXNUpdate); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 296,300 **** --- 312,318 ---- PyObject *_res = NULL; GWorldPtr iDrawPort; + #ifndef TXNDraw PyMac_PRECHECK(TXNDraw); + #endif if (!PyArg_ParseTuple(_args, "O&", OptGWorldObj_Convert, &iDrawPort)) *************** *** 310,314 **** --- 328,334 ---- { PyObject *_res = NULL; + #ifndef TXNForceUpdate PyMac_PRECHECK(TXNForceUpdate); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 323,327 **** --- 343,349 ---- PyObject *_res = NULL; UInt32 _rv; + #ifndef TXNGetSleepTicks PyMac_PRECHECK(TXNGetSleepTicks); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 335,339 **** --- 357,363 ---- { PyObject *_res = NULL; + #ifndef TXNIdle PyMac_PRECHECK(TXNIdle); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 348,352 **** --- 372,378 ---- PyObject *_res = NULL; EventRecord iEvent; + #ifndef TXNGrowWindow PyMac_PRECHECK(TXNGrowWindow); + #endif if (!PyArg_ParseTuple(_args, "O&", PyMac_GetEventRecord, &iEvent)) *************** *** 363,367 **** --- 389,395 ---- PyObject *_res = NULL; short iPart; + #ifndef TXNZoomWindow PyMac_PRECHECK(TXNZoomWindow); + #endif if (!PyArg_ParseTuple(_args, "h", &iPart)) *************** *** 379,383 **** --- 407,413 ---- Boolean _rv; TXNActionKey oTXNActionKey; + #ifndef TXNCanUndo PyMac_PRECHECK(TXNCanUndo); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 393,397 **** --- 423,429 ---- { PyObject *_res = NULL; + #ifndef TXNUndo PyMac_PRECHECK(TXNUndo); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 407,411 **** --- 439,445 ---- Boolean _rv; TXNActionKey oTXNActionKey; + #ifndef TXNCanRedo PyMac_PRECHECK(TXNCanRedo); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 421,425 **** --- 455,461 ---- { PyObject *_res = NULL; + #ifndef TXNRedo PyMac_PRECHECK(TXNRedo); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 434,438 **** --- 470,476 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNCut PyMac_PRECHECK(TXNCut); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 448,452 **** --- 486,492 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNCopy PyMac_PRECHECK(TXNCopy); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 462,466 **** --- 502,508 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNPaste PyMac_PRECHECK(TXNPaste); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 476,480 **** --- 518,524 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNClear PyMac_PRECHECK(TXNClear); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 491,495 **** --- 535,541 ---- TXNOffset oStartOffset; TXNOffset oEndOffset; + #ifndef TXNGetSelection PyMac_PRECHECK(TXNGetSelection); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 507,511 **** --- 553,559 ---- PyObject *_res = NULL; Boolean iShowEnd; + #ifndef TXNShowSelection PyMac_PRECHECK(TXNShowSelection); + #endif if (!PyArg_ParseTuple(_args, "b", &iShowEnd)) *************** *** 522,526 **** --- 570,576 ---- PyObject *_res = NULL; Boolean _rv; + #ifndef TXNIsSelectionEmpty PyMac_PRECHECK(TXNIsSelectionEmpty); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 537,541 **** --- 587,593 ---- TXNOffset iStartOffset; TXNOffset iEndOffset; + #ifndef TXNSetSelection PyMac_PRECHECK(TXNSetSelection); + #endif if (!PyArg_ParseTuple(_args, "ll", &iStartOffset, *************** *** 558,562 **** --- 610,616 ---- UInt32 iEndOffset; ItemCount oRunCount; + #ifndef TXNCountRunsInRange PyMac_PRECHECK(TXNCountRunsInRange); + #endif if (!PyArg_ParseTuple(_args, "ll", &iStartOffset, *************** *** 577,581 **** --- 631,637 ---- PyObject *_res = NULL; ByteCount _rv; + #ifndef TXNDataSize PyMac_PRECHECK(TXNDataSize); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 593,597 **** --- 649,655 ---- TXNOffset iEndOffset; Handle oDataHandle; + #ifndef TXNGetData PyMac_PRECHECK(TXNGetData); + #endif if (!PyArg_ParseTuple(_args, "ll", &iStartOffset, *************** *** 616,620 **** --- 674,680 ---- Handle oDataHandle; TXNDataType iEncoding; + #ifndef TXNGetDataEncoded PyMac_PRECHECK(TXNGetDataEncoded); + #endif if (!PyArg_ParseTuple(_args, "llO&", &iStartOffset, *************** *** 642,646 **** --- 702,708 ---- TXNOffset iStartOffset; TXNOffset iEndOffset; + #ifndef TXNSetDataFromFile PyMac_PRECHECK(TXNSetDataFromFile); + #endif if (!PyArg_ParseTuple(_args, "hO&lll", &iFileRefNum, *************** *** 672,676 **** --- 734,740 ---- TXNOffset iStartOffset; TXNOffset iEndOffset; + #ifndef TXNSetData PyMac_PRECHECK(TXNSetData); + #endif if (!PyArg_ParseTuple(_args, "O&s#ll", PyMac_GetOSType, &iDataType, *************** *** 695,699 **** --- 759,765 ---- PyObject *_res = NULL; ItemCount _rv; + #ifndef TXNGetChangeCount PyMac_PRECHECK(TXNGetChangeCount); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 714,718 **** --- 780,786 ---- SInt16 iDataReference; SInt16 iResourceReference; + #ifndef TXNSave PyMac_PRECHECK(TXNSave); + #endif if (!PyArg_ParseTuple(_args, "O&O&lO&hh", PyMac_GetOSType, &iType, *************** *** 740,744 **** --- 808,814 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNRevert PyMac_PRECHECK(TXNRevert); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 754,758 **** --- 824,830 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNPageSetup PyMac_PRECHECK(TXNPageSetup); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 768,772 **** --- 840,846 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNPrint PyMac_PRECHECK(TXNPrint); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 782,786 **** --- 856,862 ---- PyObject *_res = NULL; Rect oViewRect; + #ifndef TXNGetViewRect PyMac_PRECHECK(TXNGetViewRect); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 798,802 **** --- 874,880 ---- GWorldPtr iWindow; Boolean iIsActualWindow; + #ifndef TXNAttachObjectToWindow PyMac_PRECHECK(TXNAttachObjectToWindow); + #endif if (!PyArg_ParseTuple(_args, "O&b", GWorldObj_Convert, &iWindow, *************** *** 816,820 **** --- 894,900 ---- PyObject *_res = NULL; Boolean _rv; + #ifndef TXNIsObjectAttachedToWindow PyMac_PRECHECK(TXNIsObjectAttachedToWindow); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 834,838 **** --- 914,920 ---- DragReference iDragReference; Boolean iDifferentObjectSameWindow; + #ifndef TXNDragTracker PyMac_PRECHECK(TXNDragTracker); + #endif if (!PyArg_ParseTuple(_args, "lhO&O&b", &iTXNFrameID, *************** *** 862,866 **** --- 944,950 ---- DragReference iDragReference; Boolean iDifferentObjectSameWindow; + #ifndef TXNDragReceiver PyMac_PRECHECK(TXNDragReceiver); + #endif if (!PyArg_ParseTuple(_args, "lO&O&b", &iTXNFrameID, *************** *** 886,890 **** --- 970,976 ---- TXNFrameID iTXNFrameID; TXNScrollBarState iActiveState; + #ifndef TXNActivate PyMac_PRECHECK(TXNActivate); + #endif if (!PyArg_ParseTuple(_args, "ll", &iTXNFrameID, *************** *** 907,911 **** --- 993,999 ---- SInt16 iMenuID; SInt16 iMenuItem; + #ifndef TXNDoFontMenuSelection PyMac_PRECHECK(TXNDoFontMenuSelection); + #endif if (!PyArg_ParseTuple(_args, "O&hh", TXNFontMenuObj_Convert, &iTXNFontMenuObject, *************** *** 928,932 **** --- 1016,1022 ---- OSStatus _err; TXNFontMenuObject iTXNFontMenuObject; + #ifndef TXNPrepareFontMenu PyMac_PRECHECK(TXNPrepareFontMenu); + #endif if (!PyArg_ParseTuple(_args, "O&", TXNFontMenuObj_Convert, &iTXNFontMenuObject)) *************** *** 1057,1061 **** PyTypeObject TXNObject_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "TXNObject", /*tp_name*/ --- 1147,1151 ---- PyTypeObject TXNObject_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "TXNObject", /*tp_name*/ *************** *** 1120,1124 **** --- 1210,1216 ---- OSStatus _err; MenuHandle oFontMenuHandle; + #ifndef TXNGetFontMenuHandle PyMac_PRECHECK(TXNGetFontMenuHandle); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 1135,1139 **** --- 1227,1233 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNDisposeFontMenuObject PyMac_PRECHECK(TXNDisposeFontMenuObject); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 1169,1173 **** PyTypeObject TXNFontMenuObject_Type = { ! PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "TXNFontMenuObject", /*tp_name*/ --- 1263,1267 ---- PyTypeObject TXNFontMenuObject_Type = { ! PyObject_HEAD_INIT(NULL) 0, /*ob_size*/ "TXNFontMenuObject", /*tp_name*/ *************** *** 1203,1207 **** --- 1297,1303 ---- TXNObject oTXNObject; TXNFrameID oTXNFrameID; + #ifndef TXNNewObject PyMac_PRECHECK(TXNNewObject); + #endif if (!PyArg_ParseTuple(_args, "O&O&O&llO&l", OptFSSpecPtr_Convert, &iFileSpec, *************** *** 1233,1237 **** --- 1329,1335 ---- { PyObject *_res = NULL; + #ifndef TXNTerminateTextension PyMac_PRECHECK(TXNTerminateTextension); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 1246,1250 **** --- 1344,1350 ---- PyObject *_res = NULL; Boolean _rv; + #ifndef TXNIsScrapPastable PyMac_PRECHECK(TXNIsScrapPastable); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 1259,1263 **** --- 1359,1365 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNConvertToPublicScrap PyMac_PRECHECK(TXNConvertToPublicScrap); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 1273,1277 **** --- 1375,1381 ---- PyObject *_res = NULL; OSStatus _err; + #ifndef TXNConvertFromPublicScrap PyMac_PRECHECK(TXNConvertFromPublicScrap); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; *************** *** 1291,1295 **** --- 1395,1401 ---- SInt16 iStartHierMenuID; TXNFontMenuObject oTXNFontMenuObject; + #ifndef TXNNewFontMenuObject PyMac_PRECHECK(TXNNewFontMenuObject); + #endif if (!PyArg_ParseTuple(_args, "O&hh", MenuObj_Convert, &iFontMenuHandle, *************** *** 1312,1316 **** --- 1418,1424 ---- TXNVersionValue _rv; TXNFeatureBits oFeatureFlags; + #ifndef TXNVersionInformation PyMac_PRECHECK(TXNVersionInformation); + #endif if (!PyArg_ParseTuple(_args, "")) return NULL; From fdrake@users.sourceforge.net Fri Nov 30 15:37:35 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 30 Nov 2001 07:37:35 -0800 Subject: [Python-checkins] CVS: python/dist/src/Lib/xml/dom __init__.py,1.9,1.10 Message-ID: Update of /cvsroot/python/python/dist/src/Lib/xml/dom In directory usw-pr-cvs1:/tmp/cvs-serv11721/Lib/xml/dom Modified Files: __init__.py Log Message: Added the convenience constants that are present in PyXML to make these more similar. Index: __init__.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/xml/dom/__init__.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** __init__.py 2001/02/22 14:04:09 1.9 --- __init__.py 2001/11/30 15:37:33 1.10 *************** *** 117,119 **** --- 117,125 ---- code = INVALID_ACCESS_ERR + + XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace" + XMLNS_NAMESPACE = "http://www.w3.org/2000/xmlns/" + XHTML_NAMESPACE = "http://www.w3.org/1999/xhtml" + EMPTY_NAMESPACE = None + from domreg import getDOMImplementation,registerDOMImplementation From fdrake@users.sourceforge.net Fri Nov 30 15:37:35 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 30 Nov 2001 07:37:35 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib xmldom.tex,1.17,1.18 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv11721/Doc/lib Modified Files: xmldom.tex Log Message: Added the convenience constants that are present in PyXML to make these more similar. Index: xmldom.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/xmldom.tex,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** xmldom.tex 2001/10/26 20:09:49 1.17 --- xmldom.tex 2001/11/30 15:37:33 1.18 *************** *** 113,116 **** --- 113,150 ---- \end{funcdesc} + + Some convenience constants are also provided: + + \begin{datadesc}{EMPTY_NAMESPACE} + The value used to indicate that no namespace is associated with a + node in the DOM. This is typically found as the + \member{namespaceURI} of a node, or used as the \var{namespaceURI} + parameter to a namespaces-specific method. + \versionadded{2.2} + \end{datadesc} + + \begin{datadesc}{XML_NAMESPACE} + The namespace URI associated with the reserved prefix \code{xml}, as + defined by + \citetitle[http://www.w3.org/TR/REC-xml-names/]{Namespaces in XML} + (section~4). + \versionadded{2.2} + \end{datadesc} + + \begin{datadesc}{XMLNS_NAMESPACE} + The namespace URI for namespace declarations, as defined by + \citetitle[http://www.w3.org/TR/DOM-Level-2-Core/core.html]{Document + Object Model (DOM) Level 2 Core Specification} (section~1.1.8). + \versionadded{2.2} + \end{datadesc} + + \begin{datadesc}{XHTML_NAMESPACE} + The URI of the XHTML namespace as defined by + \citetitle[http://www.w3.org/TR/xhtml1/]{XHTML 1.0: The Extensible + HyperText Markup Language} (section~3.1.1). + \versionadded{2.2} + \end{datadesc} + + % Should the Node documentation go here? *************** *** 124,127 **** --- 158,162 ---- rather than at the module level to conform with the DOM specifications. + \subsection{Objects in the DOM \label{dom-objects}} From fdrake@users.sourceforge.net Fri Nov 30 16:58:18 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 30 Nov 2001 08:58:18 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib xmldom.tex,1.18,1.19 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv32583/lib Modified Files: xmldom.tex Log Message: Minor adjustments to markup for the getDOMImplementation() description. Index: xmldom.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/xmldom.tex,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** xmldom.tex 2001/11/30 15:37:33 1.18 --- xmldom.tex 2001/11/30 16:58:15 1.19 *************** *** 99,114 **** \end{funcdesc} ! \begin{funcdesc}{getDOMImplementation}{name = None, features = ()} Return a suitable DOM implementation. The \var{name} is either well-known, the module name of a DOM implementation, or ! \code{None}. If it is not \code{None}, imports the corresponding module and ! returns a \class{DOMImplementation} object if the import succeeds. If ! no name is given, and if the environment variable \envvar{PYTHON_DOM} is ! set, this variable is used to find the implementation. ! If name is not given, consider the available implementations to find ! one with the required feature set. If no implementation can be found, ! raise an \exception{ImportError}. The features list must be a sequence of ! (feature, version) pairs which are passed to hasFeature. \end{funcdesc} --- 99,117 ---- \end{funcdesc} ! \begin{funcdesc}{getDOMImplementation}{\optional{name\optional{, features}}} Return a suitable DOM implementation. The \var{name} is either well-known, the module name of a DOM implementation, or ! \code{None}. If it is not \code{None}, imports the corresponding ! module and returns a \class{DOMImplementation} object if the import ! succeeds. If no name is given, and if the environment variable ! \envvar{PYTHON_DOM} is set, this variable is used to find the ! implementation. ! If name is not given, this examines the available implementations to ! find one with the required feature set. If no implementation can be ! found, raise an \exception{ImportError}. The features list must be a ! sequence of \code{(\var{feature}, \var{version})} pairs which are ! passed to the \method{hasFeature()} method on available ! \class{DOMImplementation} objects. \end{funcdesc} From fdrake@users.sourceforge.net Fri Nov 30 18:09:58 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 30 Nov 2001 10:09:58 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/texinputs python.sty,1.85,1.86 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/texinputs In directory usw-pr-cvs1:/tmp/cvs-serv19727/texinputs Modified Files: python.sty Log Message: Add a new environment in the Python docs markup: seealso*. This is similar to seealso, but does not add the "See also:" header or put the content in a box in the HTML version. Updated the description of \seeurl to better indicate when it should be used; the old description was written before we had \seetitle. Index: python.sty =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/texinputs/python.sty,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** python.sty 2001/11/02 20:53:19 1.85 --- python.sty 2001/11/30 18:09:54 1.86 *************** *** 1097,1103 **** \end{fulllineitems} } ! \newenvironment{seealso}[0]{ \par - \strong{See Also:}\par \def\seetext##1{\par{##1}} \let\seemodule=\py@seemodule --- 1097,1103 ---- \end{fulllineitems} } ! ! \newenvironment{seealso*}{ \par \def\seetext##1{\par{##1}} \let\seemodule=\py@seemodule *************** *** 1107,1111 **** \let\seeurl=\py@seeurl }{\par} ! % Allow the Python release number to be specified independently of the --- 1107,1121 ---- \let\seeurl=\py@seeurl }{\par} ! \newenvironment{seealso}{ ! \par ! \strong{See Also:} ! \par ! \def\seetext##1{\par{##1}} ! \let\seemodule=\py@seemodule ! \let\seepep=\py@seepep ! \let\seerfc=\py@seerfc ! \let\seetitle=\py@seetitle ! \let\seeurl=\py@seeurl ! }{\par} % Allow the Python release number to be specified independently of the From fdrake@users.sourceforge.net Fri Nov 30 18:10:22 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 30 Nov 2001 10:10:22 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/doc doc.tex,1.56,1.57 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/doc In directory usw-pr-cvs1:/tmp/cvs-serv19727/doc Modified Files: doc.tex Log Message: Add a new environment in the Python docs markup: seealso*. This is similar to seealso, but does not add the "See also:" header or put the content in a box in the HTML version. Updated the description of \seeurl to better indicate when it should be used; the old description was written before we had \seetitle. Index: doc.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/doc/doc.tex,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -d -r1.56 -r1.57 *** doc.tex 2001/10/20 04:18:14 1.56 --- doc.tex 2001/11/30 18:09:48 1.57 *************** *** 1303,1314 **** Many sections include a list of references to module documentation or external documents. These lists are created using the ! \env{seealso} environment. This environment defines some ! additional macros to support creating reference entries in a ! reasonable manner. The \env{seealso} environment is typically placed in a section just before any sub-sections. This is done to ensure that reference links related to the section are not hidden in a ! subsection in the hypertext renditions of the documentation. \begin{envdesc}{seealso}{} --- 1303,1319 ---- Many sections include a list of references to module documentation or external documents. These lists are created using the ! \env{seealso} or \env{seealso*} environments. These environments ! define some additional macros to support creating reference ! entries in a reasonable manner. The \env{seealso} environment is typically placed in a section just before any sub-sections. This is done to ensure that reference links related to the section are not hidden in a ! subsection in the hypertext renditions of the documentation. For ! the HTML output, it is shown as a ``side bar,'' boxed off from the ! main flow of the text. The \env{seealso*} environment is ! different in that it should be used when a list of references is ! being presented as part of the primary content; it is not ! specially set off from the text. \begin{envdesc}{seealso}{} *************** *** 1317,1320 **** --- 1322,1333 ---- \end{envdesc} + \begin{envdesc}{seealso*}{} + This environment is used to create a list of references which + form part of the main content. It is not given a special + header and is not set off from the main flow of the text. It + provides the same additional markup used to describe individual + references. + \end{envdesc} + For each of the following macros, \var{why} should be one or more complete sentences, starting with a capital letter (unless it *************** *** 1323,1327 **** These macros are only defined within the content of the ! \env{seealso} environment. \begin{macrodesc}{seemodule}{\op{key}\p{name}\p{why}} --- 1336,1340 ---- These macros are only defined within the content of the ! \env{seealso} and \env{seealso*} environments. \begin{macrodesc}{seemodule}{\op{key}\p{name}\p{why}} *************** *** 1370,1376 **** \begin{macrodesc}{seeurl}{\p{url}\p{why}} References to specific on-line resources should be given using ! the \macro{seeurl} macro. No title is associated with the ! reference, but the \var{why} text may include a title marked ! using the \macro{citetitle} macro. \end{macrodesc} --- 1383,1390 ---- \begin{macrodesc}{seeurl}{\p{url}\p{why}} References to specific on-line resources should be given using ! the \macro{seeurl} macro if they don't have a meaningful title. ! Online documents which have identifiable titles should be ! referenced using the \macro{seetitle} macro, using the optional ! parameter to that macro to provide the URL. \end{macrodesc} From fdrake@users.sourceforge.net Fri Nov 30 18:10:25 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 30 Nov 2001 10:10:25 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/perl python.perl,1.112,1.113 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/perl In directory usw-pr-cvs1:/tmp/cvs-serv19727/perl Modified Files: python.perl Log Message: Add a new environment in the Python docs markup: seealso*. This is similar to seealso, but does not add the "See also:" header or put the content in a box in the HTML version. Updated the description of \seeurl to better indicate when it should be used; the old description was written before we had \seetitle. Index: python.perl =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/perl/python.perl,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** python.perl 2001/10/26 03:09:27 1.112 --- python.perl 2001/11/30 18:09:50 1.113 *************** *** 1726,1729 **** --- 1726,1735 ---- } + sub do_env_seealsostar{ + return ("
\n " + . @_[0] + . '
'); + } + sub do_cmd_seemodule{ # Insert the right magic to jump to the module definition. This should From fdrake@users.sourceforge.net Fri Nov 30 18:17:27 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 30 Nov 2001 10:17:27 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/lib tkinter.tex,1.5,1.6 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/lib In directory usw-pr-cvs1:/tmp/cvs-serv21472/lib Modified Files: tkinter.tex Log Message: Change the chapter title to reflect the Tk affinity. Use the new seealso* environment in the section pointing out other GUI toolkits. Index: tkinter.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/tkinter.tex,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tkinter.tex 2001/11/29 21:09:08 1.5 --- tkinter.tex 2001/11/30 18:17:24 1.6 *************** *** 1,3 **** ! \chapter{Graphical User Interface Modules \label{gui}} \index{GUI} --- 1,3 ---- ! \chapter{Graphical User Interfaces with Tk \label{tkinter}} \index{GUI} *************** *** 1742,1746 **** There are an number of extension widget sets to \refmodule{Tkinter}. ! \begin{seealso} \seetitle[http://pmw.sourceforge.net/]{Python megawidgets}{is a toolkit for building high-level compound widgets in Python using the --- 1742,1746 ---- There are an number of extension widget sets to \refmodule{Tkinter}. ! \begin{seealso*} \seetitle[http://pmw.sourceforge.net/]{Python megawidgets}{is a toolkit for building high-level compound widgets in Python using the *************** *** 1766,1770 **** still in the early stages. } ! \end{seealso} --- 1766,1770 ---- still in the early stages. } ! \end{seealso*} *************** *** 1772,1776 **** most commonly used one. ! \begin{seealso} \seetitle[http://www.wxwindows.org]{wxWindows}{ is a GUI toolkit that combines the most attractive attributes of Qt, --- 1772,1776 ---- most commonly used one. ! \begin{seealso*} \seetitle[http://www.wxwindows.org]{wxWindows}{ is a GUI toolkit that combines the most attractive attributes of Qt, *************** *** 1818,1822 **** is available. } ! \end{seealso} % XXX Reference URLs that compare the different UI packages --- 1818,1822 ---- is available. } ! \end{seealso*} % XXX Reference URLs that compare the different UI packages From fdrake@users.sourceforge.net Fri Nov 30 19:06:20 2001 From: fdrake@users.sourceforge.net (Fred L. Drake) Date: Fri, 30 Nov 2001 11:06:20 -0800 Subject: [Python-checkins] CVS: python/dist/src/Doc/tools/sgmlconv conversion.xml,1.23,1.24 Message-ID: Update of /cvsroot/python/python/dist/src/Doc/tools/sgmlconv In directory usw-pr-cvs1:/tmp/cvs-serv32478/tools/sgmlconv Modified Files: conversion.xml Log Message: Added two new conversion specifications. Index: conversion.xml =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/tools/sgmlconv/conversion.xml,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** conversion.xml 2001/10/25 15:14:57 1.23 --- conversion.xml 2001/11/30 19:06:18 1.24 *************** *** 191,194 **** --- 191,197 ---- + + no +