pywin32-checkins Mailing List for Python for Windows Extensions (Page 32)
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(1) |
Jun
(6) |
Jul
(50) |
Aug
(11) |
Sep
(24) |
Oct
(184) |
Nov
(118) |
Dec
(22) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(31) |
Feb
(25) |
Mar
(34) |
Apr
(105) |
May
(49) |
Jun
(38) |
Jul
(39) |
Aug
(7) |
Sep
(98) |
Oct
(79) |
Nov
(20) |
Dec
(17) |
2005 |
Jan
(66) |
Feb
(32) |
Mar
(43) |
Apr
(30) |
May
(58) |
Jun
(30) |
Jul
(16) |
Aug
(4) |
Sep
(21) |
Oct
(42) |
Nov
(11) |
Dec
(14) |
2006 |
Jan
(42) |
Feb
(30) |
Mar
(22) |
Apr
(1) |
May
(9) |
Jun
(15) |
Jul
(20) |
Aug
(9) |
Sep
(8) |
Oct
(1) |
Nov
(9) |
Dec
(43) |
2007 |
Jan
(52) |
Feb
(45) |
Mar
(20) |
Apr
(12) |
May
(59) |
Jun
(39) |
Jul
(35) |
Aug
(31) |
Sep
(17) |
Oct
(20) |
Nov
(4) |
Dec
(4) |
2008 |
Jan
(28) |
Feb
(111) |
Mar
(4) |
Apr
(27) |
May
(40) |
Jun
(27) |
Jul
(32) |
Aug
(94) |
Sep
(87) |
Oct
(153) |
Nov
(336) |
Dec
(331) |
2009 |
Jan
(298) |
Feb
(127) |
Mar
(20) |
Apr
(8) |
May
|
Jun
(10) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
(2) |
Nov
|
Dec
(1) |
2010 |
Jan
(7) |
Feb
(1) |
Mar
|
Apr
|
May
(15) |
Jun
(4) |
Jul
(3) |
Aug
(28) |
Sep
(1) |
Oct
(19) |
Nov
(16) |
Dec
(6) |
2011 |
Jan
(2) |
Feb
(18) |
Mar
(17) |
Apr
(12) |
May
(5) |
Jun
(11) |
Jul
(7) |
Aug
(2) |
Sep
(2) |
Oct
(4) |
Nov
(4) |
Dec
|
2012 |
Jan
(6) |
Feb
(2) |
Mar
|
Apr
(8) |
May
(4) |
Jun
(3) |
Jul
(13) |
Aug
(27) |
Sep
(8) |
Oct
(9) |
Nov
(3) |
Dec
(2) |
2013 |
Jan
|
Feb
(1) |
Mar
(5) |
Apr
(10) |
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(9) |
2014 |
Jan
(2) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(4) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(1) |
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
(6) |
May
(2) |
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(3) |
Feb
(2) |
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32net In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15705/win32net Modified Files: win32netfile.cpp win32netgroup.cpp win32netmisc.cpp win32netmodule.cpp win32netsession.cpp win32netuse.cpp win32netuser.cpp Log Message: Avoid lots of warnings including WRITE_RESTRICTED being redefined by letting pywintypes.h manage the order etc of including python.h, windows.h and structmember.h. Also add Py_CLEAR and Py_RETURN_NONE to py2.3 builds. Index: win32netmisc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netmisc.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** win32netmisc.cpp 4 Jun 2008 08:18:55 -0000 1.14 --- win32netmisc.cpp 3 Jan 2009 06:43:59 -0000 1.15 *************** *** 4,12 **** // // @doc ! #include "windows.h" #include "lm.h" #include "lmuseflg.h" - #include "Python.h" - #include "PyWinTypes.h" #include "win32net.h" #include "stddef.h" --- 4,10 ---- // // @doc ! #include "PyWinTypes.h" #include "lm.h" #include "lmuseflg.h" #include "win32net.h" #include "stddef.h" Index: win32netmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netmodule.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** win32netmodule.cpp 9 Dec 2008 07:21:06 -0000 1.27 --- win32netmodule.cpp 3 Jan 2009 06:43:59 -0000 1.28 *************** *** 30,38 **** #endif ! #include "windows.h" #include "lm.h" #include "lmuseflg.h" - #include "Python.h" - #include "PyWinTypes.h" #include "win32net.h" --- 30,36 ---- #endif ! #include "PyWinTypes.h" #include "lm.h" #include "lmuseflg.h" #include "win32net.h" Index: win32netuse.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netuse.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** win32netuse.cpp 18 May 2006 07:44:15 -0000 1.5 --- win32netuse.cpp 3 Jan 2009 06:43:59 -0000 1.6 *************** *** 4,12 **** // // @doc ! #include "windows.h" #include "lm.h" #include "lmuseflg.h" - #include "Python.h" - #include "PyWinTypes.h" #include "win32net.h" #include "stddef.h" --- 4,10 ---- // // @doc ! #include "PyWinTypes.h" #include "lm.h" #include "lmuseflg.h" #include "win32net.h" #include "stddef.h" Index: win32netsession.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netsession.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** win32netsession.cpp 12 Jan 2005 23:38:29 -0000 1.4 --- win32netsession.cpp 3 Jan 2009 06:43:59 -0000 1.5 *************** *** 3,12 **** #include "stdio.h" #include "assert.h" ! #include "windows.h" #include "lm.h" - #include "windows.h" - #include "Python.h" #include "WinUser.h" - #include "PyWinTypes.h" #include "win32net.h" --- 3,9 ---- #include "stdio.h" #include "assert.h" ! #include "PyWinTypes.h" #include "lm.h" #include "WinUser.h" #include "win32net.h" Index: win32netuser.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netuser.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** win32netuser.cpp 4 Aug 2006 08:32:48 -0000 1.9 --- win32netuser.cpp 3 Jan 2009 06:43:59 -0000 1.10 *************** *** 8,15 **** ***********************************************************/ // @doc - #include "windows.h" - #include "lm.h" - #include "Python.h" #include "PyWinTypes.h" #include "win32net.h" #include "stddef.h" --- 8,13 ---- ***********************************************************/ // @doc #include "PyWinTypes.h" + #include "lm.h" #include "win32net.h" #include "stddef.h" Index: win32netgroup.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netgroup.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** win32netgroup.cpp 6 Mar 2004 23:55:59 -0000 1.5 --- win32netgroup.cpp 3 Jan 2009 06:43:59 -0000 1.6 *************** *** 4,11 **** // // @doc - #include "windows.h" - #include "lm.h" - #include "Python.h" #include "PyWinTypes.h" #include "win32net.h" #include "stddef.h" --- 4,9 ---- // // @doc #include "PyWinTypes.h" + #include "lm.h" #include "win32net.h" #include "stddef.h" Index: win32netfile.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32net/win32netfile.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** win32netfile.cpp 24 May 2007 06:01:06 -0000 1.6 --- win32netfile.cpp 3 Jan 2009 06:43:59 -0000 1.7 *************** *** 1,12 **** // @doc // Implemented and contributed by Roger Upole. #include "stdio.h" #include "assert.h" - #include "windows.h" #include "lm.h" - #include "windows.h" - #include "Python.h" #include "WinUser.h" - #include "PyWinTypes.h" #include "win32net.h" --- 1,9 ---- // @doc // Implemented and contributed by Roger Upole. + #include "PyWinTypes.h" #include "stdio.h" #include "assert.h" #include "lm.h" #include "WinUser.h" #include "win32net.h" |
From: Mark H. <mha...@us...> - 2009-01-03 06:44:05
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15705 Modified Files: PyWinTypes.h win2krasmodule.cpp win32clipboardmodule.cpp win32crypt.i win32event.i win32file.i win32file_comm.cpp win32helpmodule.cpp win32job.i win32trace.cpp Log Message: Avoid lots of warnings including WRITE_RESTRICTED being redefined by letting pywintypes.h manage the order etc of including python.h, windows.h and structmember.h. Also add Py_CLEAR and Py_RETURN_NONE to py2.3 builds. Index: win32trace.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32trace.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** win32trace.cpp 3 Jan 2009 04:59:38 -0000 1.20 --- win32trace.cpp 3 Jan 2009 06:43:58 -0000 1.21 *************** *** 31,37 **** */ - #include "windows.h" - #include "Python.h" - #include "structmember.h" #include "PyWinTypes.h" #include "PyWinObjects.h" --- 31,34 ---- Index: win32file_comm.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file_comm.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** win32file_comm.cpp 11 Dec 2008 00:25:40 -0000 1.8 --- win32file_comm.cpp 3 Jan 2009 06:43:58 -0000 1.9 *************** *** 4,10 **** // @doc - #include "windows.h" - #include "Python.h" - #include "structmember.h" #include "PyWinTypes.h" #include "PyWinObjects.h" --- 4,7 ---- Index: win32clipboardmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32clipboardmodule.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** win32clipboardmodule.cpp 8 Dec 2008 13:16:37 -0000 1.25 --- win32clipboardmodule.cpp 3 Jan 2009 06:43:58 -0000 1.26 *************** *** 18,25 **** #define PY_SSIZE_T_CLEAN // this should be Py_ssize_t clean! - // #define UNICODE - // #define _UNICODE // CRT function (_tcs*) switch based on this - #include "windows.h" - #include "Python.h" #include "pywintypes.h" --- 18,21 ---- Index: win32job.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32job.i,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** win32job.i 17 Dec 2008 13:04:59 -0000 1.5 --- win32job.i 3 Jan 2009 06:43:58 -0000 1.6 *************** *** 9,13 **** #endif - #include "windows.h" #include "PyWinTypes.h" --- 9,12 ---- Index: win32event.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32event.i,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** win32event.i 13 Nov 2008 11:11:58 -0000 1.11 --- win32event.i 3 Jan 2009 06:43:58 -0000 1.12 *************** *** 7,15 **** //#define UNICODE #define _WIN32_WINNT 0x0501 - #ifndef MS_WINCE - #include "windows.h" - //#include "winsock2.h" - //#include "mswsock.h" - #endif %} --- 7,10 ---- Index: win32crypt.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32crypt.i,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** win32crypt.i 3 Jun 2007 14:53:07 -0000 1.5 --- win32crypt.i 3 Jan 2009 06:43:58 -0000 1.6 *************** *** 4,10 **** %{ - #include "windows.h" - #include "wincrypt.h" #include "PyWinTypes.h" #include "malloc.h" #include "abstract.h" // for PyObject_AsReadBuffer --- 4,9 ---- %{ #include "PyWinTypes.h" + #include "wincrypt.h" #include "malloc.h" #include "abstract.h" // for PyObject_AsReadBuffer Index: win32helpmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32helpmodule.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** win32helpmodule.cpp 17 Dec 2008 13:11:57 -0000 1.9 --- win32helpmodule.cpp 3 Jan 2009 06:43:58 -0000 1.10 *************** *** 16,24 **** - #include "windows.h" - #include "htmlhelp.h" - #include "Python.h" - #include "structmember.h" #include "PyWinTypes.h" #define DllExport _declspec(dllexport) --- 16,21 ---- #include "PyWinTypes.h" + #include "htmlhelp.h" #define DllExport _declspec(dllexport) Index: win2krasmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win2krasmodule.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** win2krasmodule.cpp 11 Dec 2008 00:25:40 -0000 1.10 --- win2krasmodule.cpp 3 Jan 2009 06:43:58 -0000 1.11 *************** *** 16,26 **** #endif ! #include "windows.h" #include "ras.h" #include "raserror.h" - #include "Python.h" - #include "pywintypes.h" - typedef PyObject* (*PFNReturnRasError)(char *fnName, long err); --- 16,23 ---- #endif ! #include "pywintypes.h" #include "ras.h" #include "raserror.h" typedef PyObject* (*PFNReturnRasError)(char *fnName, long err); Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** PyWinTypes.h 11 Dec 2008 00:25:40 -0000 1.58 --- PyWinTypes.h 3 Jan 2009 06:43:58 -0000 1.59 *************** *** 18,23 **** --- 18,61 ---- // includes - so it is safe to do here (and provides a handy // choke point for #include vagaries + + // Some other warnings generated by MSVC6 which we don't care about + #if (PY_VERSION_HEX < 0x02060000) + #pragma warning( disable:4035 ) + #endif + + #include "Python.h" + // many many files need python's structmember.h, and its possible people + // #included windows.h before including us... + #ifdef WRITE_RESTRICTED + #undef WRITE_RESTRICTED + #endif + #include "structmember.h" + // and python's structmember.h #defines this, conflicting with windows.h + #ifdef WRITE_RESTRICTED + #undef WRITE_RESTRICTED + #endif #include "windows.h" + #undef WRITE_RESTRICTED // stop anyone using the wrong one accidently... + + // Python 2.3 doesn't have Py_CLEAR... + #if (PY_VERSION_HEX < 0x02040000) + #ifndef Py_CLEAR + #define Py_CLEAR(op) \ + do { \ + if (op) { \ + PyObject *_py_tmp = (PyObject *)(op); \ + (op) = NULL; \ + Py_DECREF(_py_tmp); \ + } \ + } while (0) + #endif + // or Py_RETURN_NONE + #ifndef Py_RETURN_NONE + /* Macro for returning Py_None from a function */ + #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None + #endif + + #endif // (PY_VERSION_HEX < 0x02040000) Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.96 retrieving revision 1.97 diff -C2 -d -r1.96 -r1.97 *** win32file.i 11 Dec 2008 00:25:40 -0000 1.96 --- win32file.i 3 Jan 2009 06:43:58 -0000 1.97 *************** *** 30,34 **** #include "winsock2.h" #include "mswsock.h" ! #include "windows.h" #include "winbase.h" #include "assert.h" --- 30,34 ---- #include "winsock2.h" #include "mswsock.h" ! #include "pywintypes.h" #include "winbase.h" #include "assert.h" |
From: Mark H. <mha...@us...> - 2009-01-03 06:44:04
|
Update of /cvsroot/pywin32/pywin32/win32/src/PerfMon In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15705/PerfMon Modified Files: PerfObjectType.cpp Log Message: Avoid lots of warnings including WRITE_RESTRICTED being redefined by letting pywintypes.h manage the order etc of including python.h, windows.h and structmember.h. Also add Py_CLEAR and Py_RETURN_NONE to py2.3 builds. Index: PerfObjectType.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PerfMon/PerfObjectType.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PerfObjectType.cpp 11 Dec 2008 00:25:40 -0000 1.3 --- PerfObjectType.cpp 3 Jan 2009 06:43:59 -0000 1.4 *************** *** 3,9 **** // @doc - #include "windows.h" - #include "Python.h" - #include "structmember.h" #include "PyWinTypes.h" #include "winperf.h" --- 3,6 ---- |
From: Mark H. <mha...@us...> - 2009-01-03 06:42:32
|
Update of /cvsroot/pywin32/pywin32/win32/src/win32wnet In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15682/win32wnet Modified Files: win32wnet.cpp Log Message: fix silly error setting up hwnd in WNetAddConnection3 Index: win32wnet.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32wnet/win32wnet.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** win32wnet.cpp 2 Jan 2009 00:01:16 -0000 1.17 --- win32wnet.cpp 3 Jan 2009 06:42:20 -0000 1.18 *************** *** 219,223 **** HWND hwnd; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)hwnd)) return NULL; if (!PyWinObject_AsNETRESOURCE(obnr, &pNetResource, FALSE)) --- 219,223 ---- HWND hwnd; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) return NULL; if (!PyWinObject_AsNETRESOURCE(obnr, &pNetResource, FALSE)) |
From: Mark H. <mha...@us...> - 2009-01-03 06:11:51
|
Update of /cvsroot/pywin32/pywin32/isapi/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv14043 Modified Files: PyExtensionObjects.cpp PyExtensionObjects.h PyFilterObjects.h StdAfx.h Log Message: merge handling if WRITE_RESTRICTED warnings and allow to compile with vc6 Index: StdAfx.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/StdAfx.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StdAfx.h 6 Oct 2004 05:11:54 -0000 1.1 --- StdAfx.h 3 Jan 2009 06:11:46 -0000 1.2 *************** *** 35,38 **** --- 35,52 ---- #include "Python.h" + // No Py_RETURN_NONE in py23 + #if (PY_VERSION_HEX < 0x02040000) + /* Macro for returning Py_None from a function */ + #define Py_RETURN_NONE return Py_INCREF(Py_None), Py_None + #endif + + // include structmember here to deal with warnings related to WRITE_RESTRICTED + #ifdef WRITE_RESTRICTED + #undef WRITE_RESTRICTED + #endif + #include "structmember.h" + // avoid anyone accidently using the wrong WRITE_RESTRICTED... + #undef WRITE_RESTRICTED + //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. Index: PyExtensionObjects.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyExtensionObjects.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PyExtensionObjects.h 1 Jan 2009 22:37:29 -0000 1.8 --- PyExtensionObjects.h 3 Jan 2009 06:11:46 -0000 1.9 *************** *** 27,37 **** #include "ControlBlock.h" - - #ifdef WRITE_RESTRICTED - #undef WRITE_RESTRICTED - #endif - #include "structmember.h" - // avoid anyone accidently using the wrong WRITE_RESTRICTED... - #undef WRITE_RESTRICTED #include "tupleobject.h" --- 27,30 ---- Index: PyFilterObjects.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyFilterObjects.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyFilterObjects.h 30 Dec 2008 12:18:34 -0000 1.7 --- PyFilterObjects.h 3 Jan 2009 06:11:46 -0000 1.8 *************** *** 27,37 **** #include "FilterContext.h" - - #ifdef WRITE_RESTRICTED - #undef WRITE_RESTRICTED - #endif - #include "structmember.h" - // avoid anyone accidently using the wrong WRITE_RESTRICTED... - #undef WRITE_RESTRICTED #include "tupleobject.h" --- 27,30 ---- Index: PyExtensionObjects.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyExtensionObjects.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PyExtensionObjects.cpp 1 Jan 2009 22:37:29 -0000 1.12 --- PyExtensionObjects.cpp 3 Jan 2009 06:11:46 -0000 1.13 *************** *** 78,88 **** PyECB *pyECB = NULL; BOOL worked = FALSE; if (!g_callbackMap) CALLBACK_ERROR("Callback when no callback map exists"); ! PyObject *key = PyLong_FromVoidPtr(ecb->ConnID); if (!key) CALLBACK_ERROR("Failed to create map key from connection ID"); ! PyObject *ob = PyDict_GetItem(g_callbackMap, key); if (!ob) CALLBACK_ERROR("Failed to locate map entry for this commID"); --- 78,95 ---- PyECB *pyECB = NULL; BOOL worked = FALSE; + PyObject *callback = NULL; + PyObject *user_arg = NULL; + PyObject *args = NULL; + PyObject *key = NULL; + PyObject *ob = NULL; + PyObject *result = NULL; + if (!g_callbackMap) CALLBACK_ERROR("Callback when no callback map exists"); ! key = PyLong_FromVoidPtr(ecb->ConnID); if (!key) CALLBACK_ERROR("Failed to create map key from connection ID"); ! ob = PyDict_GetItem(g_callbackMap, key); if (!ob) CALLBACK_ERROR("Failed to locate map entry for this commID"); *************** *** 97,106 **** CALLBACK_ERROR("Object in callback map not a tuple of correct size?"); ! PyObject *callback = PyTuple_GET_ITEM(ob, 0); ! PyObject *user_arg = PyTuple_Size(ob)==2 ? PyTuple_GET_ITEM(ob, 1) : Py_None; ! PyObject *args = Py_BuildValue("(OOkk)", pyECB, user_arg, cbIO, dwError); if (!args) CALLBACK_ERROR("Failed to build callback args"); ! PyObject *result = PyObject_Call(callback, args, NULL); Py_DECREF(args); if (!result) --- 104,113 ---- CALLBACK_ERROR("Object in callback map not a tuple of correct size?"); ! callback = PyTuple_GET_ITEM(ob, 0); ! user_arg = PyTuple_Size(ob)==2 ? PyTuple_GET_ITEM(ob, 1) : Py_None; ! args = Py_BuildValue("(OOkk)", pyECB, user_arg, cbIO, dwError); if (!args) CALLBACK_ERROR("Failed to build callback args"); ! result = PyObject_Call(callback, args, NULL); Py_DECREF(args); if (!result) |
From: Mark H. <mha...@us...> - 2009-01-03 06:00:14
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12712/pywin/idle Modified Files: AutoIndent.py PyParse.py Log Message: correct unicode handling and make py3k friendly Index: PyParse.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle/PyParse.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyParse.py 14 Nov 2008 00:22:25 -0000 1.6 --- PyParse.py 3 Jan 2009 06:00:08 -0000 1.7 *************** *** 103,107 **** for ch in "\"'\\\n#": _tran[ord(ch)] = ch ! _tran = ''.join(_tran) del ch --- 103,110 ---- for ch in "\"'\\\n#": _tran[ord(ch)] = ch ! # We are called with unicode strings, and str.translate is one of the few ! # py2k functions which can't 'do the right thing' - so take care to ensure ! # _tran is full of unicode... ! _tran = u''.join(_tran) del ch Index: AutoIndent.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle/AutoIndent.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** AutoIndent.py 6 Dec 2008 00:39:59 -0000 1.7 --- AutoIndent.py 3 Jan 2009 06:00:08 -0000 1.8 *************** *** 1,40 **** ! #from Tkinter import TclError ! #import tkMessageBox ! #import tkSimpleDialog ! ! ###$ event <<newline-and-indent>> ! ###$ win <Key-Return> ! ###$ win <KP_Enter> ! ###$ unix <Key-Return> ! ###$ unix <KP_Enter> ! ! ###$ event <<indent-region>> ! ###$ win <Control-bracketright> ! ###$ unix <Alt-bracketright> ! ###$ unix <Control-bracketright> ! ! ###$ event <<dedent-region>> ! ###$ win <Control-bracketleft> ! ###$ unix <Alt-bracketleft> ! ###$ unix <Control-bracketleft> ! ! ###$ event <<comment-region>> ! ###$ win <Alt-Key-3> ! ###$ unix <Alt-Key-3> ! ! ###$ event <<uncomment-region>> ! ###$ win <Alt-Key-4> ! ###$ unix <Alt-Key-4> ! ! ###$ event <<tabify-region>> ! ###$ win <Alt-Key-5> ! ###$ unix <Alt-Key-5> ! ! ###$ event <<untabify-region>> ! ###$ win <Alt-Key-6> ! ###$ unix <Alt-Key-6> ! import PyParse class AutoIndent: --- 1,17 ---- ! import sys ! import string, tokenize import PyParse + from pywin import default_scintilla_encoding + if sys.version_info < (3,): + # in py2k, tokenize() takes a 'token eater' callback, while + # generate_tokens is a generator that works with str objects. + token_generator = tokenize.generate_tokens + else: + # in py3k tokenize() is the generator working with 'byte' objects, and + # token_generator is the 'undocumented b/w compat' function that + # theoretically works with str objects - but actually seems to fail) + token_generator = tokenize.tokenize + class AutoIndent: *************** *** 498,505 **** return raw, effective - import tokenize - _tokenize = tokenize - del tokenize - class IndentSearcher: --- 475,478 ---- *************** *** 525,553 **** else: val = self.text.get(mark, mark + " lineend+1c") return val.encode(default_scintilla_encoding) - def tokeneater(self, type, token, start, end, line, - INDENT=_tokenize.INDENT, - NAME=_tokenize.NAME, - OPENERS=('class', 'def', 'for', 'if', 'try', 'while')): - if self.finished: - pass - elif type == NAME and token in OPENERS: - self.blkopenline = line - elif type == INDENT and self.blkopenline: - self.indentedline = line - self.finished = 1 - def run(self): ! save_tabsize = _tokenize.tabsize ! _tokenize.tabsize = self.tabwidth try: try: ! _tokenize.tokenize(self.readline, self.tokeneater) ! except (_tokenize.TokenError, IndentationError): # since we cut off the tokenizer early, we can trigger # spurious errors pass finally: ! _tokenize.tabsize = save_tabsize return self.blkopenline, self.indentedline --- 498,528 ---- else: val = self.text.get(mark, mark + " lineend+1c") + # hrm - not sure this is correct in py3k - the source code may have + # an encoding declared, but the data will *always* be in + # default_scintilla_encoding - so if anyone looks at the encoding decl + # in the source they will be wrong. I think. Maybe. Or something... return val.encode(default_scintilla_encoding) def run(self): ! OPENERS=('class', 'def', 'for', 'if', 'try', 'while') ! INDENT=tokenize.INDENT ! NAME=tokenize.NAME ! ! save_tabsize = tokenize.tabsize ! tokenize.tabsize = self.tabwidth try: try: ! for (typ, token, start, end, line) in token_generator(self.readline): ! if typ == NAME and token in OPENERS: ! self.blkopenline = line ! elif type == INDENT and self.blkopenline: ! self.indentedline = line ! break ! ! except (tokenize.TokenError, IndentationError): # since we cut off the tokenizer early, we can trigger # spurious errors pass finally: ! tokenize.tabsize = save_tabsize return self.blkopenline, self.indentedline |
From: Mark H. <mha...@us...> - 2009-01-03 05:55:01
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12149/pywin/framework Modified Files: stdin.py Log Message: Have stdin.read() in Pythonwin treat dialog cancel as EOF. Not sure how this ever worked, but it seems stdin.read() can never return a value without this fix (but now it has no way to abort the operation!) Index: stdin.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/stdin.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** stdin.py 26 Nov 2008 08:39:33 -0000 1.7 --- stdin.py 3 Jan 2009 05:54:57 -0000 1.8 *************** *** 94,98 **** try: self.__get_line() ! except EOFError: # deal with cancellation of get_input_line dialog desired_size = len(self.buffer) # Be satisfied! --- 94,98 ---- try: self.__get_line() ! except (EOFError, KeyboardInterrupt): # deal with cancellation of get_input_line dialog desired_size = len(self.buffer) # Be satisfied! |
From: Mark H. <mha...@us...> - 2009-01-03 05:52:39
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12025/pywin/framework Modified Files: interact.py Log Message: use py2k and py3k friendly array formats for talking to scintilla Index: interact.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/interact.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** interact.py 4 Dec 2008 12:44:44 -0000 1.19 --- interact.py 3 Jan 2009 05:52:28 -0000 1.20 *************** *** 229,233 **** styleStart = STYLE_INTERACTIVE_BANNER self.scintilla.SCIStartStyling(start, 31) ! self.style_buffer = array.array("c", chr(0)*len(stringVal)) self.ColorizeInteractiveCode(stringVal, styleStart, stylePyStart) self.scintilla.SCISetStylingEx(self.style_buffer) --- 229,233 ---- styleStart = STYLE_INTERACTIVE_BANNER self.scintilla.SCIStartStyling(start, 31) ! self.style_buffer = array.array("b", (0,)*len(stringVal)) self.ColorizeInteractiveCode(stringVal, styleStart, stylePyStart) self.scintilla.SCISetStylingEx(self.style_buffer) |
From: Mark H. <mha...@us...> - 2009-01-03 05:52:33
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12025/pywin/scintilla Modified Files: view.py formatter.py Log Message: use py2k and py3k friendly array formats for talking to scintilla Index: view.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/view.py,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** view.py 27 Nov 2008 09:33:22 -0000 1.31 --- view.py 3 Jan 2009 05:52:28 -0000 1.32 *************** *** 652,658 **** hdcFormat = dc.GetHandleAttrib() fr = struct.pack(fmt, hdcRender, hdcFormat, rc[0], rc[1], rc[2], rc[3], rc[0], rc[1], rc[2], rc[3], pageStart, lengthDoc) ! frBuff = array.array('c', fr) ! addressFrBuff = frBuff.buffer_info()[0] ! nextPageStart = self.SendScintilla(EM_FORMATRANGE, draw, addressFrBuff) return nextPageStart --- 652,656 ---- hdcFormat = dc.GetHandleAttrib() fr = struct.pack(fmt, hdcRender, hdcFormat, rc[0], rc[1], rc[2], rc[3], rc[0], rc[1], rc[2], rc[3], pageStart, lengthDoc) ! nextPageStart = self.SendScintilla(EM_FORMATRANGE, draw, fr) return nextPageStart Index: formatter.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/formatter.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** formatter.py 27 Nov 2008 09:42:41 -0000 1.16 --- formatter.py 3 Jan 2009 05:52:28 -0000 1.17 *************** *** 225,229 **** stylenum = self.styles[styleName].stylenum while start<end: ! self.style_buffer[start]=chr(stylenum) start = start+1 #self.scintilla.SCISetStyling(end - start + 1, stylenum) --- 225,229 ---- stylenum = self.styles[styleName].stylenum while start<end: ! self.style_buffer[start]=stylenum start = start+1 #self.scintilla.SCISetStyling(end - start + 1, stylenum) *************** *** 248,252 **** # trace("Coloring", start, end, end-start, len(stringVal), styleStart, self.scintilla.SCIGetCharAt(start)) scintilla.SCIStartStyling(start, 31) ! self.style_buffer = array.array("c", chr(0)*len(stringVal)) self.ColorizeString(stringVal, styleStart) scintilla.SCISetStylingEx(self.style_buffer) --- 248,252 ---- # trace("Coloring", start, end, end-start, len(stringVal), styleStart, self.scintilla.SCIGetCharAt(start)) scintilla.SCIStartStyling(start, 31) ! self.style_buffer = array.array("b", (0,)*len(stringVal)) self.ColorizeString(stringVal, styleStart) scintilla.SCISetStylingEx(self.style_buffer) |
From: Mark H. <mha...@us...> - 2009-01-03 05:50:58
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11797 Modified Files: PyRecord.cpp Log Message: move variable decl to keep vc6 happy with goto exits. Index: PyRecord.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyRecord.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** PyRecord.cpp 19 Dec 2008 02:28:48 -0000 1.14 --- PyRecord.cpp 3 Jan 2009 05:50:50 -0000 1.15 *************** *** 465,468 **** --- 465,469 ---- goto done; // must exit on error via loop_error from here... + PyObject *sub_object = NULL; if (i > 0){ PyWinCoreString_Concat(&obrepr, comma); *************** *** 476,480 **** if (!obrepr) goto loop_error; ! PyObject *sub_object = PyRecord::getattro(self, obattrname); if (!sub_object) goto loop_error; --- 477,481 ---- if (!obrepr) goto loop_error; ! sub_object = PyRecord::getattro(self, obattrname); if (!sub_object) goto loop_error; |
From: Mark H. <mha...@us...> - 2009-01-03 05:45:42
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11355/pywin/framework Modified Files: intpyapp.py Log Message: 'locate file' now just stops on error rather than asking for another name Index: intpyapp.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/intpyapp.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** intpyapp.py 6 Dec 2008 00:39:16 -0000 1.14 --- intpyapp.py 3 Jan 2009 05:45:36 -0000 1.15 *************** *** 354,374 **** global lastLocateFileName # save the new version away for next time... ! # Loop until a good name, or cancel ! while 1: ! name = dialog.GetSimpleInput('File name', lastLocateFileName, 'Locate Python File') ! if name is None: # Cancelled. ! break ! lastLocateFileName = name ! # if ".py" supplied, rip it off! ! # should also check for .pys and .pyw ! if lastLocateFileName[-3:].lower()=='.py': ! lastLocateFileName = lastLocateFileName[:-3] ! lastLocateFileName = lastLocateFileName.replace(".","\\") ! newName = scriptutils.LocatePythonFile(lastLocateFileName) ! if newName is None: ! win32ui.MessageBox("The file '%s' can not be located" % lastLocateFileName) ! else: ! win32ui.GetApp().OpenDocumentFile(newName) ! break # Display all the "options" proprety pages we can find --- 354,371 ---- global lastLocateFileName # save the new version away for next time... ! name = dialog.GetSimpleInput('File name', lastLocateFileName, 'Locate Python File') ! if name is None: # Cancelled. ! return ! lastLocateFileName = name ! # if ".py" supplied, rip it off! ! # should also check for .pys and .pyw ! if lastLocateFileName[-3:].lower()=='.py': ! lastLocateFileName = lastLocateFileName[:-3] ! lastLocateFileName = lastLocateFileName.replace(".","\\") ! newName = scriptutils.LocatePythonFile(lastLocateFileName) ! if newName is None: ! win32ui.MessageBox("The file '%s' can not be located" % lastLocateFileName) ! else: ! win32ui.GetApp().OpenDocumentFile(newName) # Display all the "options" proprety pages we can find |
From: Mark H. <mha...@us...> - 2009-01-03 05:43:26
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11113/pywin/framework Modified Files: scriptutils.py Log Message: ensure we don't pass a relative cwd to the open file dialog Index: scriptutils.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/scriptutils.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** scriptutils.py 4 Dec 2008 06:56:36 -0000 1.21 --- scriptutils.py 3 Jan 2009 05:43:19 -0000 1.22 *************** *** 576,580 **** baseName = fileName for path in sys.path: ! fileName = os.path.join(path, baseName) if os.path.isdir(fileName): if bBrowseIfDir: --- 576,580 ---- baseName = fileName for path in sys.path: ! fileName = os.path.abspath(os.path.join(path, baseName)) if os.path.isdir(fileName): if bBrowseIfDir: |
From: Mark H. <mha...@us...> - 2009-01-03 05:42:43
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/ocx In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11025/pywin/Demos/ocx Modified Files: webbrowser.py Log Message: webbrowser demo gets smarter about a demo URL Index: webbrowser.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/ocx/webbrowser.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** webbrowser.py 1 Oct 2008 14:44:52 -0000 1.2 --- webbrowser.py 3 Jan 2009 05:42:35 -0000 1.3 *************** *** 22,25 **** --- 22,27 ---- if url is None: self.url = regutil.GetRegisteredHelpFile("Main Python Documentation") + if self.url is None: + self.url = "http://www.python.org" else: self.url = url *************** *** 44,50 **** self.SetWindowText(title) ! def Demo(): ! url = None ! if len(sys.argv)>1: url = win32api.GetFullPathName(sys.argv[1]) f = BrowserFrame(url) --- 46,51 ---- self.SetWindowText(title) ! def Demo(url=None): ! if url is None and len(sys.argv)>1: url = win32api.GetFullPathName(sys.argv[1]) f = BrowserFrame(url) *************** *** 52,54 **** if __name__=='__main__': ! Demo() \ No newline at end of file --- 53,55 ---- if __name__=='__main__': ! Demo() |
From: Mark H. <mha...@us...> - 2009-01-03 05:42:43
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv11025/pywin/Demos Modified Files: guidemo.py Log Message: webbrowser demo gets smarter about a demo URL Index: guidemo.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/guidemo.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** guidemo.py 11 Mar 2000 00:56:06 -0000 1.3 --- guidemo.py 3 Jan 2009 05:42:35 -0000 1.4 *************** *** 19,23 **** ('OCX Control Demo', 'from ocx import ocxtest;ocxtest.demo()'), ('OCX Serial Port Demo', 'from ocx import ocxserialtest; ocxserialtest.test()'), ! ('IE4 Control Demo', 'from ocx import webbrowser; webbrowser.Demo()'), ] --- 19,23 ---- ('OCX Control Demo', 'from ocx import ocxtest;ocxtest.demo()'), ('OCX Serial Port Demo', 'from ocx import ocxserialtest; ocxserialtest.test()'), ! ('IE4 Control Demo', 'from ocx import webbrowser; webbrowser.Demo("http://www.python.org")'), ] |
From: Mark H. <mha...@us...> - 2009-01-03 05:23:14
|
Update of /cvsroot/pywin32/pywin32/isapi In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9330 Modified Files: install.py Log Message: move to exception attributes and list iterators Index: install.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/install.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** install.py 30 Dec 2008 12:06:32 -0000 1.19 --- install.py 3 Jan 2009 05:23:07 -0000 1.20 *************** *** 123,130 **** # Convert an ADSI COM exception to the Win32 error code embedded in it. def _GetWin32ErrorCode(com_exc): ! hr, msg, exc, narg = com_exc ! # If we have more details in the 'exc' struct, use it. ! if exc: ! hr = exc[-1] if winerror.HRESULT_FACILITY(hr) != winerror.FACILITY_WIN32: raise --- 123,130 ---- # Convert an ADSI COM exception to the Win32 error code embedded in it. def _GetWin32ErrorCode(com_exc): ! hr = com_exc.hresult ! # If we have more details in the 'excepinfo' struct, use it. ! if com_exc.excepinfo: ! hr = com_exc.excepinfo[-1] if winerror.HRESULT_FACILITY(hr) != winerror.FACILITY_WIN32: raise *************** *** 182,188 **** server = GetObject(path) except pythoncom.com_error, details: ! hr, msg, exc, arg_err = details ! if exc and exc[2]: ! msg = exc[2] msg = "WebServer %s: %s" % (path, msg) raise ItemNotFound(msg) --- 182,188 ---- server = GetObject(path) except pythoncom.com_error, details: ! msg = details.strerror ! if exc.excepinfo and exc.excepinfo[2]: ! msg = exc.excepinfo[2] msg = "WebServer %s: %s" % (path, msg) raise ItemNotFound(msg) *************** *** 332,340 **** try: filters = GetObject(server+"/Filters") ! except pythoncom.com_error, (hr, msg, exc, arg): # Brand new sites don't have the '/Filters' collection - create it. # Any errors other than 'not found' we shouldn't ignore. ! if winerror.HRESULT_FACILITY(hr) != winerror.FACILITY_WIN32 or \ ! winerror.HRESULT_CODE(hr) != winerror.ERROR_PATH_NOT_FOUND: raise server_ob = GetObject(server) --- 332,340 ---- try: filters = GetObject(server+"/Filters") ! except pythoncom.com_error, exc: # Brand new sites don't have the '/Filters' collection - create it. # Any errors other than 'not found' we shouldn't ignore. ! if winerror.HRESULT_FACILITY(exc.hresult) != winerror.FACILITY_WIN32 or \ ! winerror.HRESULT_CODE(exc.hresult) != winerror.ERROR_PATH_NOT_FOUND: raise server_ob = GetObject(server) *************** *** 620,629 **** def build_usage(handler_map): ! docstrings = [handler.__doc__ for handler in handler_map.values()] ! all_args = dict(zip(handler_map.keys(), docstrings)) ! arg_names = "|".join(all_args.keys()) usage_string = "%prog [options] [" + arg_names + "]\n" usage_string += "commands:\n" ! for arg, desc in all_args.items(): usage_string += " %-10s: %s" % (arg, desc) + "\n" return usage_string[:-1] --- 620,629 ---- def build_usage(handler_map): ! docstrings = [handler.__doc__ for handler in handler_map.itervalues()] ! all_args = dict(zip(handler_map.iterkeys(), docstrings)) ! arg_names = "|".join(all_args.iterkeys()) usage_string = "%prog [options] [" + arg_names + "]\n" usage_string += "commands:\n" ! for arg, desc in all_args.iteritems(): usage_string += " %-10s: %s" % (arg, desc) + "\n" return usage_string[:-1] |
From: Mark H. <mha...@us...> - 2009-01-03 05:00:51
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/service In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8230/win32/Demos/service Modified Files: pipeTestServiceClient.py Log Message: remove use of string module Index: pipeTestServiceClient.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/service/pipeTestServiceClient.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pipeTestServiceClient.py 23 Oct 2008 07:39:12 -0000 1.5 --- pipeTestServiceClient.py 3 Jan 2009 05:00:45 -0000 1.6 *************** *** 87,91 **** def main(): ! import sys, getopt, string server = "." thread_count = 0 --- 87,91 ---- def main(): ! import sys, getopt server = "." thread_count = 0 *************** *** 97,103 **** server = a if o=='-m': ! msg_count = string.atoi(a) if o=='-t': ! thread_count = string.atoi(a) if o=='-v': global verbose --- 97,103 ---- server = a if o=='-m': ! msg_count = int(a) if o=='-t': ! thread_count = int(a) if o=='-v': global verbose *************** *** 105,109 **** if o=='-l': testLargeMessage(server) ! msg = string.join(args) except getopt.error, msg: print msg --- 105,109 ---- if o=='-l': testLargeMessage(server) ! msg = " ".join(args).encode("mbcs") except getopt.error, msg: print msg |
From: Mark H. <mha...@us...> - 2009-01-03 05:00:21
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8208/win32/src Modified Files: PyWAVEFORMATEX.cpp Log Message: let pywintypes.h include python.h so it can help silence warnings Index: PyWAVEFORMATEX.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWAVEFORMATEX.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyWAVEFORMATEX.cpp 3 Dec 2008 22:34:21 -0000 1.3 --- PyWAVEFORMATEX.cpp 3 Jan 2009 05:00:15 -0000 1.4 *************** *** 2,6 **** // @doc - #include "Python.h" #include "PyWinTypes.h" #include "PyWinObjects.h" --- 2,5 ---- |
From: Mark H. <mha...@us...> - 2009-01-03 04:59:44
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv8117/win32/src Modified Files: win32trace.cpp Log Message: remove redundant variable assignment Index: win32trace.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32trace.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** win32trace.cpp 30 Dec 2008 12:33:10 -0000 1.19 --- win32trace.cpp 3 Jan 2009 04:59:38 -0000 1.20 *************** *** 651,655 **** // no local one exists - see if we can create it globally - if // we can, we go global, else we stick with local. - use_global_namespace = TRUE; HANDLE h2 = CreateFileMapping((HANDLE)-1, &sa, PAGE_READWRITE, 0, BUFFER_SIZE, --- 651,654 ---- |
From: Mark H. <mha...@us...> - 2009-01-03 04:54:41
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/service In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7993/win32/Demos/service Modified Files: Tag: py3k pipeTestServiceClient.py Log Message: merge modernizations from trunk Index: pipeTestServiceClient.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/service/pipeTestServiceClient.py,v retrieving revision 1.3.4.3 retrieving revision 1.3.4.4 diff -C2 -d -r1.3.4.3 -r1.3.4.4 *** pipeTestServiceClient.py 27 Nov 2008 11:31:05 -0000 1.3.4.3 --- pipeTestServiceClient.py 3 Jan 2009 04:54:33 -0000 1.3.4.4 *************** *** 87,91 **** def main(): ! import sys, getopt, string server = "." thread_count = 0 --- 87,91 ---- def main(): ! import sys, getopt server = "." thread_count = 0 *************** *** 97,103 **** server = a if o=='-m': ! msg_count = string.atoi(a) if o=='-t': ! thread_count = string.atoi(a) if o=='-v': global verbose --- 97,103 ---- server = a if o=='-m': ! msg_count = int(a) if o=='-t': ! thread_count = int(a) if o=='-v': global verbose *************** *** 105,109 **** if o=='-l': testLargeMessage(server) ! msg = string.join(args) except getopt.error as msg: print(msg) --- 105,109 ---- if o=='-l': testLargeMessage(server) ! msg = " ".join(args).encode("mbcs") except getopt.error as msg: print(msg) |
From: Mark H. <mha...@us...> - 2009-01-03 04:53:32
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7957/win32/Lib Modified Files: Tag: py3k win32serviceutil.py Log Message: merge modernizations from the trunk Index: win32serviceutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32serviceutil.py,v retrieving revision 1.26.2.5 retrieving revision 1.26.2.6 diff -C2 -d -r1.26.2.5 -r1.26.2.6 *** win32serviceutil.py 11 Dec 2008 05:45:21 -0000 1.26.2.5 --- win32serviceutil.py 3 Jan 2009 04:53:27 -0000 1.26.2.6 *************** *** 8,12 **** import win32service, win32api, win32con, winerror ! import sys, string, pywintypes, os error = RuntimeError --- 8,12 ---- import win32service, win32api, win32con, winerror ! import sys, pywintypes, os error = RuntimeError *************** *** 76,81 **** return win32service.OpenService(hscm, name, access) except win32api.error as details: ! if details[0] not in [winerror.ERROR_SERVICE_DOES_NOT_EXIST, ! winerror.ERROR_INVALID_NAME]: raise name = win32service.GetServiceKeyName(hscm, name) --- 76,81 ---- return win32service.OpenService(hscm, name, access) except win32api.error as details: ! if details.winerror not in [winerror.ERROR_SERVICE_DOES_NOT_EXIST, ! winerror.ERROR_INVALID_NAME]: raise name = win32service.GetServiceKeyName(hscm, name) *************** *** 324,328 **** deps = () for dep in deps: ! dep = string.lower(dep) dep_on = dict.get(dep, []) dep_on.append(svc) --- 324,328 ---- deps = () for dep in deps: ! dep = dep.lower() dep_on = dict.get(dep, []) dep_on.append(svc) *************** *** 333,337 **** def __ResolveDeps(findName, dict): ! items = dict.get(string.lower(findName), []) retList = [] for svc in items: --- 333,337 ---- def __ResolveDeps(findName, dict): ! items = dict.get(findName.lower(), []) retList = [] for svc in items: *************** *** 456,460 **** if argv is None: argv = sys.argv ! import pickle, os modName = pickle.whichmodule(cls, cls.__name__) if modName == '__main__': --- 456,460 ---- if argv is None: argv = sys.argv ! import pickle modName = pickle.whichmodule(cls, cls.__name__) if modName == '__main__': *************** *** 553,557 **** map = {"manual": win32service.SERVICE_DEMAND_START, "auto" : win32service.SERVICE_AUTO_START, "disabled": win32service.SERVICE_DISABLED} try: ! startup = map[string.lower(val)] except KeyError: print("'%s' is not a valid startup option" % val) --- 553,557 ---- map = {"manual": win32service.SERVICE_DEMAND_START, "auto" : win32service.SERVICE_AUTO_START, "disabled": win32service.SERVICE_DISABLED} try: ! startup = map[val.lower()] except KeyError: print("'%s' is not a valid startup option" % val) *************** *** 588,592 **** # non-frozen services use pythonservice.exe which handles a # -debug option ! svcArgs = string.join(args[1:]) try: exeName = LocateSpecificServiceExe(serviceName) --- 588,592 ---- # non-frozen services use pythonservice.exe which handles a # -debug option ! svcArgs = " ".join(args[1:]) try: exeName = LocateSpecificServiceExe(serviceName) *************** *** 644,648 **** else: print("Error installing service: %s (%d)" % (exc.strerror, exc.winerror)) ! err = hr except ValueError as msg: # Can be raised by custom option handler. print("Error installing service: %s" % str(msg)) --- 644,648 ---- else: print("Error installing service: %s (%d)" % (exc.strerror, exc.winerror)) ! err = exc.winerror except ValueError as msg: # Can be raised by custom option handler. print("Error installing service: %s" % str(msg)) *************** *** 684,688 **** except win32service.error as exc: print("Error changing service configuration: %s (%d)" % (exc.strerror,exc.winerror)) ! err = hr elif arg=="remove": --- 684,688 ---- except win32service.error as exc: print("Error changing service configuration: %s (%d)" % (exc.strerror,exc.winerror)) ! err = exc.winerror elif arg=="remove": *************** *** 694,698 **** except win32service.error as exc: print("Error removing service: %s (%d)" % (exc.strerror,exc.winerror)) ! err = hr elif arg=="stop": knownArg = 1 --- 694,698 ---- except win32service.error as exc: print("Error removing service: %s (%d)" % (exc.strerror,exc.winerror)) ! err = exc.winerror elif arg=="stop": knownArg = 1 *************** *** 705,709 **** except win32service.error as exc: print("Error stopping service: %s (%d)" % (exc.strerror,exc.winerror)) ! err = hr if not knownArg: err = -1 --- 705,709 ---- except win32service.error as exc: print("Error stopping service: %s (%d)" % (exc.strerror,exc.winerror)) ! err = exc.winerror if not knownArg: err = -1 |
From: Mark H. <mha...@us...> - 2009-01-03 04:51:06
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7876/win32/Lib Modified Files: Tag: py3k win32gui_struct.py Log Message: some simple issues found by 2to3, but needs more py3k work Index: win32gui_struct.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32gui_struct.py,v retrieving revision 1.11.2.1 retrieving revision 1.11.2.2 diff -C2 -d -r1.11.2.1 -r1.11.2.2 *** win32gui_struct.py 11 Sep 2008 07:48:21 -0000 1.11.2.1 --- win32gui_struct.py 3 Jan 2009 04:51:00 -0000 1.11.2.2 *************** *** 289,293 **** text_addr = text_len = 0 else: ! if isinstance(text, unicode): text = text.encode("mbcs") text_buffer = array.array("c", text+"\0") --- 289,293 ---- text_addr = text_len = 0 else: ! if isinstance(text, str): text = text.encode("mbcs") text_buffer = array.array("c", text+"\0") *************** *** 390,394 **** else: mask |= commctrl.LVIF_TEXT ! if isinstance(text, unicode): text = text.encode("mbcs") text_buffer = array.array("c", text+"\0") --- 390,394 ---- else: mask |= commctrl.LVIF_TEXT ! if isinstance(text, str): text = text.encode("mbcs") text_buffer = array.array("c", text+"\0") *************** *** 473,477 **** text_addr = text_len = 0 else: ! if isinstance(text, unicode): text = text.encode("mbcs") text_buffer = array.array("c", text+"\0") --- 473,477 ---- text_addr = text_len = 0 else: ! if isinstance(text, str): text = text.encode("mbcs") text_buffer = array.array("c", text+"\0") *************** *** 550,554 **** text_addr = text_len = 0 else: ! if isinstance(text, unicode): text = text.encode("mbcs") text_buffer = array.array("c", text+"\0") --- 550,554 ---- text_addr = text_len = 0 else: ! if isinstance(text, str): text = text.encode("mbcs") text_buffer = array.array("c", text+"\0") *************** *** 578,582 **** def PackDEV_BROADCAST_HANDLE(handle, hdevnotify=0, guid="\0"*16, name_offset=0, data="\0"): return PackDEV_BROADCAST(win32con.DBT_DEVTYP_HANDLE, "PP16sl", ! (long(handle), long(hdevnotify), str(buffer(guid)), name_offset), data) --- 578,582 ---- def PackDEV_BROADCAST_HANDLE(handle, hdevnotify=0, guid="\0"*16, name_offset=0, data="\0"): return PackDEV_BROADCAST(win32con.DBT_DEVTYP_HANDLE, "PP16sl", ! (int(handle), int(hdevnotify), str(buffer(guid)), name_offset), data) |
From: Mark H. <mha...@us...> - 2009-01-03 04:49:42
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7835/win32/Lib Modified Files: Tag: py3k win32timezone.py Log Message: reflect recent 2to3 fixes Index: win32timezone.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32timezone.py,v retrieving revision 1.9.2.7 retrieving revision 1.9.2.8 diff -C2 -d -r1.9.2.7 -r1.9.2.8 *** win32timezone.py 6 Dec 2008 01:48:26 -0000 1.9.2.7 --- win32timezone.py 3 Jan 2009 04:49:36 -0000 1.9.2.8 *************** *** 232,236 **** tzRegKeyPath = os.path.join(self.tzRegKey, timeZoneName) try: ! key = winreg.OpenKeyEx(_winreg.HKEY_LOCAL_MACHINE, tzRegKeyPath) except: raise ValueError('Timezone Name %s not found.' % timeZoneName) --- 232,236 ---- tzRegKeyPath = os.path.join(self.tzRegKey, timeZoneName) try: ! key = winreg.OpenKeyEx(winreg.HKEY_LOCAL_MACHINE, tzRegKeyPath) except: raise ValueError('Timezone Name %s not found.' % timeZoneName) *************** *** 347,351 **** def _get_time_zone_key(subkey=None): "Return the registry key that stores time zone details" ! key = winreg.OpenKeyEx(_winreg.HKEY_LOCAL_MACHINE, TimeZoneInfo.tzRegKey) if subkey: key = winreg.OpenKeyEx(key, subkey) --- 347,351 ---- def _get_time_zone_key(subkey=None): "Return the registry key that stores time zone details" ! key = winreg.OpenKeyEx(winreg.HKEY_LOCAL_MACHINE, TimeZoneInfo.tzRegKey) if subkey: key = winreg.OpenKeyEx(key, subkey) *************** *** 455,459 **** """ tzRegKey = r'SYSTEM\CurrentControlSet\Control\TimeZoneInformation' ! key = winreg.OpenKeyEx(_winreg.HKEY_LOCAL_MACHINE, tzRegKey) local = _RegKeyDict(key) # if the user has not checked "Automatically adjust clock for daylight --- 455,459 ---- """ tzRegKey = r'SYSTEM\CurrentControlSet\Control\TimeZoneInformation' ! key = winreg.OpenKeyEx(winreg.HKEY_LOCAL_MACHINE, tzRegKey) local = _RegKeyDict(key) # if the user has not checked "Automatically adjust clock for daylight |
From: Mark H. <mha...@us...> - 2009-01-03 04:45:29
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7676/pywin/mfc Modified Files: Tag: py3k activex.py dialog.py Log Message: merge various fixes and cleanups from bzr integration branch Index: activex.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc/activex.py,v retrieving revision 1.3.4.3 retrieving revision 1.3.4.4 diff -C2 -d -r1.3.4.3 -r1.3.4.4 *** activex.py 27 Nov 2008 11:31:03 -0000 1.3.4.3 --- activex.py 3 Jan 2009 04:45:17 -0000 1.3.4.4 *************** *** 1,6 **** """Support for ActiveX control hosting in Pythonwin. """ ! import win32ui, win32uiole, window ! import new class Control(window.Wnd): --- 1,12 ---- """Support for ActiveX control hosting in Pythonwin. """ ! import win32ui, win32uiole ! from . import window ! # XXX - we are still "classic style" classes in py2x, so we need can't yet ! # use 'type()' everywhere - revisit soon, as py2x will move to new-style too... ! try: ! from types import ClassType as new_type ! except ImportError: ! new_type = type # py3k class Control(window.Wnd): *************** *** 62,66 **** if name is None: name = controlClass.__name__ ! return new.classobj("OCX" + name, (Control, controlClass), {}) def MakeControlInstance( controlClass, name = None ): --- 68,72 ---- if name is None: name = controlClass.__name__ ! return new_type("OCX" + name, (Control, controlClass), {}) def MakeControlInstance( controlClass, name = None ): Index: dialog.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/mfc/dialog.py,v retrieving revision 1.3.4.3 retrieving revision 1.3.4.4 diff -C2 -d -r1.3.4.3 -r1.3.4.4 *** dialog.py 6 Dec 2008 01:48:26 -0000 1.3.4.3 --- dialog.py 3 Jan 2009 04:45:17 -0000 1.3.4.4 *************** *** 69,72 **** --- 69,73 ---- def items(self): return list(self.data.items()) def values(self): return list(self.data.values()) + # XXX - needs py3k work! def has_key(self, key): return key in self.data |
From: Mark H. <mha...@us...> - 2009-01-03 04:45:29
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7676/pywin/framework Modified Files: Tag: py3k intpyapp.py scriptutils.py Log Message: merge various fixes and cleanups from bzr integration branch Index: intpyapp.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/intpyapp.py,v retrieving revision 1.11.2.6 retrieving revision 1.11.2.7 diff -C2 -d -r1.11.2.6 -r1.11.2.7 *** intpyapp.py 6 Dec 2008 01:48:26 -0000 1.11.2.6 --- intpyapp.py 3 Jan 2009 04:45:17 -0000 1.11.2.7 *************** *** 304,310 **** exec(command + "\n") except: - t,v,tb=sys.exc_info() print("ERROR executing DDE command: ", command) ! traceback.print_exception(t,v,tb) raise --- 304,309 ---- exec(command + "\n") except: print("ERROR executing DDE command: ", command) ! traceback.print_exc() raise *************** *** 355,375 **** global lastLocateFileName # save the new version away for next time... ! # Loop until a good name, or cancel ! while 1: ! name = dialog.GetSimpleInput('File name', lastLocateFileName, 'Locate Python File') ! if name is None: # Cancelled. ! break ! lastLocateFileName = name ! # if ".py" supplied, rip it off! ! # should also check for .pys and .pyw ! if lastLocateFileName[-3:].lower()=='.py': ! lastLocateFileName = lastLocateFileName[:-3] ! lastLocateFileName = lastLocateFileName.replace(".","\\") ! newName = scriptutils.LocatePythonFile(lastLocateFileName) ! if newName is None: ! win32ui.MessageBox("The file '%s' can not be located" % lastLocateFileName) ! else: ! win32ui.GetApp().OpenDocumentFile(newName) ! break # Display all the "options" proprety pages we can find --- 354,371 ---- global lastLocateFileName # save the new version away for next time... ! name = dialog.GetSimpleInput('File name', lastLocateFileName, 'Locate Python File') ! if name is None: # Cancelled. ! return ! lastLocateFileName = name ! # if ".py" supplied, rip it off! ! # should also check for .pys and .pyw ! if lastLocateFileName[-3:].lower()=='.py': ! lastLocateFileName = lastLocateFileName[:-3] ! lastLocateFileName = lastLocateFileName.replace(".","\\") ! newName = scriptutils.LocatePythonFile(lastLocateFileName) ! if newName is None: ! win32ui.MessageBox("The file '%s' can not be located" % lastLocateFileName) ! else: ! win32ui.GetApp().OpenDocumentFile(newName) # Display all the "options" proprety pages we can find Index: scriptutils.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/scriptutils.py,v retrieving revision 1.18.2.3 retrieving revision 1.18.2.4 diff -C2 -d -r1.18.2.3 -r1.18.2.4 *** scriptutils.py 4 Dec 2008 07:28:46 -0000 1.18.2.3 --- scriptutils.py 3 Jan 2009 04:45:17 -0000 1.18.2.4 *************** *** 581,585 **** baseName = fileName for path in sys.path: ! fileName = os.path.join(path, baseName) if os.path.isdir(fileName): if bBrowseIfDir: --- 581,585 ---- baseName = fileName for path in sys.path: ! fileName = os.path.abspath(os.path.join(path, baseName)) if os.path.isdir(fileName): if bBrowseIfDir: |
From: Mark H. <mha...@us...> - 2009-01-03 04:45:28
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7676/pywin/scintilla Modified Files: Tag: py3k control.py Log Message: merge various fixes and cleanups from bzr integration branch Index: control.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/control.py,v retrieving revision 1.17.2.3 retrieving revision 1.17.2.4 diff -C2 -d -r1.17.2.3 -r1.17.2.4 *** control.py 3 Sep 2008 03:05:57 -0000 1.17.2.3 --- control.py 3 Jan 2009 04:45:17 -0000 1.17.2.4 *************** *** 33,36 **** --- 33,39 ---- dllid = win32api.LoadLibrary("Scintilla.DLL") + # null_byte is str in py2k, bytes on py3k + null_byte = "\0".encode('ascii') + ## These are from Richedit.h - need to add to win32con or commctrl EM_GETTEXTRANGE = 1099 *************** *** 70,75 **** self.SendMessage(scintillacon.SCI_ADDSTYLEDTEXT, text.encode(default_scintilla_encoding)) def SCIInsertText(self, text, pos=-1): - ## sma = array.array('u', text+"\0") - ## (a,l) = sma.buffer_info() buff=(text+'\0').encode(default_scintilla_encoding) self.SendScintilla(scintillacon.SCI_INSERTTEXT, pos, buff) --- 73,76 ---- *************** *** 111,115 **** def SCIStyleSetFont(self, num, name, characterset=0): buff = (name + "\0").encode(default_scintilla_encoding) - ## addressBuffer = buff.buffer_info()[0] self.SendScintilla(scintillacon.SCI_STYLESETFONT, num, buff) self.SendScintilla(scintillacon.SCI_STYLESETCHARACTERSET, num, characterset) --- 112,115 ---- *************** *** 301,308 **** def GetSelText(self): start, end = self.GetSel() ! txtBuf = array.array('u', " " * ((end-start)+1)) addressTxtBuf = txtBuf.buffer_info()[0] self.SendScintilla(EM_GETSELTEXT, 0, addressTxtBuf) ! return txtBuf.tostring().decode(default_scintilla_encoding) def SetSel(self, start=0, end=None): --- 301,316 ---- def GetSelText(self): start, end = self.GetSel() ! txtBuf = array.array('b', null_byte * (end-start+1)) addressTxtBuf = txtBuf.buffer_info()[0] + # EM_GETSELTEXT is documented as returning the number of chars + # not including the NULL, but scintilla includes the NULL. A + # quick glance at the scintilla impl doesn't make this + # obvious - the NULL is included in the 'selection' object + # and reflected in the length of that 'selection' object. + # I expect that is a bug in scintilla and may be fixed by now, + # but we just blindly assume that the last char is \0 and + # strip it. self.SendScintilla(EM_GETSELTEXT, 0, addressTxtBuf) ! return txtBuf.tostring()[:-1].decode(default_scintilla_encoding) def SetSel(self, start=0, end=None): *************** *** 348,353 **** assert start >= 0 and start <= self.GetTextLength(), "The start postion is invalid" assert end >= 0 and end <= self.GetTextLength(), "The end postion is invalid" ! initer = "=" * (end - start + 1) ! buff = array.array('u', initer) addressBuffer = buff.buffer_info()[0] tr = struct.pack('llP', start, end, addressBuffer) --- 356,361 ---- assert start >= 0 and start <= self.GetTextLength(), "The start postion is invalid" assert end >= 0 and end <= self.GetTextLength(), "The end postion is invalid" ! initer = null_byte * (end - start + 1) ! buff = array.array('b', initer) addressBuffer = buff.buffer_info()[0] tr = struct.pack('llP', start, end, addressBuffer) *************** *** 355,359 **** addressTrBuff = trBuff.buffer_info()[0] numChars = self.SendScintilla(EM_GETTEXTRANGE, 0, addressTrBuff) - ## return buff.tounicode()[:numChars] return buff.tostring()[:numChars].decode(default_scintilla_encoding) --- 363,366 ---- |