pywin32-checkins Mailing List for Python for Windows Extensions (Page 11)
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
|
From: Mark H. <mha...@us...> - 2010-11-16 04:46:00
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11016 Modified Files: PyWinTypes.h PyWinObjects.h PyTime.cpp PyOVERLAPPED.cpp PyIID.cpp PyHANDLE.cpp Log Message: work with Py_hash_t introduced in py3.2 Index: PyWinObjects.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinObjects.h,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** PyWinObjects.h 15 Feb 2009 00:43:10 -0000 1.22 --- PyWinObjects.h 16 Nov 2010 04:45:52 -0000 1.23 *************** *** 19,23 **** /* Python support */ PyObject *richcompare(PyObject *other, int op); ! long hash(void); PyObject *str(void); PyObject *repr(void); --- 19,23 ---- /* Python support */ PyObject *richcompare(PyObject *other, int op); ! Py_hash_t hash(void); PyObject *str(void); PyObject *repr(void); *************** *** 26,30 **** static int printFunc(PyObject *ob, FILE *fp, int flags); static PyObject *richcompareFunc(PyObject *self, PyObject *other, int op); ! static long hashFunc(PyObject *ob); static PyObject * strFunc(PyObject *ob); static PyObject * reprFunc(PyObject *ob); --- 26,30 ---- static int printFunc(PyObject *ob, FILE *fp, int flags); static PyObject *richcompareFunc(PyObject *self, PyObject *other, int op); ! static Py_hash_t hashFunc(PyObject *ob); static PyObject * strFunc(PyObject *ob); static PyObject * reprFunc(PyObject *ob); *************** *** 56,60 **** int print(FILE *fp, int flags); ! long hash(void); //PyObject *str(void); long asLong(void); --- 56,60 ---- int print(FILE *fp, int flags); ! Py_hash_t hash(void); //PyObject *str(void); long asLong(void); *************** *** 68,72 **** static int compareFunc(PyObject *ob1, PyObject *ob2); static PyObject *richcompareFunc(PyObject *self, PyObject *other, int op); ! static long hashFunc(PyObject *ob); //static PyObject * strFunc(PyObject *ob); static int nonzeroFunc(PyObject *ob); --- 68,72 ---- static int compareFunc(PyObject *ob1, PyObject *ob2); static PyObject *richcompareFunc(PyObject *self, PyObject *other, int op); ! static Py_hash_t hashFunc(PyObject *ob); //static PyObject * strFunc(PyObject *ob); static int nonzeroFunc(PyObject *ob); *************** *** 108,112 **** static PyObject *getattro(PyObject *self, PyObject *obname); static int setattro(PyObject *self, PyObject *obname, PyObject *v); ! static long hashFunc(PyObject *self); static struct PYWINTYPES_EXPORT PyMemberDef members[]; --- 108,112 ---- static PyObject *getattro(PyObject *self, PyObject *obname); static int setattro(PyObject *self, PyObject *obname, PyObject *v); ! static Py_hash_t hashFunc(PyObject *self); static struct PYWINTYPES_EXPORT PyMemberDef members[]; *************** *** 139,143 **** int print(FILE *fp, int flags); PyObject *asStr(void); ! long hash(void); static void deallocFunc(PyObject *ob); --- 139,143 ---- int print(FILE *fp, int flags); PyObject *asStr(void); ! Py_hash_t hash(void); static void deallocFunc(PyObject *ob); *************** *** 145,149 **** static PyObject *richcompareFunc(PyObject *ob, PyObject *other, int op); static int nonzeroFunc(PyObject *ob); ! static long hashFunc(PyObject *ob); static PyObject * strFunc(PyObject *ob); --- 145,149 ---- static PyObject *richcompareFunc(PyObject *ob, PyObject *other, int op); static int nonzeroFunc(PyObject *ob); ! static Py_hash_t hashFunc(PyObject *ob); static PyObject * strFunc(PyObject *ob); Index: PyIID.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyIID.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** PyIID.cpp 4 Feb 2009 04:07:54 -0000 1.12 --- PyIID.cpp 16 Nov 2010 04:45:52 -0000 1.13 *************** *** 250,254 **** } ! long PyIID::hash(void) { DWORD n[4]; --- 250,254 ---- } ! Py_hash_t PyIID::hash(void) { DWORD n[4]; *************** *** 287,291 **** // @pymethod int|PyIID|__hash__|Used when the hash value of an IID object is required ! long PyIID::hashFunc(PyObject *ob) { return ((PyIID *)ob)->hash(); --- 287,291 ---- // @pymethod int|PyIID|__hash__|Used when the hash value of an IID object is required ! Py_hash_t PyIID::hashFunc(PyObject *ob) { return ((PyIID *)ob)->hash(); Index: PyHANDLE.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyHANDLE.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** PyHANDLE.cpp 4 Feb 2009 11:27:05 -0000 1.22 --- PyHANDLE.cpp 16 Nov 2010 04:45:52 -0000 1.23 *************** *** 323,327 **** // @pymethod int|PyHANDLE|__hash__|Used when the hash value of a HANDLE object is required ! long PyHANDLE::hashFunc(PyObject *ob) { return ((PyHANDLE *)ob)->hash(); --- 323,327 ---- // @pymethod int|PyHANDLE|__hash__|Used when the hash value of a HANDLE object is required ! Py_hash_t PyHANDLE::hashFunc(PyObject *ob) { return ((PyHANDLE *)ob)->hash(); *************** *** 329,333 **** ! long PyHANDLE::hash(void) { // Just use the address. --- 329,333 ---- ! Py_hash_t PyHANDLE::hash(void) { // Just use the address. Index: PyOVERLAPPED.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyOVERLAPPED.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** PyOVERLAPPED.cpp 15 Feb 2009 00:43:10 -0000 1.17 --- PyOVERLAPPED.cpp 16 Nov 2010 04:45:52 -0000 1.18 *************** *** 236,240 **** } ! /*static*/ long PyOVERLAPPED::hashFunc(PyObject *ob) { // Just use the address. --- 236,240 ---- } ! /*static*/ Py_hash_t PyOVERLAPPED::hashFunc(PyObject *ob) { // Just use the address. Index: PyWinTypes.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypes.h,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** PyWinTypes.h 15 Feb 2009 01:07:56 -0000 1.70 --- PyWinTypes.h 16 Nov 2010 04:45:52 -0000 1.71 *************** *** 166,169 **** --- 166,177 ---- #endif + // Py_hash_t was introduced as the size of a pointer in python 3.2 - it + // was a simple long before that. + #if PY_VERSION_HEX < 0x03020000 + typedef long Py_hash_t; + #else + typedef Py_ssize_t Py_hash_t; + #endif + #if PY_VERSION_HEX < 0x02030000 #define PyLong_AsUnsignedLongMask PyLong_AsUnsignedLong Index: PyTime.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyTime.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** PyTime.cpp 17 Mar 2009 04:32:48 -0000 1.29 --- PyTime.cpp 16 Nov 2010 04:45:52 -0000 1.30 *************** *** 470,477 **** } ! long PyTime::hash(void) { /* arbitrarily use seconds as the hash value */ ! return (long)(m_time * SECS_PER_DAY); } --- 470,477 ---- } ! Py_hash_t PyTime::hash(void) { /* arbitrarily use seconds as the hash value */ ! return (Py_hash_t)(m_time * SECS_PER_DAY); } *************** *** 637,641 **** // @pymethod int|PyTime|__hash__|Used when the hash value of an time object is required ! long PyTime::hashFunc(PyObject *ob) { return ((PyTime *)ob)->hash(); --- 637,641 ---- // @pymethod int|PyTime|__hash__|Used when the hash value of an time object is required ! Py_hash_t PyTime::hashFunc(PyObject *ob) { return ((PyTime *)ob)->hash(); |
From: Mark H. <mha...@us...> - 2010-11-16 04:44:36
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10257 Modified Files: win32process.i Log Message: worm around python 2.3 build issue Index: win32process.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32process.i,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** win32process.i 11 Dec 2008 00:25:40 -0000 1.37 --- win32process.i 16 Nov 2010 04:44:28 -0000 1.38 *************** *** 1605,1608 **** --- 1605,1616 ---- #endif // MS_WINCE + // *sob* - these symbols don't exist in the platform sdk needed to build + // using Python 2.3 + #ifndef THREAD_MODE_BACKGROUND_BEGIN + #define THREAD_MODE_BACKGROUND_BEGIN 0x00010000 + #endif + #ifndef THREAD_MODE_BACKGROUND_END + #define THREAD_MODE_BACKGROUND_END 0x00020000 + #endif %} |
From: Mark H. <mha...@us...> - 2010-11-16 04:43:33
|
Update of /cvsroot/pywin32/pywin32 In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9956 Modified Files: setup.py Log Message: add note about SDK options for py 2.3 Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.113 retrieving revision 1.114 diff -C2 -d -r1.113 -r1.114 *** setup.py 16 Nov 2010 04:16:55 -0000 1.113 --- setup.py 16 Nov 2010 04:43:23 -0000 1.114 *************** *** 23,26 **** --- 23,30 ---- Microsoft Windows Software Development Kit Update for Windows Vista (version 6.0) http://www.microsoft.com/downloads/en/details.aspx?FamilyID=4377f86d-c913-4b5c-b87e-ef72e5b4e065 + ** If you want to build Python 2.3, be sure to install the SDK compilers + too - although we don't use them, this setup option installs some .lib + files we do need. + ** Python 2.6+: Microsoft Windows SDK for Windows 7 and .NET Framework 4 (version 7.1) |
From: Mark H. <mha...@us...> - 2010-11-16 04:17:04
|
Update of /cvsroot/pywin32/pywin32 In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv363 Modified Files: setup.py Log Message: add sdk notes, skip exchange modules on py3k Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** setup.py 30 Aug 2010 02:40:15 -0000 1.112 --- setup.py 16 Nov 2010 04:16:55 -0000 1.113 *************** *** 14,32 **** to build as many as it can, and at the end of the build will report any extension modules that could not be built and why. - Currently, the Vista SDK and DirectX SDK are required to successfully build - all extension modules - note that using the Vista SDK doesn't force you to - use Vista as your build environment. Please use google to find the SDK - - links to microsoft.com seem to only stay current for a short time. Also note - that the SDK that comes with VS2008 is not good enough to compile earlier - versions. If you installed VS2008 after the Vista SDK, try doing a 'repair' - on your SDK install. ! Early versions of certain Windows headers/SDK versions will also cause ! certain modules to be skipped. If you don't use the extensions that fail to ! build, you can ignore these warnings; if you do use them, you must install ! the correct libraries. ! The 'exchange' extensions require headers that are no longer in any current ! SDKs, so these fail to build, but the 'mapi' extension should still build. Building: --- 14,34 ---- to build as many as it can, and at the end of the build will report any extension modules that could not be built and why. ! This has got complicated due to the various different versions of ! Visual Studio used - some VS versions are not compatible with some SDK ! versions. Below are the Windows SDK versions required (and the URL - although ! these are subject to being changed by MS at any time:) ! Python 2.3->2.5: ! Microsoft Windows Software Development Kit Update for Windows Vista (version 6.0) ! http://www.microsoft.com/downloads/en/details.aspx?FamilyID=4377f86d-c913-4b5c-b87e-ef72e5b4e065 ! Python 2.6+: ! Microsoft Windows SDK for Windows 7 and .NET Framework 4 (version 7.1) ! http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b ! ! If you multiple SDK versions on a single machine, set the MSSDK environment ! variable to point at the one you want to use. Note that using the SDK for ! a particular platform (eg, Windows 7) doesn't force you to use that OS as your ! build environment. If the links above don't work, use google to find them. Building: *************** *** 2040,2044 **** if is_py3k: py3k_skip_modules = \ ! """adsi mapi""".split() ext_modules = [e for e in ext_modules if e.name not in py3k_skip_modules] --- 2042,2046 ---- if is_py3k: py3k_skip_modules = \ ! """adsi mapi exchange exchdapi""".split() ext_modules = [e for e in ext_modules if e.name not in py3k_skip_modules] |
From: Mark H. <mha...@us...> - 2010-11-13 06:27:48
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11595/win32comext/axdebug/src Modified Files: AXDebug.cpp Log Message: make axdebug 64bit friendly Index: AXDebug.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axdebug/src/AXDebug.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** AXDebug.cpp 2 Mar 2009 06:10:40 -0000 1.9 --- AXDebug.cpp 13 Nov 2010 06:27:40 -0000 1.10 *************** *** 156,177 **** { int i; ! return PyInt_FromLong((long)&i); } static PyObject *GetThreadStateHandle(PyObject *self, PyObject *args) { - assert(sizeof(void *) <= sizeof(long)); // can we hack ptrs into longs? // We _must_ have the thread-lock to be called! PyThreadState *myState = PyThreadState_Swap(NULL); PyThreadState_Swap(myState); ! return PyInt_FromLong( (long)myState); } static PyObject *SetThreadStateTrace(PyObject *self, PyObject *args) { ! long handle; PyObject *func; ! if (!PyArg_ParseTuple(args, "lO", &handle, &func)) return NULL; - PyThreadState *state = (PyThreadState *)handle; #if (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 2) || PY_MAJOR_VERSION > 2 #pragma message("XXXXXXXXX - upgrade this for new tracing features.") --- 156,178 ---- { int i; ! return PyWinLong_FromVoidPtr(&i); } static PyObject *GetThreadStateHandle(PyObject *self, PyObject *args) { // We _must_ have the thread-lock to be called! PyThreadState *myState = PyThreadState_Swap(NULL); PyThreadState_Swap(myState); ! return PyWinLong_FromVoidPtr(myState); } static PyObject *SetThreadStateTrace(PyObject *self, PyObject *args) { ! PyObject *obhandle; PyObject *func; ! if (!PyArg_ParseTuple(args, "OO", &obhandle, &func)) ! return NULL; ! PyThreadState *state; ! if (!PyWinLong_AsVoidPtr(obhandle, (void **)&state)) return NULL; #if (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION >= 2) || PY_MAJOR_VERSION > 2 #pragma message("XXXXXXXXX - upgrade this for new tracing features.") |
From: Mark H. <mha...@us...> - 2010-11-13 06:14:31
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv8218/src Modified Files: univgw_dataconv.cpp Log Message: fix stack alignment issues in 64bit universal gateway support Index: univgw_dataconv.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/univgw_dataconv.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** univgw_dataconv.cpp 19 Dec 2008 01:51:26 -0000 1.12 --- univgw_dataconv.cpp 13 Nov 2010 06:14:23 -0000 1.13 *************** *** 84,90 **** ! static inline void SizeOfVT(VARTYPE vt, int *pitem_size, int *pstack_size) { - int stack_size = -1; int item_size; if (vt & VT_BYREF) --- 84,89 ---- ! static inline bool SizeOfVT(VARTYPE vt, int *pitem_size, int *pstack_size) { int item_size; if (vt & VT_BYREF) *************** *** 152,163 **** default: assert(FALSE); ! item_size = 0; } } ! if (stack_size == -1) stack_size = item_size; ! if (item_size < 4 && item_size > 0) ! stack_size = 4; // everything widened on x86 if (pitem_size) *pitem_size = item_size; if (pstack_size) *pstack_size = stack_size; } --- 151,172 ---- default: assert(FALSE); ! PyErr_SetString(PyExc_NotImplementedError, "unknown variant type"); ! return FALSE; } } ! #ifdef _M_IX86 ! int stack_size = (item_size < 4) ? 4 : item_size; ! #elif _M_X64 ! // params > 64bits passed by address, and only VT_VARIANT is > 64bits. ! assert ((item_size <= 8) || ((vt & VT_TYPEMASK) == VT_VARIANT)); ! if (item_size > 8) item_size = 8; ! // stack always 64 bits. ! int stack_size = 8; ! #else ! #error Unknown platform ! #endif if (pitem_size) *pitem_size = item_size; if (pstack_size) *pstack_size = stack_size; + return TRUE; } *************** *** 170,174 **** int item_size = 0; int stack_size = 0; ! SizeOfVT((VARTYPE)vt, &item_size, &stack_size); if (item_size <= 0) { PyErr_Format(PyExc_ValueError, "The value %d (0x%x) is an invalid variant type", vt, vt); --- 179,184 ---- int item_size = 0; int stack_size = 0; ! if (!SizeOfVT((VARTYPE)vt, &item_size, &stack_size)) ! return NULL; if (item_size <= 0) { PyErr_Format(PyExc_ValueError, "The value %d (0x%x) is an invalid variant type", vt, vt); *************** *** 661,666 **** pb = pbArg + PyInt_AS_LONG(PyTuple_GET_ITEM(PyTuple_GET_ITEM(obArgTypes, i), 1)); vtArgType = (VARTYPE)PyInt_AS_LONG(obArgType); bIsByRef = vtArgType & VT_BYREF; ! VARTYPE vtConversionType = vtArgType & VT_TYPEMASK; if (vtArgType & VT_ARRAY) { --- 671,683 ---- pb = pbArg + PyInt_AS_LONG(PyTuple_GET_ITEM(PyTuple_GET_ITEM(obArgTypes, i), 1)); vtArgType = (VARTYPE)PyInt_AS_LONG(obArgType); + #ifdef _M_IX86 bIsByRef = vtArgType & VT_BYREF; ! #elif _M_X64 ! // params > 64bits always passed by address - and the only ! // arg we support > 64 bits is a VARIANT structure. ! bIsByRef = (vtArgType==VT_VARIANT) || (vtArgType & VT_BYREF); ! #else ! #error Unknown platform ! #endif VARTYPE vtConversionType = vtArgType & VT_TYPEMASK; if (vtArgType & VT_ARRAY) { *************** *** 714,718 **** V_VT(&var) = vtArgType; // Copy the data into the variant... ! SizeOfVT(V_VT(&var), (int *)&cb, NULL); memcpy(&V_I4(&var), pb, cb); // Convert it into a PyObject: --- 731,736 ---- V_VT(&var) = vtArgType; // Copy the data into the variant... ! if (!SizeOfVT(V_VT(&var), (int *)&cb, NULL)) ! goto Error; memcpy(&V_I4(&var), pb, cb); // Convert it into a PyObject: |
From: Mark H. <mha...@us...> - 2010-11-13 06:08:30
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv6704/client Modified Files: genpy.py Log Message: Remove stale/broken __unicode__ method in py3k Index: genpy.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/genpy.py,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** genpy.py 30 Aug 2010 00:52:15 -0000 1.68 --- genpy.py 13 Nov 2010 06:08:16 -0000 1.69 *************** *** 487,500 **** for line in ret: print >> stream, line - print >> stream, "\t# str(ob) and int(ob) will use __call__" - print >> stream, "\tdef __unicode__(self, *args):" - print >> stream, "\t\ttry:" - print >> stream, "\t\t\treturn unicode(self.__call__(*args))" - print >> stream, "\t\texcept pythoncom.com_error:" - print >> stream, "\t\t\treturn repr(self)" - print >> stream, "\tdef __str__(self, *args):" if sys.version_info > (3,0): print >> stream, "\t\treturn str(self.__call__(*args))" else: print >> stream, "\t\treturn str(self.__unicode__(*args))" print >> stream, "\tdef __int__(self, *args):" --- 487,500 ---- for line in ret: print >> stream, line if sys.version_info > (3,0): + print >> stream, "\tdef __str__(self, *args):" print >> stream, "\t\treturn str(self.__call__(*args))" else: + print >> stream, "\tdef __unicode__(self, *args):" + print >> stream, "\t\ttry:" + print >> stream, "\t\t\treturn unicode(self.__call__(*args))" + print >> stream, "\t\texcept pythoncom.com_error:" + print >> stream, "\t\t\treturn repr(self)" + print >> stream, "\tdef __str__(self, *args):" print >> stream, "\t\treturn str(self.__unicode__(*args))" print >> stream, "\tdef __int__(self, *args):" |
From: Mark H. <mha...@us...> - 2010-11-12 03:35:26
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4684/com/win32com/test Modified Files: testStreams.py Log Message: Fix py3k problem with PyWinObject_AsLARGE_INTEGER and ints > 32bits Index: testStreams.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testStreams.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** testStreams.py 7 Jan 2009 06:03:29 -0000 1.9 --- testStreams.py 12 Nov 2010 03:35:16 -0000 1.10 *************** *** 109,112 **** --- 109,118 ---- self.assertEqual(s.data, mydata) + def testseek(self): + s = Stream(str2bytes('yo')) + s = win32com.server.util.wrap(s, pythoncom.IID_IStream) + # we used to die in py3k passing a value > 32bits + s.Seek(0x100000000, pythoncom.STREAM_SEEK_SET) + def testerrors(self): # setup a test logger to capture tracebacks etc. |
From: Mark H. <mha...@us...> - 2010-11-12 03:35:24
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4684/win32/src Modified Files: PyLARGE_INTEGER.cpp Log Message: Fix py3k problem with PyWinObject_AsLARGE_INTEGER and ints > 32bits Index: PyLARGE_INTEGER.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyLARGE_INTEGER.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PyLARGE_INTEGER.cpp 13 Jan 2009 22:54:09 -0000 1.15 --- PyLARGE_INTEGER.cpp 12 Nov 2010 03:35:16 -0000 1.16 *************** *** 22,25 **** --- 22,26 ---- BOOL PyWinObject_AsLARGE_INTEGER(PyObject *ob, LARGE_INTEGER *pResult) { + #if (PY_VERSION_HEX < 0x03000000) if (PyInt_Check(ob)) { // 32 bit integer value. *************** *** 29,33 **** LISet32(*pResult, x); return TRUE; ! } else if (PyLong_Check(ob)) { pResult->QuadPart=PyLong_AsLongLong(ob); return !(pResult->QuadPart == -1 && PyErr_Occurred()); --- 30,36 ---- LISet32(*pResult, x); return TRUE; ! } else ! #endif ! if (PyLong_Check(ob)) { pResult->QuadPart=PyLong_AsLongLong(ob); return !(pResult->QuadPart == -1 && PyErr_Occurred()); |
From: Mark H. <mha...@us...> - 2010-10-28 01:52:57
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv17893/Pythonwin/pywin/scintilla Modified Files: bindings.py config.py keycodes.py Log Message: Pythonwin: Better support for international keyboard. (Bug 896502 and help from kxroberto) Index: config.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/config.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** config.py 25 Aug 2010 07:55:10 -0000 1.10 --- config.py 28 Oct 2010 01:52:49 -0000 1.11 *************** *** 21,24 **** --- 21,26 ---- import imp + import win32api + debugging = 0 if debugging: *************** *** 29,33 **** trace = lambda *args: None ! compiled_config_version = 2 def split_line(line, lineno): --- 31,35 ---- trace = lambda *args: None ! compiled_config_version = 3 def split_line(line, lineno): *************** *** 89,96 **** --- 91,100 ---- ok = compiled_config_version == ver if ok: + kblayoutname = marshal.load(cf) magic = marshal.load(cf) size = marshal.load(cf) mtime = marshal.load(cf) if magic == imp.get_magic() and \ + win32api.GetKeyboardLayoutName() == kblayoutname and \ src_stat[stat.ST_MTIME] == mtime and \ src_stat[stat.ST_SIZE] == size: *************** *** 135,138 **** --- 139,143 ---- cf = open(compiled_name, "wb") marshal.dump(compiled_config_version, cf) + marshal.dump(win32api.GetKeyboardLayoutName(), cf) marshal.dump(imp.get_magic(), cf) marshal.dump(src_stat[stat.ST_SIZE], cf) Index: bindings.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/bindings.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** bindings.py 4 Jan 2009 22:37:36 -0000 1.9 --- bindings.py 28 Oct 2010 01:52:49 -0000 1.10 *************** *** 169,186 **** event = self.keymap.get( keyinfo ) if event is None: - ## if key == 220: # Dead key - ## return 1 - ## # Translate the raw scancode into an Ascii character. - ## print "translating", key, "(with state)", keyState, - ## key = win32ui.TranslateVirtualKey(key) - ## print "Got back key", `key`, - #### if key is None: - #### return 1 # Dead-key - don't handle at all!!! - ## if key: - ## # Then back to a "normalized" scan-code. - ## key = keycodes.get_scan_code(key[0]) - ## keyinfo = key, keyState - ## event = self.keymap.get( keyinfo ) - ## if event is None: return 1 return self.fire(event, None) --- 169,172 ---- Index: keycodes.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/keycodes.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** keycodes.py 4 Dec 2008 07:02:55 -0000 1.7 --- keycodes.py 28 Oct 2010 01:52:49 -0000 1.8 *************** *** 1,54 **** import string import win32con ! char_ranges = [ ! (string.ascii_lowercase, -32), ! (string.digits, 0), ! ("?><:[]\\", 128), ! (";", 127), ! ("=", 126), ! ("/.,", 144), ! ("`{}|", 96), ! ("_", 94), ! ("-+", 144), ! ("'", 183), ! ('"', 188), ! ("~", 66), ! ("!",16), ! ("#$%&", 18), ! ("()", 17), ! ] ! key_name_to_code = {} key_code_to_name = {} ! _better_names = [ ! ("esc", win32con.VK_ESCAPE), ! ("enter", win32con.VK_RETURN), ! ("pgup", win32con.VK_BACK), ! ("pgdn", win32con.VK_NEXT), ! ] ! def _fillmap(): # Pull the VK_names from win32con names = [entry for entry in win32con.__dict__ if entry.startswith("VK_")] for name in names: n = name[3:].lower() ! val = getattr(win32con, name) ! key_name_to_code[n] = val ! key_code_to_name[val] = n ! # Some better named we know about ! for name, code in _better_names: ! key_name_to_code[name] = code ! key_code_to_name[code] = name ! # And the char_ranges map above ! for chars, offset in char_ranges: ! for char in chars: ! key_name_to_code[char] = ord(char)+offset ! key_code_to_name[ord(char)+offset] = char - _fillmap() ! def get_scan_code(chardesc): ! return key_name_to_code.get(chardesc.lower()) modifiers = { --- 1,52 ---- import string import win32con + import win32api + import win32ui ! MAPVK_VK_TO_CHAR = 2 ! key_name_to_vk = {} key_code_to_name = {} ! _better_names = { ! "escape": "esc", ! "return": "enter", ! "back": "pgup", ! "next": "pgdn", ! } ! ! def _fillvkmap(): # Pull the VK_names from win32con names = [entry for entry in win32con.__dict__ if entry.startswith("VK_")] for name in names: + code = getattr(win32con, name) n = name[3:].lower() ! key_name_to_vk[n] = code ! if n in _better_names: ! n = _better_names[n] ! key_name_to_vk[n] = code ! key_code_to_name[code] = n ! _fillvkmap() ! ! def get_vk(chardesc): ! if len(chardesc)==1: ! # it is a character. ! info = win32api.VkKeyScan(chardesc) ! if info==-1: ! return None, None ! vk = win32api.LOBYTE(info) ! state = win32api.HIBYTE(info) ! modifiers = 0 ! if state & 0x1: ! modifiers |= win32con.SHIFT_PRESSED ! if state & 0x2: ! modifiers |= win32con.LEFT_CTRL_PRESSED | win32con.RIGHT_CTRL_PRESSED ! if state & 0x4: ! modifiers |= win32con.LEFT_ALT_PRESSED | win32con.RIGHT_ALT_PRESSED ! return vk, modifiers ! # must be a 'key name' ! return key_name_to_vk.get(chardesc.lower()), 0 modifiers = { *************** *** 71,89 **** start = pos = 0 max = len(name) ! flags = 0 ! scancode = None while pos<max: if name[pos] in "+-": ! tok = name[start:pos].lower() ! mod = modifiers.get(tok) ! if mod is None: ! # Its a key name ! scancode = get_scan_code(tok) ! else: ! flags = flags | mod ! pos = pos + 1 # skip the sep start = pos ! pos = pos + 1 ! return scancode, flags _checks = [ --- 69,89 ---- start = pos = 0 max = len(name) ! toks = [] while pos<max: if name[pos] in "+-": ! tok = name[start:pos] ! toks.append(tok) ! pos += 1 # skip the sep start = pos ! pos += 1 ! flags = 0 ! # do the modifiers ! for tok in toks[:-1]: ! mod = modifiers.get(tok.lower()) ! if mod is not None: ! flags |= mod ! # the key name ! vk, this_flags = get_vk(toks[-1]) ! return vk, flags | this_flags _checks = [ *************** *** 103,107 **** ] ! def make_key_name(scancode, flags): # Check alt keys. flags_done = 0 --- 103,107 ---- ] ! def make_key_name(vk, flags): # Check alt keys. flags_done = 0 *************** *** 116,123 **** parts.append(hex( flags & ~flags_done ) ) # Now the key name. ! try: ! parts.append(key_code_to_name[scancode]) ! except KeyError: ! parts.append( "<Unknown scan code %s>" % scancode ) sep = "+" if sep in parts: sep = "-" --- 116,129 ---- parts.append(hex( flags & ~flags_done ) ) # Now the key name. ! if vk is None: ! parts.append("<Unknown scan code>") ! else: ! try: ! parts.append(key_code_to_name[vk]) ! except KeyError: ! # Not in our virtual key map - ask Windows what character this ! # key corresponds to. ! scancode = win32api.MapVirtualKey(vk, MAPVK_VK_TO_CHAR) ! parts.append(unichr(scancode)) sep = "+" if sep in parts: sep = "-" *************** *** 125,129 **** def _psc(char): ! sc = get_scan_code(char) print "Char %s -> %d -> %s" % (repr(char), sc, key_code_to_name.get(sc)) --- 131,135 ---- def _psc(char): ! sc, mods = get_vk(char) print "Char %s -> %d -> %s" % (repr(char), sc, key_code_to_name.get(sc)) *************** *** 135,140 **** def _pkn(n): ! scancode, flags = parse_key_name(n) ! print "%s -> %s,%s -> %s" % (n, scancode, flags, make_key_name(scancode, flags)) def test2(): --- 141,146 ---- def _pkn(n): ! vk, flags = parse_key_name(n) ! print "%s -> %s,%s -> %s" % (n, vk, flags, make_key_name(vk, flags)) def test2(): *************** *** 152,160 **** _pkn("Alt+BadKeyName") _pkn("A") _pkn("(") _pkn("Ctrl+(") _pkn("{") _pkn("!") if __name__=='__main__': ! test2() \ No newline at end of file --- 158,170 ---- _pkn("Alt+BadKeyName") _pkn("A") + _pkn("a") _pkn("(") _pkn("Ctrl+(") + _pkn("Ctrl+Shift-8") + _pkn("Ctrl+*") _pkn("{") _pkn("!") + _pkn(".") if __name__=='__main__': ! test2() |
From: Mark H. <mha...@us...> - 2010-10-28 01:52:57
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv17893/Pythonwin/pywin Modified Files: default.cfg Log Message: Pythonwin: Better support for international keyboard. (Bug 896502 and help from kxroberto) Index: default.cfg =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/default.cfg,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** default.cfg 6 Dec 2008 00:36:13 -0000 1.10 --- default.cfg 28 Oct 2010 01:52:49 -0000 1.11 *************** *** 49,54 **** Alt+/ = <<expand-word>> Ctrl+Space = <<expand-word>> ! Shift+( = <<paren-open>> ! Shift-) = <<paren-close>> Up = <<check-calltip-cancel>> Down = <<check-calltip-cancel>> --- 49,54 ---- Alt+/ = <<expand-word>> Ctrl+Space = <<expand-word>> ! ( = <<paren-open>> ! ) = <<paren-close>> Up = <<check-calltip-cancel>> Down = <<check-calltip-cancel>> |
From: Mark H. <mha...@us...> - 2010-10-28 01:52:57
|
Update of /cvsroot/pywin32/pywin32 In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv17893 Modified Files: CHANGES.txt Log Message: Pythonwin: Better support for international keyboard. (Bug 896502 and help from kxroberto) Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** CHANGES.txt 28 Oct 2010 01:01:08 -0000 1.64 --- CHANGES.txt 28 Oct 2010 01:52:49 -0000 1.65 *************** *** 49,52 **** --- 49,55 ---- (kxroberto) + * Pythonwin: Better support for international keyboards. (Bug 896502 and + help from kxroberto) + * New win32api functions GetKeyboardLayoutName, MapVirtualKey and ToAsciiEx |
From: Mark H. <mha...@us...> - 2010-10-28 01:49:42
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv17116/win32/src Modified Files: win32apimodule.cpp Log Message: make VkKeyScan and VkKeyScanEx unicode friendly Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.103 retrieving revision 1.104 diff -C2 -d -r1.103 -r1.104 *** win32apimodule.cpp 30 Aug 2010 02:44:17 -0000 1.103 --- win32apimodule.cpp 28 Oct 2010 01:49:32 -0000 1.104 *************** *** 1484,1500 **** } ! // @pymethod int|win32api|VkKeyScan|Translates a character to the corresponding virtual-key code and shift state. static PyObject * PyVkKeyScan(PyObject * self, PyObject * args) { ! char key; // @pyparm chr|char||Specifies a character ! if (!PyArg_ParseTuple(args, "c:VkKeyScan", &key)) return (NULL); int ret; ! PyW32_BEGIN_ALLOW_THREADS ! // @pyseeapi VkKeyScan ! ret = VkKeyScan(key); ! PyW32_END_ALLOW_THREADS return PyInt_FromLong(ret); } --- 1484,1521 ---- } ! // @pymethod int|win32api|VkKeyScan|Translates a character to the corresponding virtual-key code and shift state. ! // @pyparm string or unicode|char||A byte or unicode string of length 1. If a byte string is passed ! // VkKeyScanA will be called, otherwise VkKeyScanW will be called. static PyObject * PyVkKeyScan(PyObject * self, PyObject * args) { ! PyObject *obkey; // @pyparm chr|char||Specifies a character ! if (!PyArg_ParseTuple(args, "O:VkKeyScan", &obkey)) return (NULL); + int ret; ! if (PyString_Check(obkey)) { ! if (PyString_GET_SIZE(obkey) != 1) { ! PyErr_SetString(PyExc_TypeError, "must be a byte string of length 1"); ! return NULL; ! } ! PyW32_BEGIN_ALLOW_THREADS ! // @pyseeapi VkKeyScanA ! ret = VkKeyScanA(PyString_AS_STRING(obkey)[0]); ! PyW32_END_ALLOW_THREADS ! } else if (PyUnicode_Check(obkey)) { ! if (PyUnicode_GET_SIZE(obkey) != 1) { ! PyErr_SetString(PyExc_TypeError, "must be a unicode string of length 1"); ! return NULL; ! } ! PyW32_BEGIN_ALLOW_THREADS ! // @pyseeapi VkKeyScanW ! ret = VkKeyScanW(PyUnicode_AS_UNICODE(obkey)[0]); ! PyW32_END_ALLOW_THREADS ! } else { ! PyErr_SetString(PyExc_TypeError, "must be a unicode or byte string of length 1"); ! return NULL; ! } return PyInt_FromLong(ret); } *************** *** 1504,1521 **** PyVkKeyScanEx(PyObject * self, PyObject * args) { ! char key; HKL hkl; PyObject *obhkl; ! if (!PyArg_ParseTuple(args, "cO:VkKeyScanEx", ! &key, // @pyparm chr|char||Specifies a character &obhkl)) // @pyparm <o PyHANDLE>|hkl||Handle to a keyboard layout at returned by <om win32api.LoadKeyboardLayout> return (NULL); if (!PyWinObject_AsHANDLE(obhkl, (HANDLE *)&hkl)) return NULL; int ret; ! PyW32_BEGIN_ALLOW_THREADS ! // @pyseeapi VkKeyScanEx ! ret = VkKeyScanEx(key, hkl); ! PyW32_END_ALLOW_THREADS return PyInt_FromLong(ret); } --- 1525,1562 ---- PyVkKeyScanEx(PyObject * self, PyObject * args) { ! PyObject *obkey; HKL hkl; PyObject *obhkl; ! if (!PyArg_ParseTuple(args, "OO:VkKeyScanEx", ! &obkey, // @pyparm string or unicode|char||A byte or unicode string of length 1. If a byte string is passed ! // VkKeyScanExA will be called, otherwise VkKeyScanExW will be called. &obhkl)) // @pyparm <o PyHANDLE>|hkl||Handle to a keyboard layout at returned by <om win32api.LoadKeyboardLayout> return (NULL); if (!PyWinObject_AsHANDLE(obhkl, (HANDLE *)&hkl)) return NULL; + int ret; ! if (PyString_Check(obkey)) { ! if (PyString_GET_SIZE(obkey) != 1) { ! PyErr_SetString(PyExc_TypeError, "must be a byte string of length 1"); ! return NULL; ! } ! PyW32_BEGIN_ALLOW_THREADS ! // @pyseeapi VkKeyScanExA ! ret = VkKeyScanExA(PyString_AS_STRING(obkey)[0], hkl); ! PyW32_END_ALLOW_THREADS ! } else if (PyUnicode_Check(obkey)) { ! if (PyUnicode_GET_SIZE(obkey) != 1) { ! PyErr_SetString(PyExc_TypeError, "must be a unicode string of length 1"); ! return NULL; ! } ! PyW32_BEGIN_ALLOW_THREADS ! // @pyseeapi VkKeyScanExW ! ret = VkKeyScanExW(PyUnicode_AS_UNICODE(obkey)[0], hkl); ! PyW32_END_ALLOW_THREADS ! } else { ! PyErr_SetString(PyExc_TypeError, "must be a unicode or byte string of length 1"); ! return NULL; ! } return PyInt_FromLong(ret); } |
From: Mark H. <mha...@us...> - 2010-10-28 01:01:17
|
Update of /cvsroot/pywin32/pywin32 In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9758 Modified Files: CHANGES.txt Log Message: changes Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -d -r1.63 -r1.64 *** CHANGES.txt 23 Oct 2010 04:27:28 -0000 1.63 --- CHANGES.txt 28 Oct 2010 01:01:08 -0000 1.64 *************** *** 64,67 **** --- 64,72 ---- * Fix Pythonwin's Edit/Replace dialog in Python 2.3 (bug 2962078) + * Fix a few axscript issues with py3k. + + * Pythonwin now offers to create the file when attempting to open a file + that doesn't exist (ghazel via bug 1409321) + Since build 213: ---------------- |
From: Mark H. <mha...@us...> - 2010-10-27 04:23:56
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9536/Pythonwin/pywin/scintilla Modified Files: document.py Log Message: offer to create a file which doesn't exist (ghazel via bug 1409321) Index: document.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/document.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** document.py 6 May 2010 16:30:20 -0000 1.11 --- document.py 27 Oct 2010 04:23:48 -0000 1.12 *************** *** 45,51 **** f.close() except IOError: ! win32ui.MessageBox("Could not load the file from %s" % filename) ! return 0 ! return 1 --- 45,61 ---- f.close() except IOError: ! rc = win32ui.MessageBox("Could not load the file from %s\n\nDo you want to create a new file?" % filename, ! "Pythonwin", win32con.MB_YESNO | win32con.MB_ICONWARNING) ! if rc == win32con.IDNO: ! return 0 ! assert rc == win32con.IDYES, rc ! try: ! f = open(filename, 'wb+') ! try: ! self._LoadTextFromFile(f) ! finally: ! f.close() ! except IOError, e: ! rc = win32ui.MessageBox("Cannot create the file %s" % filename) return 1 |
From: Roger U. <ru...@us...> - 2010-10-27 02:38:23
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv24999 Modified Files: app.py Log Message: Override builtin input in 2.x Pythonwin, lost somewhere in py3k transition Index: app.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/app.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** app.py 27 Feb 2009 03:34:58 -0000 1.17 --- app.py 27 Oct 2010 02:38:15 -0000 1.18 *************** *** 372,376 **** def Win32Input(prompt=None): "Provide input() for gui apps" ! return eval(input(prompt)) try: --- 372,376 ---- def Win32Input(prompt=None): "Provide input() for gui apps" ! return eval(raw_input(prompt)) try: *************** *** 378,381 **** --- 378,382 ---- # must be py2x... sys.modules['__builtin__'].raw_input=Win32RawInput + sys.modules['__builtin__'].input=Win32Input except NameError: # must be py3k |
From: Mark H. <mha...@us...> - 2010-10-27 01:25:36
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv14031/Pythonwin/pywin/debugger Modified Files: debugger.py Log Message: fix crash removing breakpoint from breakpoint window (bug 3058010) Index: debugger.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger/debugger.py,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** debugger.py 25 Aug 2010 07:39:53 -0000 1.26 --- debugger.py 27 Oct 2010 01:25:28 -0000 1.27 *************** *** 331,335 **** item_id = self.GetItem(num)[6] from bdb import Breakpoint ! for bplist in Breakpoint.bplist.itervalues(): for bp in bplist: if id(bp)==item_id: --- 331,335 ---- item_id = self.GetItem(num)[6] from bdb import Breakpoint ! for bplist in Breakpoint.bplist.values(): for bp in bplist: if id(bp)==item_id: |
From: Mark H. <mha...@us...> - 2010-10-27 01:10:03
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axscript/client In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11276/com/win32comext/axscript/client Modified Files: error.py Log Message: Fix a few axscript issues with py3k. Index: error.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/client/error.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** error.py 4 Jan 2009 13:45:02 -0000 1.12 --- error.py 27 Oct 2010 01:09:55 -0000 1.13 *************** *** 91,95 **** raise ! def _BuildFromSyntaxError(self, site, value, tb): # All syntax errors should have a message as element 0 try: --- 91,96 ---- raise ! def _BuildFromSyntaxError(self, site, exc, tb): ! value = exc.args # All syntax errors should have a message as element 0 try: |
From: Mark H. <mha...@us...> - 2010-10-27 01:10:02
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axscript/test In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11276/com/win32comext/axscript/test Modified Files: leakTest.py Log Message: Fix a few axscript issues with py3k. Index: leakTest.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/test/leakTest.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** leakTest.py 4 Dec 2008 03:38:20 -0000 1.3 --- leakTest.py 27 Oct 2010 01:09:55 -0000 1.4 *************** *** 78,83 **** end sub """ ! PyScript = """\ ! print "PyScript is being parsed..." prop = "Property Value" def hello(arg1): --- 78,86 ---- end sub """ ! if sys.version_info < (3,): ! PyScript = """print "PyScript is being parsed..."\n""" ! else: ! PyScript = """print("PyScript is being parsed...")\n""" ! PyScript += """\ prop = "Property Value" def hello(arg1): |
From: Roger U. <ru...@us...> - 2010-10-26 05:42:47
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv14335 Modified Files: win32file.i Log Message: Use PyBuffer_FillInfo to create Py_buffer struct (layout changed since 3.0) New Capsule API in 3.2 replaces PyCObject functions Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.110 retrieving revision 1.111 diff -C2 -d -r1.110 -r1.111 *** win32file.i 27 Aug 2010 06:47:53 -0000 1.110 --- win32file.i 26 Oct 2010 05:42:39 -0000 1.111 *************** *** 356,373 **** // theoretically this could be in pywintypes, but this is the only place // it is called... static PyObject *PyBuffer_FromReadWriteMemory(void *buf, Py_ssize_t size){ ! Py_buffer info={ ! buf, ! NULL, // obj added in 3.0b3 ! size, ! FALSE, // readonly ! 0, // ndim ! NULL, // format ! NULL, // shape ! NULL, // strides ! NULL, // suboffsets ! 0, // itemsize ! NULL, // internal ! }; return PyMemoryView_FromBuffer(&info); } --- 356,370 ---- // theoretically this could be in pywintypes, but this is the only place // it is called... + static PyObject *PyBuffer_FromReadWriteMemory(void *buf, Py_ssize_t size){ ! Py_buffer info; ! /* PyBUF_CONTIG contains PyBUF_ND, so that Py_buffer.shape is filled in. ! Apparently the shape is now required for even simple contiguous byte ! buffers. (see get_shape0 in memoryobject.c) ! Since PyBuffer_FillInfo is specifically for this case, it should probably ! set the shape unconditionally. ! */ ! if (PyBuffer_FillInfo(&info, NULL, buf, size, 0, PyBUF_CONTIG) == -1) ! return NULL; return PyMemoryView_FromBuffer(&info); } *************** *** 1017,1021 **** PyObject *obWriteData; PyObject *obOverlapped = NULL; - PyBufferProcs *pb = NULL; if (!PyArg_ParseTuple(args, "OO|O:WriteFile", --- 1014,1017 ---- *************** *** 1935,1939 **** WSAPROTOCOL_INFO wsProtInfo; UINT cbSize = sizeof(wsProtInfo); - PyBufferProcs *pb = NULL; if (!PyArg_ParseTuple( --- 1931,1934 ---- *************** *** 2128,2132 **** int rc; DWORD dwBufSize; - PyBufferProcs *pb = NULL; if (!PyArg_ParseTuple( --- 2123,2126 ---- *************** *** 2410,2414 **** PyObject *obOverlapped = NULL; DWORD dwFlags = 0; - PyBufferProcs *pb = NULL; if (!PyArg_ParseTuple( --- 2404,2407 ---- *************** *** 2506,2510 **** PyObject *obOverlapped = NULL; DWORD dwFlags = 0; - PyBufferProcs *pb = NULL; if (!PyArg_ParseTuple( --- 2499,2502 ---- *************** *** 4228,4235 **** --- 4220,4243 ---- } + #if PY_VERSION_HEX > 0x03010000 + // Capsule API replaced PyCObject in 3.2. + void encryptedfilecontextdestructor(PyObject *obctxt){ + if (!PyCapsule_IsValid(obctxt, NULL)) + return; // should not happen, but maybe print a warning just in case ? + // Check if context has already been explicitely destroyed + // The capsule's context is set to this value in CloseEncryptedFileRaw + if (PyCapsule_GetContext(obctxt) == INVALID_HANDLE_VALUE) + return; + void *ctxt = PyCapsule_GetPointer(obctxt, NULL); + if (pfnCloseEncryptedFileRaw) + (*pfnCloseEncryptedFileRaw)(ctxt); + } + #else void encryptedfilecontextdestructor(void *ctxt){ if (pfnCloseEncryptedFileRaw && ctxt) (*pfnCloseEncryptedFileRaw)(ctxt); } + #endif + // @pyswig PyCObject|OpenEncryptedFileRaw|Initiates a backup or restore operation on an encrypted file *************** *** 4259,4263 **** --- 4267,4275 ---- PyWin_SetAPIError("OpenEncryptedFileRaw", err); else{ + #if PY_VERSION_HEX > 0x03010000 + ret=PyCapsule_New(ctxt, NULL, encryptedfilecontextdestructor); + #else ret=PyCObject_FromVoidPtr(ctxt, encryptedfilecontextdestructor); + #endif if (ret==NULL) (*pfnCloseEncryptedFileRaw)(ctxt); *************** *** 4315,4319 **** --- 4327,4335 ---- &obctxt)) // @pyparm PyCObject|Context||Context object returned from <om win32file.OpenEncryptedFileRaw> return NULL; + #if PY_VERSION_HEX > 0x03010000 + ctxt=PyCapsule_GetPointer(obctxt, NULL); + #else ctxt=PyCObject_AsVoidPtr(obctxt); + #endif if (ctxt==NULL) return NULL; *************** *** 4392,4396 **** --- 4408,4416 ---- &obctxt)) // @pyparm PyCObject|Context||Context object returned from <om win32file.OpenEncryptedFileRaw> return NULL; + #if PY_VERSION_HEX > 0x03010000 + ctxt=PyCapsule_GetPointer(obctxt, NULL); + #else ctxt=PyCObject_AsVoidPtr(obctxt); + #endif if (ctxt==NULL) return NULL; *************** *** 4429,4432 **** --- 4449,4467 ---- // crashes. // So must bypass the CObject API for this. + #if PY_VERSION_HEX > 0x03010000 + if (!PyCapsule_IsValid(obctxt, NULL)) + return PyErr_Format(PyExc_TypeError, "param must be handle to an encrypted file (got type %s)", obctxt->ob_type->tp_name); + if (PyCapsule_GetDestructor(obctxt) != encryptedfilecontextdestructor) + return PyErr_Format(PyExc_TypeError, "param must be handle to an encrypted file (got a CObject with invalid destructor)"); + /* PyCapsule will *not* allow you to set the pointer to NULL, so use its extra context pointer + to signal that we have already destroyed our context. + ??? Maybe just set the pointer itself to INVALID_HANDLE_VALUE ??? + */ + if (PyCapsule_GetContext(obctxt) == INVALID_HANDLE_VALUE) + return PyErr_Format(PyExc_ValueError, "This handle has already been closed"); + void *ctxt = PyCapsule_GetPointer(obctxt, NULL); + (*pfnCloseEncryptedFileRaw)(ctxt); + PyCapsule_SetContext(obctxt, INVALID_HANDLE_VALUE); + #else if (!PyCObject_Check(obctxt)) return PyErr_Format(PyExc_TypeError, "param must be handle to an encrypted file (got type %s)", obctxt->ob_type->tp_name); *************** *** 4440,4443 **** --- 4475,4479 ---- (*pfnCloseEncryptedFileRaw)(pcobj->cobject); pcobj->cobject = 0; + #endif Py_INCREF(Py_None); return Py_None; |
From: Mark H. <mha...@us...> - 2010-10-23 05:21:32
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv12529 Modified Files: shell.cpp Log Message: Fix ShellExecuteEx on py3k Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -d -r1.76 -r1.77 *** shell.cpp 18 May 2010 18:57:32 -0000 1.76 --- shell.cpp 23 Oct 2010 05:21:24 -0000 1.77 *************** *** 2294,2304 **** if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&info.hwnd)) goto done; ! if (obVerb && !PyWinObject_AsString(obVerb, (char **)&info.lpVerb)) goto done; ! if (obFile && !PyWinObject_AsString(obFile, (char **)&info.lpFile)) goto done; ! if (obParams && !PyWinObject_AsString(obParams, (char **)&info.lpParameters)) goto done; ! if (obDirectory && !PyWinObject_AsString(obDirectory, (char **)&info.lpDirectory)) goto done; if (obIDList) { --- 2294,2304 ---- if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&info.hwnd)) goto done; ! if (obVerb && !PyWinObject_AsTCHAR(obVerb, (TCHAR **)&info.lpVerb)) goto done; ! if (obFile && !PyWinObject_AsTCHAR(obFile, (TCHAR **)&info.lpFile)) goto done; ! if (obParams && !PyWinObject_AsTCHAR(obParams, (TCHAR **)&info.lpParameters)) goto done; ! if (obDirectory && !PyWinObject_AsTCHAR(obDirectory, (TCHAR **)&info.lpDirectory)) goto done; if (obIDList) { *************** *** 2309,2313 **** if (obClass) { info.fMask |= SEE_MASK_CLASSNAME; ! if (!PyWinObject_AsString(obClass, (char **)&info.lpClass)) goto done; } --- 2309,2313 ---- if (obClass) { info.fMask |= SEE_MASK_CLASSNAME; ! if (!PyWinObject_AsTCHAR(obClass, (TCHAR **)&info.lpClass)) goto done; } |
From: Mark H. <mha...@us...> - 2010-10-23 04:46:25
|
Update of /cvsroot/pywin32/pywin32 In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv27835 Modified Files: pywin32_postinstall.py Log Message: add flush to our post-install 'Tee' object Index: pywin32_postinstall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/pywin32_postinstall.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** pywin32_postinstall.py 16 Feb 2009 06:32:20 -0000 1.32 --- pywin32_postinstall.py 23 Oct 2010 04:46:17 -0000 1.33 *************** *** 15,18 **** --- 15,21 ---- self.f.write(what) tee_f.write(what) + def flush(self): + self.f.flush() + tee_f.flush() sys.stderr = Tee(sys.stderr) |
From: Mark H. <mha...@us...> - 2010-10-23 04:27:36
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv19184/win32/src Modified Files: win32dynamicdialog.cpp Log Message: PyLong_AsUnsignedLong doesn't link ints in 2.3 - fixes bug 2962078 Index: win32dynamicdialog.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32dynamicdialog.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** win32dynamicdialog.cpp 28 Dec 2008 10:44:59 -0000 1.6 --- win32dynamicdialog.cpp 23 Oct 2010 04:27:27 -0000 1.7 *************** *** 539,543 **** --- 539,548 ---- goto cleanup; if (obexstyle != Py_None) { + #if (PY_VERSION_HEX < 0x02040000) + // py2.3 dies if PyLong_AsUnsignedLong is passed an int object. + tpl.dwExtendedStyle = (unsigned long)PyInt_AsLong(obexstyle); + #else tpl.dwExtendedStyle = PyLong_AsUnsignedLong(obexstyle); + #endif if (tpl.dwExtendedStyle==-1 && PyErr_Occurred()) goto cleanup; |
From: Mark H. <mha...@us...> - 2010-10-23 04:27:36
|
Update of /cvsroot/pywin32/pywin32 In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv19184 Modified Files: CHANGES.txt Log Message: PyLong_AsUnsignedLong doesn't link ints in 2.3 - fixes bug 2962078 Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** CHANGES.txt 23 Oct 2010 01:03:22 -0000 1.62 --- CHANGES.txt 23 Oct 2010 04:27:28 -0000 1.63 *************** *** 62,65 **** --- 62,67 ---- take an SRowSet param. + * Fix Pythonwin's Edit/Replace dialog in Python 2.3 (bug 2962078) + Since build 213: ---------------- |
From: Mark H. <mha...@us...> - 2010-10-23 01:03:30
|
Update of /cvsroot/pywin32/pywin32 In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4893 Modified Files: CHANGES.txt Log Message: Fix Python reference leak when creating SRowSet objects Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -d -r1.61 -r1.62 *** CHANGES.txt 27 Aug 2010 07:37:23 -0000 1.61 --- CHANGES.txt 23 Oct 2010 01:03:22 -0000 1.62 *************** *** 59,62 **** --- 59,65 ---- large font on the new line (markt via patch 2813056) + * Fix Python reference leak when calling MAPI/Exchange functions which + take an SRowSet param. + Since build 213: ---------------- |