pywin32-checkins Mailing List for Python for Windows Extensions (Page 68)
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: Roger U. <ru...@us...> - 2008-09-13 04:26:09
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2919/extensions Modified Files: Tag: py3k PyGEnumVariant.cpp PyGErrorLog.cpp PyGPropertyBag.cpp PyICatInformation.cpp PyIEnumCATEGORYINFO.cpp PyIMoniker.cpp PyIStorage.cpp Log Message: Allow to build with UNICODE defined More changes for Py3k Index: PyIMoniker.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIMoniker.cpp,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** PyIMoniker.cpp 2 Nov 2003 09:56:42 -0000 1.4 --- PyIMoniker.cpp 13 Sep 2008 04:26:18 -0000 1.4.4.1 *************** *** 299,312 **** if (S_OK!=hr) // S_OK only acceptable return PyCom_BuildPyException(hr, pMy, IID_IMoniker); ! PyObject *obResult = PyString_FromUnicode(result); ! ! IMalloc *pMalloc = NULL; ! #ifndef MS_WINCE // So how do I fix this leak on CE? ! CoGetMalloc(1, &pMalloc); ! #endif ! if (pMalloc) { ! pMalloc->Free(result); ! pMalloc->Release(); ! } return obResult; } --- 299,304 ---- if (S_OK!=hr) // S_OK only acceptable return PyCom_BuildPyException(hr, pMy, IID_IMoniker); ! PyObject *obResult = PyWinObject_FromWCHAR(result); ! CoTaskMemFree(result); return obResult; } Index: PyIEnumCATEGORYINFO.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIEnumCATEGORYINFO.cpp,v retrieving revision 1.6 retrieving revision 1.6.4.1 diff -C2 -d -r1.6 -r1.6.4.1 *** PyIEnumCATEGORYINFO.cpp 2 Nov 2003 09:57:44 -0000 1.6 --- PyIEnumCATEGORYINFO.cpp 13 Sep 2008 04:26:18 -0000 1.6.4.1 *************** *** 64,68 **** { PyObject *obNewIID = PyWinObject_FromIID(rgVar[i].catid); ! PyObject *ob = Py_BuildValue("OiN", obNewIID, rgVar[i].lcid, PyString_FromUnicode(rgVar[i].szDescription)); Py_XDECREF(obNewIID); if ( ob == NULL ) --- 64,68 ---- { PyObject *obNewIID = PyWinObject_FromIID(rgVar[i].catid); ! PyObject *ob = Py_BuildValue("OiN", obNewIID, rgVar[i].lcid, PyWinObject_FromWCHAR(rgVar[i].szDescription)); Py_XDECREF(obNewIID); if ( ob == NULL ) Index: PyIStorage.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIStorage.cpp,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** PyIStorage.cpp 25 Jan 2005 13:33:16 -0000 1.4 --- PyIStorage.cpp 13 Sep 2008 04:26:18 -0000 1.4.4.1 *************** *** 551,555 **** if (ppstm==NULL) return E_POINTER; PyObject *result; ! PyObject *obName = PyString_FromUnicode(pwcsName); HRESULT hr=InvokeViaPolicy("CreateStream", &result, "Oiii", obName, grfMode, reserved1, reserved2); Py_XDECREF(obName); --- 551,555 ---- if (ppstm==NULL) return E_POINTER; PyObject *result; ! PyObject *obName = PyWinObject_FromWCHAR(pwcsName); HRESULT hr=InvokeViaPolicy("CreateStream", &result, "Oiii", obName, grfMode, reserved1, reserved2); Py_XDECREF(obName); *************** *** 577,581 **** if (ppstm==NULL) return E_POINTER; PyObject *result; ! PyObject *obName = PyString_FromUnicode(pwcsName); HRESULT hr=InvokeViaPolicy("OpenStream", &result, "Ozii", obName, NULL, grfMode, reserved2); Py_XDECREF(obName); --- 577,581 ---- if (ppstm==NULL) return E_POINTER; PyObject *result; ! PyObject *obName = PyWinObject_FromWCHAR(pwcsName); HRESULT hr=InvokeViaPolicy("OpenStream", &result, "Ozii", obName, NULL, grfMode, reserved2); Py_XDECREF(obName); *************** *** 603,607 **** if (ppstg==NULL) return E_POINTER; PyObject *result; ! PyObject *obName = PyString_FromUnicode(pwcsName); HRESULT hr=InvokeViaPolicy("CreateStorage", &result, "Oiii", obName, grfMode, dwStgFmt, reserved2); Py_XDECREF(obName); --- 603,607 ---- if (ppstg==NULL) return E_POINTER; PyObject *result; ! PyObject *obName = PyWinObject_FromWCHAR(pwcsName); HRESULT hr=InvokeViaPolicy("CreateStorage", &result, "Oiii", obName, grfMode, dwStgFmt, reserved2); Py_XDECREF(obName); *************** *** 634,638 **** PyObject *obpstgPriority = PyCom_PyObjectFromIUnknown(pstgPriority, IID_IStorage, TRUE); PyObject *result; ! PyObject *obName = PyString_FromUnicode(pwcsName); HRESULT hr=InvokeViaPolicy("OpenStorage", &result, "OOizi", obName, obpstgPriority, grfMode, NULL, reserved); Py_XDECREF(obName); --- 634,638 ---- PyObject *obpstgPriority = PyCom_PyObjectFromIUnknown(pstgPriority, IID_IStorage, TRUE); PyObject *result; ! PyObject *obName = PyWinObject_FromWCHAR(pwcsName); HRESULT hr=InvokeViaPolicy("OpenStorage", &result, "OOizi", obName, obpstgPriority, grfMode, NULL, reserved); Py_XDECREF(obName); *************** *** 677,682 **** PY_GATEWAY_METHOD; PyObject *obpstgDest = PyCom_PyObjectFromIUnknown(pstgDest, IID_IStorage, TRUE); ! PyObject *obName = PyString_FromUnicode(pwcsName); ! PyObject *obNewName = PyString_FromUnicode(pwcsNewName); HRESULT hr=InvokeViaPolicy("MoveElementTo", NULL, "OOOi", obName, obpstgDest, obNewName, grfFlags); Py_XDECREF(obpstgDest); --- 677,682 ---- PY_GATEWAY_METHOD; PyObject *obpstgDest = PyCom_PyObjectFromIUnknown(pstgDest, IID_IStorage, TRUE); ! PyObject *obName = PyWinObject_FromWCHAR(pwcsName); ! PyObject *obNewName = PyWinObject_FromWCHAR(pwcsNewName); HRESULT hr=InvokeViaPolicy("MoveElementTo", NULL, "OOOi", obName, obpstgDest, obNewName, grfFlags); Py_XDECREF(obpstgDest); *************** *** 729,733 **** { PY_GATEWAY_METHOD; ! PyObject *obName = PyString_FromUnicode(pwcsName); HRESULT hr=InvokeViaPolicy("DestroyElement", NULL, "O", obName); Py_XDECREF(obName); --- 729,733 ---- { PY_GATEWAY_METHOD; ! PyObject *obName = PyWinObject_FromWCHAR(pwcsName); HRESULT hr=InvokeViaPolicy("DestroyElement", NULL, "O", obName); Py_XDECREF(obName); *************** *** 740,745 **** { PY_GATEWAY_METHOD; ! PyObject *obOldName = PyString_FromUnicode(pwcsOldName); ! PyObject *obNewName = PyString_FromUnicode(pwcsNewName); HRESULT hr=InvokeViaPolicy("RenameElement", NULL, "OO", obOldName, obNewName); Py_XDECREF(obOldName); --- 740,745 ---- { PY_GATEWAY_METHOD; ! PyObject *obOldName = PyWinObject_FromWCHAR(pwcsOldName); ! PyObject *obNewName = PyWinObject_FromWCHAR(pwcsNewName); HRESULT hr=InvokeViaPolicy("RenameElement", NULL, "OO", obOldName, obNewName); Py_XDECREF(obOldName); *************** *** 758,762 **** PyObject *obpatime = new PyTime(*patime); PyObject *obpmtime = new PyTime(*pmtime); ! PyObject *obName = PyString_FromUnicode(pwcsName); HRESULT hr=InvokeViaPolicy("SetElementTimes", NULL, "OOOO", obName, obpctime, obpatime, obpmtime); Py_XDECREF(obpctime); --- 758,762 ---- PyObject *obpatime = new PyTime(*patime); PyObject *obpmtime = new PyTime(*pmtime); ! PyObject *obName = PyWinObject_FromWCHAR(pwcsName); HRESULT hr=InvokeViaPolicy("SetElementTimes", NULL, "OOOO", obName, obpctime, obpatime, obpmtime); Py_XDECREF(obpctime); Index: PyGPropertyBag.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyGPropertyBag.cpp,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** PyGPropertyBag.cpp 19 Nov 1999 04:03:23 -0000 1.2 --- PyGPropertyBag.cpp 13 Sep 2008 04:26:18 -0000 1.2.4.1 *************** *** 26,30 **** } ! PyObject *obName = PyString_FromUnicode(pszPropName); // keep with string for b/w compat. PyObject *result; HRESULT hr = InvokeViaPolicy("Read", --- 26,30 ---- } ! PyObject *obName = PyWinObject_FromWCHAR(pszPropName); PyObject *result; HRESULT hr = InvokeViaPolicy("Read", *************** *** 57,61 **** return PyCom_SetCOMErrorFromPyException(GetIID()); ! PyObject *obName = PyString_FromUnicode(pszPropName); // keep with string for b/w compat. HRESULT hr = InvokeViaPolicy("Write", NULL, --- 57,61 ---- return PyCom_SetCOMErrorFromPyException(GetIID()); ! PyObject *obName = PyWinObject_FromWCHAR(pszPropName); HRESULT hr = InvokeViaPolicy("Write", NULL, Index: PyGErrorLog.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyGErrorLog.cpp,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** PyGErrorLog.cpp 19 Nov 1999 04:03:23 -0000 1.2 --- PyGErrorLog.cpp 13 Sep 2008 04:26:18 -0000 1.2.4.1 *************** *** 16,21 **** return PyCom_SetCOMErrorFromPyException(GetIID()); ! // We use a string object for B/W compatibility. ! PyObject *obName = PyString_FromUnicode(pszPropName); HRESULT hr = InvokeViaPolicy("AddError", NULL, --- 16,20 ---- return PyCom_SetCOMErrorFromPyException(GetIID()); ! PyObject *obName = PyWinObject_FromWCHAR(pszPropName); HRESULT hr = InvokeViaPolicy("AddError", NULL, Index: PyICatInformation.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyICatInformation.cpp,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -C2 -d -r1.5 -r1.5.4.1 *** PyICatInformation.cpp 9 Apr 2004 11:27:04 -0000 1.5 --- PyICatInformation.cpp 13 Sep 2008 04:26:18 -0000 1.5.4.1 *************** *** 134,140 **** if (S_OK!=hr) // S_OK only acceptable return PyCom_BuildPyException(hr, pMy, IID_ICatInformation); ! // @comm The return type is a true PyString, not a Uniocode object. ! // @todo Upgrade the return type to be Unicode. ! PyObject *rc = PyString_FromUnicode(pResult); CoTaskMemFree(pResult); return rc; --- 134,138 ---- if (S_OK!=hr) // S_OK only acceptable return PyCom_BuildPyException(hr, pMy, IID_ICatInformation); ! PyObject *rc = PyWinObject_FromWCHAR(pResult); CoTaskMemFree(pResult); return rc; Index: PyGEnumVariant.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyGEnumVariant.cpp,v retrieving revision 1.2 retrieving revision 1.2.4.1 diff -C2 -d -r1.2 -r1.2.4.1 *** PyGEnumVariant.cpp 19 Nov 1999 04:03:23 -0000 1.2 --- PyGEnumVariant.cpp 13 Sep 2008 04:26:18 -0000 1.2.4.1 *************** *** 4,10 **** #include "PyIEnumVARIANT.h" - extern void PyCom_LogF(const TCHAR *fmt, ...); - #define LogF PyCom_LogF - STDMETHODIMP PyGEnumVARIANT::Next( /* [in] */ ULONG celt, --- 4,7 ---- *************** *** 52,56 **** error: PyErr_Clear(); // just in case ! LogF(_T("PyGEnumVariant::Next got a bad return value")); Py_DECREF(result); return PyCom_SetCOMErrorFromSimple(E_FAIL, IID_IEnumVARIANT, "Next() did not return a sequence of objects"); --- 49,53 ---- error: PyErr_Clear(); // just in case ! PyCom_LogF("PyGEnumVariant::Next got a bad return value"); Py_DECREF(result); return PyCom_SetCOMErrorFromSimple(E_FAIL, IID_IEnumVARIANT, "Next() did not return a sequence of objects"); |
From: Roger U. <ru...@us...> - 2008-09-13 04:26:09
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2919/include Modified Files: Tag: py3k PythonCOM.h Log Message: Allow to build with UNICODE defined More changes for Py3k Index: PythonCOM.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PythonCOM.h,v retrieving revision 1.27.2.1 retrieving revision 1.27.2.2 diff -C2 -d -r1.27.2.1 -r1.27.2.2 *** PythonCOM.h 29 Aug 2008 08:27:38 -0000 1.27.2.1 --- PythonCOM.h 13 Sep 2008 04:26:18 -0000 1.27.2.2 *************** *** 734,736 **** --- 734,738 ---- PYCOM_EXPORT PyObject *MakeOLECHARToObj(const OLECHAR * str); + PYCOM_EXPORT void PyCom_LogF(const char *fmt, ...); + #endif // __PYTHONCOM_H__ |
From: Roger U. <ru...@us...> - 2008-09-12 07:04:38
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4778 Modified Files: Tag: py3k PyWinTypesmodule.cpp Log Message: Return unicode msg in PyWin_SetBasicCOMError Index: PyWinTypesmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PyWinTypesmodule.cpp,v retrieving revision 1.39.2.2 retrieving revision 1.39.2.3 diff -C2 -d -r1.39.2.2 -r1.39.2.3 *** PyWinTypesmodule.cpp 31 Aug 2008 02:11:22 -0000 1.39.2.2 --- PyWinTypesmodule.cpp 12 Sep 2008 07:04:46 -0000 1.39.2.3 *************** *** 350,354 **** TCHAR buf[255]; ! int bufSize = sizeof(buf); int numCopied = ::FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, hr, 0, buf, bufSize, NULL ); if (numCopied>0) { --- 350,354 ---- TCHAR buf[255]; ! int bufSize = sizeof(buf)/sizeof(TCHAR); int numCopied = ::FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, hr, 0, buf, bufSize, NULL ); if (numCopied>0) { *************** *** 361,367 **** wsprintf(buf, _T("COM Error 0x%x"), hr); } ! PyObject *obBuf = PyString_FromTCHAR(buf); ! PyObject *evalue = Py_BuildValue("iOzz", hr, obBuf, NULL, NULL); ! Py_XDECREF(obBuf); PyErr_SetObject(PyWinExc_COMError, evalue); Py_XDECREF(evalue); --- 361,365 ---- wsprintf(buf, _T("COM Error 0x%x"), hr); } ! PyObject *evalue = Py_BuildValue("iNzz", hr, PyWinObject_FromTCHAR(buf), NULL, NULL); PyErr_SetObject(PyWinExc_COMError, evalue); Py_XDECREF(evalue); |
From: Roger U. <ru...@us...> - 2008-09-11 07:51:14
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24141 Modified Files: Tag: py3k AutoIndent.py Log Message: Fix another line ending problem Index: AutoIndent.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle/AutoIndent.py,v retrieving revision 1.3.2.2 retrieving revision 1.3.2.3 diff -C2 -d -r1.3.2.2 -r1.3.2.3 *** AutoIndent.py 8 Sep 2008 04:08:27 -0000 1.3.2.2 --- AutoIndent.py 11 Sep 2008 07:51:22 -0000 1.3.2.3 *************** *** 212,216 **** text.delete("insert") # start new line ! text.insert("insert", '\n') # adjust indentation for continuations and block --- 212,217 ---- text.delete("insert") # start new line ! ## Line ending needs to be configured somewhere instead of hardcoded ! text.insert("insert", '\r\n') # adjust indentation for continuations and block |
From: Roger U. <ru...@us...> - 2008-09-11 07:48:14
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22863/Demos Modified Files: Tag: py3k win32gui_menu.py Log Message: Get menu demo running in Py3k Index: win32gui_menu.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_menu.py,v retrieving revision 1.8.2.1 retrieving revision 1.8.2.2 diff -C2 -d -r1.8.2.1 -r1.8.2.2 *** win32gui_menu.py 29 Aug 2008 04:59:23 -0000 1.8.2.1 --- win32gui_menu.py 11 Sep 2008 07:48:21 -0000 1.8.2.2 *************** *** 310,314 **** crBkgnd = SetBkColor(hDC, GetSysColor(win32con.COLOR_HIGHLIGHT)) ! each_pad = self.icon_x_pad / 2 x_icon = left + GetSystemMetrics(win32con.SM_CXMENUCHECK) + each_pad x_text = x_icon + self.menu_icon_width + each_pad --- 310,314 ---- crBkgnd = SetBkColor(hDC, GetSysColor(win32con.COLOR_HIGHLIGHT)) ! each_pad = self.icon_x_pad // 2 x_icon = left + GetSystemMetrics(win32con.SM_CXMENUCHECK) + each_pad x_text = x_icon + self.menu_icon_width + each_pad |
From: Roger U. <ru...@us...> - 2008-09-11 07:48:12
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22863/Lib Modified Files: Tag: py3k win32gui_struct.py Log Message: Get menu demo running in Py3k Index: win32gui_struct.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32gui_struct.py,v retrieving revision 1.11 retrieving revision 1.11.2.1 diff -C2 -d -r1.11 -r1.11.2.1 *** win32gui_struct.py 4 May 2008 10:45:54 -0000 1.11 --- win32gui_struct.py 11 Sep 2008 07:48:21 -0000 1.11.2.1 *************** *** 89,96 **** if text is not None: fMask |= win32con.MIIM_STRING ! if isinstance(text, unicode): ! text = text.encode("mbcs") ! str_buf = array.array("c", text+'\0') ! cch = len(str_buf) # We are taking address of strbuf - it must not die until windows # has finished with our structure. --- 89,97 ---- if text is not None: fMask |= win32con.MIIM_STRING ! if not isinstance(text, str): ! raise TypeError('MENUITEMINFO text must be unicode') ! encoded_text = (text+'\0').encode("utf-16-le") ! str_buf = array.array("b", encoded_text) ! cch = len(text) # We are taking address of strbuf - it must not die until windows # has finished with our structure. *************** *** 109,123 **** fState, wID, ! long(hSubMenu), ! long(hbmpChecked), ! long(hbmpUnchecked), dwItemData, lptext, cch, ! long(hbmpItem) ) # Now copy the string to a writable buffer, so that the result # could be passed to a 'Get' function ! return array.array("c", item), extras def UnpackMENUITEMINFO(s): --- 110,124 ---- fState, wID, ! int(hSubMenu), ! int(hbmpChecked), ! int(hbmpUnchecked), dwItemData, lptext, cch, ! int(hbmpItem) ) # Now copy the string to a writable buffer, so that the result # could be passed to a 'Get' function ! return array.array("b", item), extras def UnpackMENUITEMINFO(s): |
From: Roger U. <ru...@us...> - 2008-09-11 07:44:14
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21199 Modified Files: Tag: py3k win32gui.i Log Message: PyGetString is only used raw bytes Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.118.2.1 retrieving revision 1.118.2.2 diff -C2 -d -r1.118.2.1 -r1.118.2.2 *** win32gui.i 29 Aug 2008 04:59:26 -0000 1.118.2.1 --- win32gui.i 11 Sep 2008 07:44:23 -0000 1.118.2.2 *************** *** 1590,1597 **** %{ ! // @pyswig object|PyGetString|Returns a string object from an address. static PyObject *PyGetString(PyObject *self, PyObject *args) { ! TCHAR *addr = 0; size_t len = -1; #ifdef _WIN64 --- 1590,1597 ---- %{ ! // @pyswig bytes|PyGetString|Returns bytes from an address. static PyObject *PyGetString(PyObject *self, PyObject *args) { ! char *addr = 0; size_t len = -1; #ifdef _WIN64 *************** *** 1614,1621 **** return NULL; } ! return PyWinObject_FromTCHAR(addr, len); } // This should probably be in a __try just in case. ! return PyWinObject_FromTCHAR(addr); } %} --- 1614,1621 ---- return NULL; } ! return PyString_FromStringAndSize(addr, len); } // This should probably be in a __try just in case. ! return PyString_FromString(addr); } %} |
From: Roger U. <ru...@us...> - 2008-09-11 05:12:31
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24548 Modified Files: Tag: py3k win32gui_taskbar.py Log Message: Removie import *, change to work in py3k Index: win32gui_taskbar.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_taskbar.py,v retrieving revision 1.9.2.1 retrieving revision 1.9.2.2 diff -C2 -d -r1.9.2.1 -r1.9.2.2 *** win32gui_taskbar.py 29 Aug 2008 04:59:23 -0000 1.9.2.1 --- win32gui_taskbar.py 11 Sep 2008 05:12:41 -0000 1.9.2.2 *************** *** 1,12 **** # Creates a task-bar icon. Run from Python.exe to see the # messages printed. ! from win32api import * ! from win32gui import * ! import win32con import sys, os class MainWindow: def __init__(self): ! msg_TaskbarRestart = RegisterWindowMessage("TaskbarCreated"); message_map = { msg_TaskbarRestart: self.OnRestart, --- 1,11 ---- # Creates a task-bar icon. Run from Python.exe to see the # messages printed. ! import win32api, win32gui ! import win32con, winerror import sys, os class MainWindow: def __init__(self): ! msg_TaskbarRestart = win32gui.RegisterWindowMessage("TaskbarCreated"); message_map = { msg_TaskbarRestart: self.OnRestart, *************** *** 16,37 **** } # Register the Window class. ! wc = WNDCLASS() ! hinst = wc.hInstance = GetModuleHandle(None) wc.lpszClassName = "PythonTaskbarDemo" wc.style = win32con.CS_VREDRAW | win32con.CS_HREDRAW; ! wc.hCursor = LoadCursor( 0, win32con.IDC_ARROW ) wc.hbrBackground = win32con.COLOR_WINDOW wc.lpfnWndProc = message_map # could also specify a wndproc. ! classAtom = RegisterClass(wc) # Create the Window. style = win32con.WS_OVERLAPPED | win32con.WS_SYSMENU ! self.hwnd = CreateWindow( classAtom, "Taskbar Demo", style, \ 0, 0, win32con.CW_USEDEFAULT, win32con.CW_USEDEFAULT, \ 0, 0, hinst, None) ! UpdateWindow(self.hwnd) self._DoCreateIcons() def _DoCreateIcons(self): # Try and find a custom icon ! hinst = GetModuleHandle(None) iconPathName = os.path.abspath(os.path.join( os.path.split(sys.executable)[0], "pyc.ico" )) if not os.path.isfile(iconPathName): --- 15,44 ---- } # Register the Window class. ! wc = win32gui.WNDCLASS() ! hinst = wc.hInstance = win32api.GetModuleHandle(None) wc.lpszClassName = "PythonTaskbarDemo" wc.style = win32con.CS_VREDRAW | win32con.CS_HREDRAW; ! wc.hCursor = win32api.LoadCursor( 0, win32con.IDC_ARROW ) wc.hbrBackground = win32con.COLOR_WINDOW wc.lpfnWndProc = message_map # could also specify a wndproc. ! ! # Don't blow up if class aready registered to make testing easier ! try: ! classAtom = win32gui.RegisterClass(wc) ! except win32gui.error as err_info: ! if err_info.args[0]!=winerror.ERROR_CLASS_ALREADY_EXISTS: ! raise ! # Create the Window. style = win32con.WS_OVERLAPPED | win32con.WS_SYSMENU ! self.hwnd = win32gui.CreateWindow( wc.lpszClassName, "Taskbar Demo", style, \ 0, 0, win32con.CW_USEDEFAULT, win32con.CW_USEDEFAULT, \ 0, 0, hinst, None) ! win32gui.UpdateWindow(self.hwnd) self._DoCreateIcons() + def _DoCreateIcons(self): # Try and find a custom icon ! hinst = win32api.GetModuleHandle(None) iconPathName = os.path.abspath(os.path.join( os.path.split(sys.executable)[0], "pyc.ico" )) if not os.path.isfile(iconPathName): *************** *** 46,56 **** else: print("Can't find a Python icon file - using default") ! hicon = LoadIcon(0, win32con.IDI_APPLICATION) ! flags = NIF_ICON | NIF_MESSAGE | NIF_TIP nid = (self.hwnd, 0, flags, win32con.WM_USER+20, hicon, "Python Demo") try: ! Shell_NotifyIcon(NIM_ADD, nid) ! except error: # This is common when windows is starting, and this code is hit # before the taskbar has been created. --- 53,63 ---- else: print("Can't find a Python icon file - using default") ! hicon = win32gui.LoadIcon(0, win32con.IDI_APPLICATION) ! flags = win32gui.NIF_ICON | win32gui.NIF_MESSAGE | win32gui.NIF_TIP nid = (self.hwnd, 0, flags, win32con.WM_USER+20, hicon, "Python Demo") try: ! win32gui.Shell_NotifyIcon(win32gui.NIM_ADD, nid) ! except win32gui.error: # This is common when windows is starting, and this code is hit # before the taskbar has been created. *************** *** 64,69 **** def OnDestroy(self, hwnd, msg, wparam, lparam): nid = (self.hwnd, 0) ! Shell_NotifyIcon(NIM_DELETE, nid) ! PostQuitMessage(0) # Terminate the app. def OnTaskbarNotify(self, hwnd, msg, wparam, lparam): --- 71,76 ---- def OnDestroy(self, hwnd, msg, wparam, lparam): nid = (self.hwnd, 0) ! win32gui.Shell_NotifyIcon(win32gui.NIM_DELETE, nid) ! win32gui.PostQuitMessage(0) # Terminate the app. def OnTaskbarNotify(self, hwnd, msg, wparam, lparam): *************** *** 72,93 **** elif lparam==win32con.WM_LBUTTONDBLCLK: print("You double-clicked me - goodbye") ! DestroyWindow(self.hwnd) elif lparam==win32con.WM_RBUTTONUP: print("You right clicked me.") ! menu = CreatePopupMenu() ! AppendMenu( menu, win32con.MF_STRING, 1023, "Display Dialog") ! AppendMenu( menu, win32con.MF_STRING, 1024, "Say Hello") ! AppendMenu( menu, win32con.MF_STRING, 1025, "Exit program" ) ! pos = GetCursorPos() # See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/menus_0hdi.asp ! SetForegroundWindow(self.hwnd) ! TrackPopupMenu(menu, win32con.TPM_LEFTALIGN, pos[0], pos[1], 0, self.hwnd, None) ! PostMessage(self.hwnd, win32con.WM_NULL, 0, 0) return 1 def OnCommand(self, hwnd, msg, wparam, lparam): ! id = LOWORD(wparam) if id == 1023: ! from . import win32gui_dialog win32gui_dialog.DemoModal() elif id == 1024: --- 79,100 ---- elif lparam==win32con.WM_LBUTTONDBLCLK: print("You double-clicked me - goodbye") ! win32gui.DestroyWindow(self.hwnd) elif lparam==win32con.WM_RBUTTONUP: print("You right clicked me.") ! menu = win32gui.CreatePopupMenu() ! win32gui.AppendMenu( menu, win32con.MF_STRING, 1023, "Display Dialog") ! win32gui.AppendMenu( menu, win32con.MF_STRING, 1024, "Say Hello") ! win32gui.AppendMenu( menu, win32con.MF_STRING, 1025, "Exit program" ) ! pos = win32gui.GetCursorPos() # See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/menus_0hdi.asp ! win32gui.SetForegroundWindow(self.hwnd) ! win32gui.TrackPopupMenu(menu, win32con.TPM_LEFTALIGN, pos[0], pos[1], 0, self.hwnd, None) ! win32gui.PostMessage(self.hwnd, win32con.WM_NULL, 0, 0) return 1 def OnCommand(self, hwnd, msg, wparam, lparam): ! id = win32api.LOWORD(wparam) if id == 1023: ! import win32gui_dialog win32gui_dialog.DemoModal() elif id == 1024: *************** *** 95,99 **** elif id == 1025: print("Goodbye") ! DestroyWindow(self.hwnd) else: print("Unknown command -", id) --- 102,106 ---- elif id == 1025: print("Goodbye") ! win32gui.DestroyWindow(self.hwnd) else: print("Unknown command -", id) *************** *** 101,105 **** def main(): w=MainWindow() ! PumpMessages() if __name__=='__main__': --- 108,112 ---- def main(): w=MainWindow() ! win32gui.PumpMessages() if __name__=='__main__': |
From: Roger U. <ru...@us...> - 2008-09-11 04:02:38
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30640 Modified Files: Tag: py3k win32gui_dialog.py Log Message: Fixes for wide-character build Index: win32gui_dialog.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/win32gui_dialog.py,v retrieving revision 1.7.2.1 retrieving revision 1.7.2.2 diff -C2 -d -r1.7.2.1 -r1.7.2.2 *** win32gui_dialog.py 29 Aug 2008 04:59:23 -0000 1.7.2.1 --- win32gui_dialog.py 11 Sep 2008 04:02:48 -0000 1.7.2.2 *************** *** 72,76 **** vals.append(0) else: ! str_buf = array.array("b", val+'\0') vals.append(str_buf.buffer_info()[0]) vals.append(len(val)) --- 72,89 ---- vals.append(0) else: ! # Unicode object no longer supports buffer interface. According to pep 3137 ! # (http://www.python.org/dev/peps/pep-3137/) ! # this is because the internal represention is platform dependent. This seems ! # spurious to me since whatever code receives the data alreeady needs to know ! # the encoding anyway, whether it's python's internal encoding or not. And since ! # there is no way to specify the encoding in the data itself, what difference does ! # it make ? ! if isinstance(val, str): ! val=(val+'\0').encode('utf-16-le') ! else: ! # Should this continue to accept a byte string, or would it be better to ! # throw an error here ? ! val=val+b'\0' ! str_buf = array.array("b", val) vals.append(str_buf.buffer_info()[0]) vals.append(len(val)) *************** *** 219,227 **** lvc.text = "Title" lvc.cx = 200 ! win32gui.SendMessage(self.hwndList, commctrl.LVM_INSERTCOLUMN, 0, lvc.toparam()) lvc.iSubItem = 0 lvc.text = "Order" lvc.cx = 50 ! win32gui.SendMessage(self.hwndList, commctrl.LVM_INSERTCOLUMN, 0, lvc.toparam()) win32gui.UpdateWindow(self.hwnd) --- 232,240 ---- lvc.text = "Title" lvc.cx = 200 ! win32gui.SendMessage(self.hwndList, commctrl.LVM_INSERTCOLUMNW, 0, lvc.toparam()) lvc.iSubItem = 0 lvc.text = "Order" lvc.cx = 50 ! win32gui.SendMessage(self.hwndList, commctrl.LVM_INSERTCOLUMNW, 0, lvc.toparam()) win32gui.UpdateWindow(self.hwnd) *************** *** 234,242 **** num_items = win32gui.SendMessage(self.hwndList, commctrl.LVM_GETITEMCOUNT) item = LVITEM(text=columns[0], iItem = num_items) ! new_index = win32gui.SendMessage(self.hwndList, commctrl.LVM_INSERTITEM, 0, item.toparam()) col_no = 1 for col in columns[1:]: item = LVITEM(text=col, iItem = new_index, iSubItem = col_no) ! win32gui.SendMessage(self.hwndList, commctrl.LVM_SETITEM, 0, item.toparam()) col_no += 1 self.list_data[new_index] = data --- 247,255 ---- num_items = win32gui.SendMessage(self.hwndList, commctrl.LVM_GETITEMCOUNT) item = LVITEM(text=columns[0], iItem = num_items) ! new_index = win32gui.SendMessage(self.hwndList, commctrl.LVM_INSERTITEMW, 0, item.toparam()) col_no = 1 for col in columns[1:]: item = LVITEM(text=col, iItem = new_index, iSubItem = col_no) ! win32gui.SendMessage(self.hwndList, commctrl.LVM_SETITEMW, 0, item.toparam()) col_no += 1 self.list_data[new_index] = data *************** *** 294,298 **** def OnNotify(self, hwnd, msg, wparam, lparam): ! format = "iiiiiiiiiii" buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam) hwndFrom, idFrom, code, iItem, iSubItem, uNewState, uOldState, uChanged, actionx, actiony, lParam \ --- 307,311 ---- def OnNotify(self, hwnd, msg, wparam, lparam): ! format = "iiiiiiiiiii" ## ??? needs adjustment for 64-bit ??? buf = win32gui.PyMakeBuffer(struct.calcsize(format), lparam) hwndFrom, idFrom, code, iItem, iSubItem, uNewState, uOldState, uChanged, actionx, actiony, lParam \ |
From: Roger U. <ru...@us...> - 2008-09-08 04:08:17
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6911/scintilla Modified Files: Tag: py3k document.py view.py Log Message: Fix some problems with line endings Index: view.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/view.py,v retrieving revision 1.28.2.3 retrieving revision 1.28.2.4 diff -C2 -d -r1.28.2.3 -r1.28.2.4 *** view.py 3 Sep 2008 03:05:57 -0000 1.28.2.3 --- view.py 8 Sep 2008 04:08:27 -0000 1.28.2.4 *************** *** 387,394 **** doc = self.GetDocument() s = self.GetTextRange() ! ## if is_platform_unicode: ! ## s = str(s,"utf-8").encode("mbcs") ! f = open(filename, 'w') ! f.write(s) f.close() doc.SetModifiedFlag(0) --- 387,394 ---- doc = self.GetDocument() s = self.GetTextRange() ! # Save in binary mode so line endings are not translated. ! # Edit control uses '\r\n', and universal newlines mode replaces ALL '\r' with '\r\n'. ! f = open(filename, 'wb') ! f.write(s.encode('mbcs')) f.close() doc.SetModifiedFlag(0) Index: document.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/document.py,v retrieving revision 1.6.4.3 retrieving revision 1.6.4.4 diff -C2 -d -r1.6.4.3 -r1.6.4.4 *** document.py 3 Sep 2008 03:05:57 -0000 1.6.4.3 --- document.py 8 Sep 2008 04:08:27 -0000 1.6.4.4 *************** *** 5,9 **** import win32con import string ! import array ParentScintillaDocument=docview.Document --- 5,9 ---- import win32con import string ! import os ParentScintillaDocument=docview.Document *************** *** 15,33 **** def OnOpenDocument(self, filename): # init data members ! #print "Opening", filename self.SetPathName(filename) # Must set this early! try: ! if is_platform_unicode: ! # Scintilla in UTF-8 mode - translate accordingly. ! import codecs ! f = codecs.open(filename, 'rb', default_platform_encoding) ! else: ! f = open(filename, 'r') try: text = f.read() finally: f.close() - # Translate from locale-specific (MCBS) encoding to UTF-8 for Scintilla - text = text.encode(default_scintilla_encoding) except IOError: win32ui.MessageBox("Could not load the file from %s" % filename) --- 15,26 ---- def OnOpenDocument(self, filename): # init data members ! # print ("CScintillaDocument.OnOpenDocument", filename) self.SetPathName(filename) # Must set this early! try: ! f = open(filename, 'r') try: text = f.read() finally: f.close() except IOError: win32ui.MessageBox("Could not load the file from %s" % filename) *************** *** 35,41 **** self._SetLoadedText(text) - ## if self.GetFirstView(): - ## self.GetFirstView()._SetLoadedText(text) - ## self.SetModifiedFlag(0) # No longer dirty return 1 --- 28,31 ---- *************** *** 54,57 **** --- 44,58 ---- # Helper to transfer text from the MFC document to the control. def _SetLoadedText(self, text): + # In universal newlines mode, line endings read from file are translated to '\n', + # but edit control expects CR/LF ('\r\n'). + # Might be simpler to just tell scintilla to use '\n' + # SendScintilla(scintillacon.SCI_SETEOLMODE, scintillacon.SC_EOL_LF) + # and have eols automatically translated back when written to file + if os.linesep != '\n': + text=text.replace('\n', os.linesep) + + # Translate from unicode to UTF-8 bytes for Scintilla + char_text = text.encode(default_scintilla_encoding) + view = self.GetFirstView() if view.IsWindow(): *************** *** 60,67 **** # Make sure the control isnt read-only view.SetReadOnly(0) - - doc = self view.SendScintilla(scintillacon.SCI_CLEARALL) ! view.SendMessage(scintillacon.SCI_ADDTEXT, text) view.SendScintilla(scintillacon.SCI_SETUNDOCOLLECTION, 1, 0) view.SendScintilla(win32con.EM_EMPTYUNDOBUFFER, 0, 0) --- 61,66 ---- # Make sure the control isnt read-only view.SetReadOnly(0) view.SendScintilla(scintillacon.SCI_CLEARALL) ! view.SendMessage(scintillacon.SCI_ADDTEXT, char_text) view.SendScintilla(scintillacon.SCI_SETUNDOCOLLECTION, 1, 0) view.SendScintilla(win32con.EM_EMPTYUNDOBUFFER, 0, 0) |
From: Roger U. <ru...@us...> - 2008-09-08 04:08:17
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6911/idle Modified Files: Tag: py3k AutoIndent.py Log Message: Fix some problems with line endings Index: AutoIndent.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/idle/AutoIndent.py,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** AutoIndent.py 29 Aug 2008 06:16:42 -0000 1.3.2.1 --- AutoIndent.py 8 Sep 2008 04:08:27 -0000 1.3.2.2 *************** *** 198,202 **** # the cursor is in or at leading indentation; just inject # an empty line at the start ! text.insert("insert linestart", '\n') return "break" indent = line[:i] --- 198,202 ---- # the cursor is in or at leading indentation; just inject # an empty line at the start ! text.insert("insert linestart", '\r\n') return "break" indent = line[:i] |
From: Roger U. <ru...@us...> - 2008-09-07 04:14:26
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28916 Modified Files: Tag: py3k ToDo.txt Log Message: Couple more things done Index: ToDo.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/Attic/ToDo.txt,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** ToDo.txt 5 Sep 2008 07:18:57 -0000 1.1.2.5 --- ToDo.txt 7 Sep 2008 04:14:36 -0000 1.1.2.6 *************** *** 2,11 **** ! Places where need to call PyType_Ready for all types defined in module ! perfmon ! directsound ! dbi, odbc ! win32help ! Swig doesn't handle com_interface_parent, adsi will not build --- 2,7 ---- ! odbc - input binding needs changes for longs, use SQL_C_LONG instead SQL_C_SBIGINT if value fits in a long ! Swig doesn't handle com_interface_parent, adsi will not build |
From: Roger U. <ru...@us...> - 2008-09-07 04:12:16
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/taskscheduler/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28101 Modified Files: Tag: py3k taskscheduler.cpp Log Message: Call PyType_Ready for PyTASK_TRIGGER Index: taskscheduler.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/taskscheduler/src/taskscheduler.cpp,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** taskscheduler.cpp 29 Aug 2008 08:33:26 -0000 1.2.4.1 --- taskscheduler.cpp 7 Sep 2008 04:12:25 -0000 1.2.4.2 *************** *** 39,47 **** #define RETURN_ERROR return; module = Py_InitModule("taskscheduler", taskscheduler_methods); - if (!module) - return; - dict = PyModule_GetDict(module); - if (!dict) - return; #else #define RETURN_ERROR return NULL; --- 39,42 ---- *************** *** 54,63 **** }; module = PyModule_Create(&taskscheduler_def); if (!module) ! return NULL; dict = PyModule_GetDict(module); if (!dict) ! return NULL; ! #endif // Register all of our interfaces, gateways and IIDs. --- 49,61 ---- }; module = PyModule_Create(&taskscheduler_def); + #endif + if (!module) ! RETURN_ERROR; dict = PyModule_GetDict(module); if (!dict) ! RETURN_ERROR; ! if (PyType_Ready(&PyTASK_TRIGGERType) == -1) ! RETURN_ERROR; // Register all of our interfaces, gateways and IIDs. |
From: Roger U. <ru...@us...> - 2008-09-07 02:21:53
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/directsound/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16802 Modified Files: Tag: py3k ds_record.py ds_test.py Log Message: Convert tests to run under py3k Index: ds_record.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/directsound/test/ds_record.py,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** ds_record.py 7 Mar 2005 22:18:45 -0000 1.1 --- ds_record.py 7 Sep 2008 02:22:03 -0000 1.1.4.1 *************** *** 23,28 **** sdesc.lpwfxFormat.wBitsPerSample = 16 ! print sdesc ! print d buffer = d.CreateCaptureBuffer(sdesc) --- 23,28 ---- sdesc.lpwfxFormat.wBitsPerSample = 16 ! print (sdesc) ! print (d) buffer = d.CreateCaptureBuffer(sdesc) *************** *** 41,42 **** --- 41,43 ---- f.write(wav_header_pack(sdesc.lpwfxFormat, 352800)) f.write(data) + f.close() Index: ds_test.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/directsound/test/ds_test.py,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** ds_test.py 7 Mar 2005 22:18:45 -0000 1.4 --- ds_test.py 7 Sep 2008 02:22:03 -0000 1.4.4.1 *************** *** 14,28 **** def wav_header_unpack(data): (riff, riffsize, wave, fmt, fmtsize, format, nchannels, samplespersecond, datarate, blockalign, bitspersample, data, datalength) \ = struct.unpack('<4sl4s4slhhllhh4sl', data) ! if riff != 'RIFF': ! raise ValueError, 'invalid wav header' ! if fmtsize != 16 or fmt != 'fmt ' or data != 'data': # fmt chuck is not first chunk, directly followed by data chuck # It is nowhere required that they are, it is just very common ! raise ValueError, 'cannot understand wav header' wfx = pywintypes.WAVEFORMATEX() --- 14,29 ---- def wav_header_unpack(data): + print (struct.unpack('<4sl4s4slhhllhh4sl', data)) (riff, riffsize, wave, fmt, fmtsize, format, nchannels, samplespersecond, datarate, blockalign, bitspersample, data, datalength) \ = struct.unpack('<4sl4s4slhhllhh4sl', data) ! if riff != b'RIFF': ! raise ValueError('invalid wav header') ! if fmtsize != 16 or fmt != b'fmt ' or data != b'data': # fmt chuck is not first chunk, directly followed by data chuck # It is nowhere required that they are, it is just very common ! raise ValueError('cannot understand wav header') wfx = pywintypes.WAVEFORMATEX() *************** *** 261,265 **** def testPlay(self): '''Mesdames et Messieurs, la cour de Devin Dazzle''' ! fname=os.path.join(os.path.dirname(__file__), "01-Intro.wav") f = open(fname, 'rb') hdr = f.read(WAV_HEADER_SIZE) --- 262,266 ---- def testPlay(self): '''Mesdames et Messieurs, la cour de Devin Dazzle''' ! fname=os.path.join(os.path.dirname(sys.argv[0]), "01-Intro.wav") f = open(fname, 'rb') hdr = f.read(WAV_HEADER_SIZE) |
From: Roger U. <ru...@us...> - 2008-09-07 02:21:00
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/directsound/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16644 Modified Files: Tag: py3k PyDSBUFFERDESC.cpp PyDSCBUFFERDESC.cpp directsound.cpp Log Message: Call PyType_Ready, fix conversion of attr names Index: PyDSBUFFERDESC.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/directsound/src/PyDSBUFFERDESC.cpp,v retrieving revision 1.3.4.1 retrieving revision 1.3.4.2 diff -C2 -d -r1.3.4.1 -r1.3.4.2 *** PyDSBUFFERDESC.cpp 29 Aug 2008 08:32:34 -0000 1.3.4.1 --- PyDSBUFFERDESC.cpp 7 Sep 2008 02:21:10 -0000 1.3.4.2 *************** *** 153,158 **** { PyDSBUFFERDESC *obself = (PyDSBUFFERDESC*)self; ! char *name=PyString_AsString(obname); ! if (name==NULL) return -1; --- 153,157 ---- { PyDSBUFFERDESC *obself = (PyDSBUFFERDESC*)self; ! char *name=PYWIN_ATTR_CONVERT(obname); if (name==NULL) return -1; Index: PyDSCBUFFERDESC.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/directsound/src/PyDSCBUFFERDESC.cpp,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** PyDSCBUFFERDESC.cpp 29 Aug 2008 08:32:34 -0000 1.2.4.1 --- PyDSCBUFFERDESC.cpp 7 Sep 2008 02:21:10 -0000 1.2.4.2 *************** *** 141,145 **** { PyDSCBUFFERDESC *obself = (PyDSCBUFFERDESC*)self; ! char *name=PyString_AsString(obname); if (name==NULL) --- 141,145 ---- { PyDSCBUFFERDESC *obself = (PyDSCBUFFERDESC*)self; ! char *name=PYWIN_ATTR_CONVERT(obname); if (name==NULL) Index: directsound.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/directsound/src/directsound.cpp,v retrieving revision 1.8.4.1 retrieving revision 1.8.4.2 diff -C2 -d -r1.8.4.1 -r1.8.4.2 *** directsound.cpp 29 Aug 2008 08:32:34 -0000 1.8.4.1 --- directsound.cpp 7 Sep 2008 02:21:10 -0000 1.8.4.2 *************** *** 237,253 **** }; - static int AddConstant(PyObject *dict, const char *key, long value) - { - PyObject *oval = PyInt_FromLong(value); - if (!oval) - { - return 1; - } - int rc = PyDict_SetItemString(dict, (char*)key, oval); - Py_DECREF(oval); - return rc; - } ! #define ADD_CONSTANT(tok) AddConstant(dict, #tok, tok) static const PyCom_InterfaceSupportInfo g_interfaceSupportData[] = --- 237,242 ---- }; ! #define ADD_CONSTANT(tok) if (PyModule_AddIntConstant(module, #tok, tok) == -1) RETURN_ERROR; static const PyCom_InterfaceSupportInfo g_interfaceSupportData[] = *************** *** 272,283 **** #if (PY_VERSION_HEX < 0x03000000) module = Py_InitModule("directsound", directsound_methods); - if (!module) - return; - dict = PyModule_GetDict(module); - if (!dict) - return; #else ! static PyModuleDef directsound_def = { PyModuleDef_HEAD_INIT, --- 261,268 ---- #if (PY_VERSION_HEX < 0x03000000) + #define RETURN_ERROR return; module = Py_InitModule("directsound", directsound_methods); #else ! #define RETURN_ERROR return NULL; static PyModuleDef directsound_def = { PyModuleDef_HEAD_INIT, *************** *** 288,297 **** }; module = PyModule_Create(&directsound_def); if (!module) ! return NULL; dict = PyModule_GetDict(module); if (!dict) ! return NULL; ! #endif // Register all of our interfaces, gateways and IIDs. --- 273,284 ---- }; module = PyModule_Create(&directsound_def); + #endif + if (!module) ! RETURN_ERROR; dict = PyModule_GetDict(module); if (!dict) ! RETURN_ERROR; ! // Register all of our interfaces, gateways and IIDs. *************** *** 418,427 **** ADD_CONSTANT(DSBPN_OFFSETSTOP); ! PyDict_SetItemString(dict, "DSCAPSType", (PyObject *)&PyDSCAPSType); ! PyDict_SetItemString(dict, "DSBCAPSType", (PyObject *)&PyDSBCAPSType); ! PyDict_SetItemString(dict, "DSBUFFERDESCType", (PyObject *)&PyDSBUFFERDESCType); ! PyDict_SetItemString(dict, "DSCCAPSType", (PyObject *)&PyDSCCAPSType); ! PyDict_SetItemString(dict, "DSCBCAPSType", (PyObject *)&PyDSCBCAPSType); ! PyDict_SetItemString(dict, "DSCBUFFERDESCType", (PyObject *)&PyDSCBUFFERDESCType); #if (PY_VERSION_HEX >= 0x03000000) --- 405,421 ---- ADD_CONSTANT(DSBPN_OFFSETSTOP); ! if (PyType_Ready(&PyDSCAPSType) == -1 ! ||PyType_Ready(&PyDSBCAPSType) == -1 ! ||PyType_Ready(&PyDSBUFFERDESCType) == -1 ! ||PyType_Ready(&PyDSCCAPSType) == -1 ! ||PyType_Ready(&PyDSCBCAPSType) == -1 ! ||PyType_Ready(&PyDSCBUFFERDESCType) == -1 ! ||PyDict_SetItemString(dict, "DSCAPSType", (PyObject *)&PyDSCAPSType) == -1 ! ||PyDict_SetItemString(dict, "DSBCAPSType", (PyObject *)&PyDSBCAPSType) == -1 ! ||PyDict_SetItemString(dict, "DSBUFFERDESCType", (PyObject *)&PyDSBUFFERDESCType) == -1 ! ||PyDict_SetItemString(dict, "DSCCAPSType", (PyObject *)&PyDSCCAPSType) == -1 ! ||PyDict_SetItemString(dict, "DSCBCAPSType", (PyObject *)&PyDSCBCAPSType) == -1 ! ||PyDict_SetItemString(dict, "DSCBUFFERDESCType", (PyObject *)&PyDSCBUFFERDESCType) == -1) ! RETURN_ERROR; #if (PY_VERSION_HEX >= 0x03000000) |
From: Roger U. <ru...@us...> - 2008-09-07 02:17:08
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15031 Modified Files: Tag: py3k PyIUnknown.cpp Log Message: Return unicode from PyIUnknown::repr Index: PyIUnknown.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyIUnknown.cpp,v retrieving revision 1.12.2.1 retrieving revision 1.12.2.2 diff -C2 -d -r1.12.2.1 -r1.12.2.2 *** PyIUnknown.cpp 29 Aug 2008 08:27:37 -0000 1.12.2.1 --- PyIUnknown.cpp 7 Sep 2008 02:17:18 -0000 1.12.2.2 *************** *** 37,43 **** { // @comm The repr of this object displays both the object's address, and its attached IUnknown's address ! TCHAR buf[80]; ! wsprintf(buf, _T("<%hs at 0x%0lp with obj at 0x%0lp>"),ob_type->tp_name, this, m_obj); ! return PyString_FromTCHAR(buf); } --- 37,47 ---- { // @comm The repr of this object displays both the object's address, and its attached IUnknown's address ! char buf[256]; ! _snprintf(buf, 256, "<%hs at 0x%0lp with obj at 0x%0lp>", ob_type->tp_name, this, m_obj); ! #if (PY_VERSION_HEX < 0x03000000) ! return PyString_FromString(buf); ! #else ! return PyUnicode_FromString(buf); ! #endif } |
From: Roger U. <ru...@us...> - 2008-09-06 23:27:27
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13480 Modified Files: Tag: py3k win32helpmodule.cpp Log Message: Call PyType_Ready for types defined in module Add constants with unicode names Index: win32helpmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32helpmodule.cpp,v retrieving revision 1.4.2.1 retrieving revision 1.4.2.2 diff -C2 -d -r1.4.2.1 -r1.4.2.2 *** win32helpmodule.cpp 29 Aug 2008 04:59:26 -0000 1.4.2.1 --- win32helpmodule.cpp 6 Sep 2008 23:27:36 -0000 1.4.2.2 *************** *** 2633,2656 **** // Module constants: ! ! static int AddConstant(PyObject *dict, char *key, long value) ! { ! PyObject *okey = PyString_FromString(key); ! PyObject *oval = PyInt_FromLong(value); ! if (!okey || !oval) { ! Py_XDECREF(okey); ! Py_XDECREF(oval); ! return 1; ! } ! int rc = PyDict_SetItem(dict, okey, oval); ! Py_DECREF(okey); ! Py_DECREF(oval); ! return rc; ! } ! ! #define ADD_CONSTANT(tok) if (rc=AddConstant(dict,#tok, tok)) return rc ! ! int AddConstants(PyObject *dict) { int rc; --- 2633,2639 ---- // Module constants: + #define ADD_CONSTANT(tok) if (rc=PyModule_AddIntConstant(module, #tok, tok)) return rc ! int AddConstants(PyObject *module) { int rc; *************** *** 3250,3260 **** #if (PY_VERSION_HEX < 0x03000000) module = Py_InitModule("win32help", win32help_functions); - if (!module) - return; - dict = PyModule_GetDict(module); - if (!dict) - return; #else static PyModuleDef win32help_def = { PyModuleDef_HEAD_INIT, --- 3233,3240 ---- #if (PY_VERSION_HEX < 0x03000000) + #define RETURN_ERROR return; module = Py_InitModule("win32help", win32help_functions); #else + #define RETURN_ERROR return NULL; static PyModuleDef win32help_def = { PyModuleDef_HEAD_INIT, *************** *** 3265,3279 **** }; module = PyModule_Create(&win32help_def); if (!module) ! return NULL; dict = PyModule_GetDict(module); if (!dict) ! return NULL; ! #endif ! ! AddConstants(dict); ! PyDict_SetItemString(dict, "__version__", PyString_FromString("$Revision$")); #if (PY_VERSION_HEX >= 0x03000000) return module; --- 3245,3268 ---- }; module = PyModule_Create(&win32help_def); + #endif if (!module) ! RETURN_ERROR; dict = PyModule_GetDict(module); if (!dict) ! RETURN_ERROR; ! if (AddConstants(module) != 0) ! RETURN_ERROR; ! PyDict_SetItemString(dict, "__version__", PyString_FromString("$Revision$")); + if (PyType_Ready(&PyHH_AKLINKType) == -1 + ||PyType_Ready(&PyHH_FTS_QUERYType) == -1 + ||PyType_Ready(&PyHH_POPUPType) == -1 + ||PyType_Ready(&PyHH_WINTYPEType) == -1 + ||PyType_Ready(&PyNMHDRType) == -1 + ||PyType_Ready(&PyHHN_NOTIFYType) == -1 + ||PyType_Ready(&PyHHNTRACKType) == -1) + RETURN_ERROR; + #if (PY_VERSION_HEX >= 0x03000000) return module; |
From: Roger U. <ru...@us...> - 2008-09-06 22:33:11
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24296 Modified Files: Tag: py3k dbi.cpp odbc.cpp Log Message: Call PyType_Ready for types defined in module Add constants with unicode names Change string exceptions to real exceptions Index: odbc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/odbc.cpp,v retrieving revision 1.20.2.1 retrieving revision 1.20.2.2 diff -C2 -d -r1.20.2.1 -r1.20.2.2 *** odbc.cpp 29 Aug 2008 04:59:26 -0000 1.20.2.1 --- odbc.cpp 6 Sep 2008 22:33:20 -0000 1.20.2.2 *************** *** 755,761 **** static int ibindLong(cursorObject*cur,int column, PyObject *item) { ! int len = sizeof(double); ! double val = PyLong_AsDouble(item); ! InputBinding *ib = initInputBinding(cur, len); if (!ib) --- 755,762 ---- static int ibindLong(cursorObject*cur,int column, PyObject *item) { ! int len = sizeof(long long); ! long long val = PyLong_AsLongLong(item); ! if (val == -1 && PyErr_Occurred()) ! return 0; InputBinding *ib = initInputBinding(cur, len); if (!ib) *************** *** 768,773 **** column, SQL_PARAM_INPUT, ! SQL_C_DOUBLE, ! SQL_FLOAT, len, 0, --- 769,774 ---- column, SQL_PARAM_INPUT, ! SQL_C_SBIGINT, ! SQL_BIGINT, len, 0, *************** *** 1073,1078 **** { PyObject *sitem = PyObject_Str(item); ! rv = ibindString(cur, iCol, sitem); ! Py_DECREF(sitem); } Py_DECREF(item); --- 1074,1088 ---- { PyObject *sitem = PyObject_Str(item); ! if (sitem==NULL) ! rv = 0; ! else if PyString_Check(sitem) ! rv = ibindString(cur, iCol, sitem); ! else if PyUnicode_Check(sitem) ! rv = ibindUnicode(cur, iCol, sitem); ! else{ // Just in case some object doesn't follow the rules ! PyErr_Format(PyExc_SystemError, "??? Repr for type '%s' returned type '%s' ???", item->ob_type, sitem->ob_type); ! rv=0; ! } ! Py_XDECREF(sitem); } Py_DECREF(item); *************** *** 1875,1880 **** } else ret = Py_BuildValue("NN", ! PyString_FromStringAndSize((char *)svr, svr_size), ! PyString_FromStringAndSize((char *)desc, desc_size)); return ret; } --- 1885,1890 ---- } else ret = Py_BuildValue("NN", ! PyWinObject_FromTCHAR((TCHAR *)svr, svr_size), ! PyWinObject_FromTCHAR((TCHAR *)desc, desc_size)); return ret; } *************** *** 1887,1906 **** }; - int AddConstant(PyObject *dict, char *key, long value) - { - PyObject *okey = PyString_FromString(key); - PyObject *oval = PyInt_FromLong(value); - if (!okey || !oval) { - Py_XDECREF(okey); - Py_XDECREF(oval); - return 1; - } - int rc = PyDict_SetItem(dict,okey, oval); - Py_XDECREF(okey); - Py_XDECREF(oval); - return rc; - } - #define ADD_CONSTANT(tok) AddConstant(dict,#tok, tok) extern "C" __declspec(dllexport) --- 1897,1902 ---- }; + #define ADD_CONSTANT(tok) if (PyModule_AddIntConstant(module, #tok, tok) == -1) RETURN_ERROR; extern "C" __declspec(dllexport) *************** *** 1915,1928 **** #if (PY_VERSION_HEX < 0x03000000) module = Py_InitModule("odbc", globalMethods); - if (!module) - return; - dict = PyModule_GetDict(module); - if (!dict) - return; - if (!PyImport_ImportModule("dbi")) - return; #else static PyModuleDef odbc_def = { PyModuleDef_HEAD_INIT, --- 1911,1919 ---- #if (PY_VERSION_HEX < 0x03000000) + #define RETURN_ERROR return; module = Py_InitModule("odbc", globalMethods); #else + #define RETURN_ERROR return NULL; static PyModuleDef odbc_def = { PyModuleDef_HEAD_INIT, *************** *** 1933,1952 **** }; module = PyModule_Create(&odbc_def); if (!module) ! return NULL; dict = PyModule_GetDict(module); if (!dict) ! return NULL; if (!PyImport_ImportModule("dbi")) ! return NULL; ! #endif if (unsuccessful(SQLAllocEnv(&Env))) { odbcPrintError(SQL_NULL_HENV, 0, SQL_NULL_HSTMT, _T("INIT")); } ! odbcError = PyString_FromString("OdbcError"); ! PyDict_SetItemString(dict, "error", odbcError); /* The indices go to indices in the ODBC error table */ --- 1924,1946 ---- }; module = PyModule_Create(&odbc_def); + #endif + if (!module) ! RETURN_ERROR; dict = PyModule_GetDict(module); if (!dict) ! RETURN_ERROR; if (!PyImport_ImportModule("dbi")) ! RETURN_ERROR; if (unsuccessful(SQLAllocEnv(&Env))) { odbcPrintError(SQL_NULL_HENV, 0, SQL_NULL_HSTMT, _T("INIT")); + RETURN_ERROR; } ! odbcError = PyErr_NewException("odbc.odbcError", NULL, NULL); ! if (odbcError == NULL || PyDict_SetItemString(dict, "error", odbcError) == -1) ! RETURN_ERROR; /* The indices go to indices in the ODBC error table */ Index: dbi.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/dbi.cpp,v retrieving revision 1.10.2.1 retrieving revision 1.10.2.2 diff -C2 -d -r1.10.2.1 -r1.10.2.2 *** dbi.cpp 29 Aug 2008 04:59:26 -0000 1.10.2.1 --- dbi.cpp 6 Sep 2008 22:33:20 -0000 1.10.2.2 *************** *** 361,371 **** #if (PY_VERSION_HEX < 0x03000000) module = Py_InitModule("dbi", globalMethods); ! if (!module) ! return; ! dict = PyModule_GetDict(module); ! if (!dict) ! return; #else static PyModuleDef dbi_def = { PyModuleDef_HEAD_INIT, --- 361,369 ---- #if (PY_VERSION_HEX < 0x03000000) + #define RETURN_ERROR return; module = Py_InitModule("dbi", globalMethods); ! #else + #define RETURN_ERROR return NULL; static PyModuleDef dbi_def = { PyModuleDef_HEAD_INIT, *************** *** 376,424 **** }; module = PyModule_Create(&dbi_def); if (!module) ! return NULL; dict = PyModule_GetDict(module); if (!dict) ! return NULL; ! #endif ! PyDict_SetItemString(dict, "STRING", ! DbiString = PyString_FromString("STRING")); ! PyDict_SetItemString(dict, "RAW", ! DbiRaw = PyString_FromString("RAW")); ! PyDict_SetItemString(dict, "NUMBER", ! DbiNumber = PyString_FromString("NUMBER")); ! PyDict_SetItemString(dict, "DATE", ! DbiDate = PyString_FromString("DATE")); ! PyDict_SetItemString(dict, "ROWID", ! DbiRowId = PyString_FromString("ROWID")); ! PyDict_SetItemString( ! dict, "TYPES", ! Py_BuildValue("(OOOOO)", ! DbiString, ! DbiRaw, ! DbiNumber, ! DbiDate, ! DbiRowId)); ! /* Establish errors */ ! PyDict_SetItemString( ! dict, "noError", ! DbiNoError = PyString_FromString("dbi.no-error")); ! PyDict_SetItemString( ! dict, "opError", ! DbiOpError = PyString_FromString("dbi.operation-error")); ! PyDict_SetItemString( ! dict, "progError", ! DbiProgError = PyString_FromString("dbi.program-error")); ! PyDict_SetItemString( ! dict, "integrityError", ! DbiIntegrityError = PyString_FromString("dbi.integrity-error")); ! PyDict_SetItemString( ! dict, "dataError", ! DbiDataError = PyString_FromString("dbi.data-error")); ! PyDict_SetItemString( ! dict, "internalError", ! DbiInternalError = PyString_FromString("dbi.internal-error")); #if (PY_VERSION_HEX >= 0x03000000) --- 374,451 ---- }; module = PyModule_Create(&dbi_def); + #endif + if (!module) ! RETURN_ERROR; dict = PyModule_GetDict(module); if (!dict) ! RETURN_ERROR; ! if (PyType_Ready(&DbiDate_Type) == -1 ! ||PyType_Ready(&DbiRaw_Type) == -1 ! ||PyType_Ready(&DbiRowId_Type) == -1) ! RETURN_ERROR; ! /* These need to be unicode strings in Py3k and char strings in 2.x regardless if UNICODE ! is defined. Py_BuildValue with 's' format is a convenient way to do so. ! ??? Why expose them in multiple ways ??? ! */ ! char *szDbiString = "STRING"; ! char *szDbiRaw = "RAW"; ! char *szDbiNumber = "NUMBER"; ! char *szDbiDate = "DATE"; ! char *szDbiRowId = "ROWID"; ! PyObject *obtypes=Py_BuildValue("(sssss)", ! szDbiString, ! szDbiRaw, ! szDbiNumber, ! szDbiDate, ! szDbiRowId); ! // Steals a ref to obtypes, so it doesn't need to be DECREF'ed. ! if (obtypes==NULL || PyModule_AddObject(module, "TYPES", obtypes) == -1) ! RETURN_ERROR; ! // These are exported and used in odbc.cpp, so keep our own ref ! DbiString = PyTuple_GET_ITEM(obtypes, 0); ! Py_INCREF(DbiString); ! DbiRaw = PyTuple_GET_ITEM(obtypes, 1); ! Py_INCREF(DbiRaw); ! DbiNumber = PyTuple_GET_ITEM(obtypes, 2); ! Py_INCREF(DbiNumber); ! DbiDate = PyTuple_GET_ITEM(obtypes, 3); ! Py_INCREF(DbiDate); ! DbiRowId = PyTuple_GET_ITEM(obtypes, 4); ! Py_INCREF(DbiRowId); ! /* ??? These are also added to the module with attribute name same as value, ! not sure what the point of this is ??? ! */ ! if (PyDict_SetItem(dict, DbiString, DbiString) == -1 ! ||PyDict_SetItem(dict, DbiRaw, DbiRaw) == -1 ! ||PyDict_SetItem(dict, DbiNumber, DbiNumber) == -1 ! ||PyDict_SetItem(dict, DbiDate, DbiDate) == -1 ! ||PyDict_SetItem(dict, DbiRowId, DbiRowId) == -1) ! RETURN_ERROR; ! ! /* Establish errors ! The class names have been changed to agree with the name with which they are added to the module. ! Formerly they were actually invalid identifiers. ! */ ! DbiNoError = PyErr_NewException("dbi.noError", NULL, NULL); ! if (DbiNoError == NULL || PyDict_SetItemString(dict, "noError", DbiNoError) == -1) ! RETURN_ERROR; ! DbiOpError = PyErr_NewException("dbi.opError", NULL, NULL); ! if (DbiOpError == NULL || PyDict_SetItemString(dict, "opError", DbiOpError) == -1) ! RETURN_ERROR; ! DbiProgError = PyErr_NewException("dbi.progError", NULL, NULL); ! if (DbiProgError == NULL || PyDict_SetItemString(dict, "progError", DbiProgError) == -1) ! RETURN_ERROR; ! DbiIntegrityError = PyErr_NewException("dbi.integrityError", NULL, NULL); ! if (DbiIntegrityError == NULL || PyDict_SetItemString(dict, "integrityError", DbiIntegrityError) == -1) ! RETURN_ERROR; ! DbiDataError = PyErr_NewException("dbi.dataError", NULL, NULL); ! if (DbiDataError == NULL || PyDict_SetItemString(dict, "dataError", DbiDataError) == -1) ! RETURN_ERROR; ! DbiInternalError = PyErr_NewException("dbi.internalError", NULL, NULL); ! if (DbiInternalError == NULL || PyDict_SetItemString(dict, "internalError", DbiInternalError) == -1) ! RETURN_ERROR; #if (PY_VERSION_HEX >= 0x03000000) |
From: Roger U. <ru...@us...> - 2008-09-05 20:35:16
|
Update of /cvsroot/pywin32/pywin32/win32/src/PerfMon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15993 Modified Files: Tag: py3k PyPerfMon.cpp Log Message: Call PyType_Ready for types defined in module Index: PyPerfMon.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/PerfMon/PyPerfMon.cpp,v retrieving revision 1.2.4.1 retrieving revision 1.2.4.2 diff -C2 -d -r1.2.4.1 -r1.2.4.2 *** PyPerfMon.cpp 29 Aug 2008 05:00:24 -0000 1.2.4.1 --- PyPerfMon.cpp 5 Sep 2008 20:35:24 -0000 1.2.4.2 *************** *** 106,109 **** --- 106,116 ---- if (!module) return; dict = PyModule_GetDict(module); + if (!dict) + return; + + if (PyType_Ready(&PyPerfMonManager::type) == -1 + || PyType_Ready(&PyPERF_COUNTER_DEFINITION::type) == -1 + || PyType_Ready(&PyPERF_OBJECT_TYPE::type) == -1) + return; } *************** *** 125,128 **** --- 132,139 ---- if (!dict) return NULL; + if (PyType_Ready(&PyPerfMonManager::type) == -1 + || PyType_Ready(&PyPERF_COUNTER_DEFINITION::type) == -1 + || PyType_Ready(&PyPERF_OBJECT_TYPE::type) == -1) + return NULL; return module; } |
From: Vernon C. <kf...@us...> - 2008-09-05 18:50:00
|
Update of /cvsroot/pywin32/pywin32/adodbapi/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5601 Modified Files: adodbapitest.py Log Message: v.2.2.1 bugfix for earlier 2.1 bugfix. Do not truncate string values loaded into numeric columns Index: adodbapitest.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/tests/adodbapitest.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** adodbapitest.py 29 Aug 2008 14:32:44 -0000 1.3 --- adodbapitest.py 5 Sep 2008 18:49:48 -0000 1.4 *************** *** 35,39 **** import adodbapitestconfig ! #adodbapi.adodbapi.verbose = True import types --- 35,39 ---- import adodbapitestconfig ! #adodbapi.adodbapi.verbose = 3 import types *************** *** 163,169 **** fldId integer NOT NULL, fldData """ + sqlDataTypeString + ")\n" ! ## """ NULL ! ##) ! ##""" crsr.execute(tabdef) --- 163,167 ---- fldId integer NOT NULL, fldData """ + sqlDataTypeString + ")\n" ! crsr.execute(tabdef) *************** *** 181,193 **** if DBAPIDataTypeString=='STRING': ! assert descTuple[1] == adodbapi.STRING elif DBAPIDataTypeString == 'NUMBER': ! assert descTuple[1] == adodbapi.NUMBER elif DBAPIDataTypeString == 'BINARY': ! assert descTuple[1] == adodbapi.BINARY elif DBAPIDataTypeString == 'DATETIME': ! assert descTuple[1] == adodbapi.DATETIME elif DBAPIDataTypeString == 'ROWID': ! assert descTuple[1] == adodbapi.ROWID else: raise "DBAPIDataTypeString not provided" --- 179,191 ---- if DBAPIDataTypeString=='STRING': ! assert descTuple[1] == adodbapi.STRING, 'was "%s"'%descTuple[1] elif DBAPIDataTypeString == 'NUMBER': ! assert descTuple[1] == adodbapi.NUMBER, 'was "%s"'%descTuple[1] elif DBAPIDataTypeString == 'BINARY': ! assert descTuple[1] == adodbapi.BINARY, 'was "%s"'%descTuple[1] elif DBAPIDataTypeString == 'DATETIME': ! assert descTuple[1] == adodbapi.DATETIME, 'was "%s"'%descTuple[1] elif DBAPIDataTypeString == 'ROWID': ! assert descTuple[1] == adodbapi.ROWID, 'was "%s"'%descTuple[1] else: raise "DBAPIDataTypeString not provided" *************** *** 205,215 **** except: conn.printADOerrors() ! crsr.execute("SELECT fldData FROM tblTemp WHERE ?=fldID", [fldId]) rs=crsr.fetchone() if allowedReturnValues: ! self.assertEquals(type(rs[0]),type(allowedReturnValues[0]) ) else: ! self.assertEquals( type(rs[0]) ,type(pyData)) if compareAlmostEqual and DBAPIDataTypeString == 'DATETIME': --- 203,216 ---- except: conn.printADOerrors() ! raise crsr.execute("SELECT fldData FROM tblTemp WHERE ?=fldID", [fldId]) rs=crsr.fetchone() if allowedReturnValues: ! allowedTypes = tuple([type(aRV) for aRV in allowedReturnValues]) ! assert isinstance(rs[0],allowedTypes), \ ! 'result type "%s" must be one of %s'%(type(rs[0]),allowedTypes) else: ! assert isinstance(rs[0] ,type(pyData)), \ ! 'result type "%s" must be instance of %s'%(type(rs[0]),type(pyData)) if compareAlmostEqual and DBAPIDataTypeString == 'DATETIME': *************** *** 229,233 **** else: self.assertEquals(rs[0] , pyData) - self.helpRollbackTblTemp() --- 230,233 ---- *************** *** 236,248 **** self.helpTestDataType("float",'NUMBER',1.79e37,compareAlmostEqual=1) ! #v2.1 Cole -- use decimal for money if self.getEngine() != 'MySQL': self.helpTestDataType("smallmoney",'NUMBER',decimal.Decimal('214748.02')) self.helpTestDataType("money",'NUMBER',decimal.Decimal('-922337203685477.5808')) ! def testDataTypeInt(self): self.helpTestDataType("tinyint",'NUMBER',115) self.helpTestDataType("smallint",'NUMBER',-32768) ! self.helpTestDataType("int",'NUMBER',2147483647) if self.getEngine() != 'ACCESS': self.helpTestDataType("bit",'NUMBER',1) #Does not work correctly with access --- 236,249 ---- self.helpTestDataType("float",'NUMBER',1.79e37,compareAlmostEqual=1) ! def testDataTypeMoney(self): #v2.1 Cole -- use decimal for money if self.getEngine() != 'MySQL': self.helpTestDataType("smallmoney",'NUMBER',decimal.Decimal('214748.02')) self.helpTestDataType("money",'NUMBER',decimal.Decimal('-922337203685477.5808')) ! def testDataTypeInt(self): self.helpTestDataType("tinyint",'NUMBER',115) self.helpTestDataType("smallint",'NUMBER',-32768) ! self.helpTestDataType("int",'NUMBER',2147483647, ! pyDataInputAlternatives='2137483647') if self.getEngine() != 'ACCESS': self.helpTestDataType("bit",'NUMBER',1) #Does not work correctly with access *************** *** 393,402 **** crsr=conn.cursor() crsr.execute(tabdef) - for multiplier in (1,decimal.Decimal('2.5'),78,9999,99999,7007): crsr.execute("DELETE FROM tblTemp") correct = decimal.Decimal('12.50') * multiplier crsr.execute("INSERT INTO tblTemp(fldCurr) VALUES (?)",[correct]) - sql="SELECT fldCurr FROM tblTemp " try: --- 394,401 ---- *************** *** 404,413 **** except: conn.printADOerrors() - print sql fldcurr=crsr.fetchone()[0] self.assertEquals( fldcurr,correct) ! def testErrorConnect(self): ! self.assertRaises(adodbapi.DatabaseError,adodbapi.connect,'not a valid connect string') class TestADOwithSQLServer(CommonDBTests): --- 403,411 ---- except: conn.printADOerrors() fldcurr=crsr.fetchone()[0] self.assertEquals( fldcurr,correct) ! def testErrorConnect(self): ! self.assertRaises(adodbapi.DatabaseError,adodbapi.connect,'not a valid connect string') class TestADOwithSQLServer(CommonDBTests): *************** *** 431,449 **** def testSQLServerDataTypes(self): ! self.helpTestDataType("decimal(18,2)",'NUMBER',3.45, allowedReturnValues=[u'3.45',u'3,45']) ! self.helpTestDataType("numeric(18,2)",'NUMBER',3.45, allowedReturnValues=[u'3.45',u'3,45']) def testUserDefinedConversionForExactNumericTypes(self): ! # By default decimal and numbers are returned as strings. ! # (see testSQLServerDataTypes method) # Instead, make them return as floats ! oldconverter=adodbapi.variantConversions[adodbapi.adoExactNumericTypes] ! ! adodbapi.variantConversions[adodbapi.adoExactNumericTypes]=adodbapi.cvtFloat self.helpTestDataType("decimal(18,2)",'NUMBER',3.45,compareAlmostEqual=1) self.helpTestDataType("numeric(18,2)",'NUMBER',3.45,compareAlmostEqual=1) ! ! adodbapi.variantConversions[adodbapi.adoExactNumericTypes]=oldconverter #Restore ! def testVariableReturningStoredProcedure(self): --- 429,450 ---- def testSQLServerDataTypes(self): ! self.helpTestDataType("decimal(18,2)",'NUMBER',3.45, ! allowedReturnValues=[u'3.45',u'3,45',decimal.Decimal('3.45')]) ! self.helpTestDataType("numeric(18,2)",'NUMBER',3.45, ! allowedReturnValues=[u'3.45',u'3,45',decimal.Decimal('3.45')]) def testUserDefinedConversionForExactNumericTypes(self): ! # By default decimal and numbers are returned as decimals. # Instead, make them return as floats ! oldconverter=adodbapi.variantConversions[adodbapi.adNumeric] ! adodbapi.variantConversions[adodbapi.adNumeric]=adodbapi.cvtFloat self.helpTestDataType("decimal(18,2)",'NUMBER',3.45,compareAlmostEqual=1) self.helpTestDataType("numeric(18,2)",'NUMBER',3.45,compareAlmostEqual=1) ! # now strings ! adodbapi.variantConversions[adodbapi.adNumeric]=adodbapi.cvtString ! self.helpTestDataType("numeric(18,2)",'NUMBER','3.45') ! # now the way they were ! adodbapi.variantConversions[adodbapi.adNumeric]=oldconverter #Restore ! self.helpTestDataType("numeric(18,2)",'NUMBER',decimal.Decimal('3.45')) def testVariableReturningStoredProcedure(self): *************** *** 477,487 **** spdef= """ ! CREATE PROCEDURE sp_DeleteMeOnlyForTesting AS SELECT fldData FROM tblTemp ORDER BY fldData ASC SELECT fldData FROM tblTemp ORDER BY fldData DESC """ try: ! crsr.execute("DROP PROCEDURE sp_DeleteMeOnlyForTesting") self.conn.commit() except: #Make sure it is empty --- 478,489 ---- spdef= """ ! CREATE PROCEDURE sp_DeleteMe_OnlyForTesting AS SELECT fldData FROM tblTemp ORDER BY fldData ASC + SELECT fldData From tblTemp where fldData = -9999 SELECT fldData FROM tblTemp ORDER BY fldData DESC """ try: ! crsr.execute("DROP PROCEDURE sp_DeleteMe_OnlyForTesting") self.conn.commit() except: #Make sure it is empty *************** *** 489,500 **** crsr.execute(spdef) ! retvalues=crsr.callproc('sp_DeleteMeOnlyForTesting') row=crsr.fetchone() self.assertEquals(row[0], 0) ! assert crsr.nextset() rowdesc=crsr.fetchall() self.assertEquals(rowdesc[0][0],8) ! s=crsr.nextset() ! assert s== None,'No more return sets, should return None' self.helpRollbackTblTemp() --- 491,503 ---- crsr.execute(spdef) ! retvalues=crsr.callproc('sp_DeleteMe_OnlyForTesting') row=crsr.fetchone() self.assertEquals(row[0], 0) ! assert crsr.nextset() == True, 'Operation should succede' ! assert not crsr.fetchall(), 'Should be an empty second set' ! assert crsr.nextset() == True, 'third set should be present' rowdesc=crsr.fetchall() self.assertEquals(rowdesc[0][0],8) ! assert crsr.nextset() == None,'No more return sets, should return None' self.helpRollbackTblTemp() *************** *** 653,657 **** t1=time.gmtime(time.mktime((2002,6,28,12,14,01, 4,31+28+31+30+31+28,-1))) t2=time.gmtime(time.mktime((2002,6,28,12,16,01, 4,31+28+31+30+31+28,-1))) ! assert t1<cmd<t2,cmd def testDate(self): --- 656,660 ---- t1=time.gmtime(time.mktime((2002,6,28,12,14,01, 4,31+28+31+30+31+28,-1))) t2=time.gmtime(time.mktime((2002,6,28,12,16,01, 4,31+28+31+30+31+28,-1))) ! assert t1<cmd<t2,repr(cmd)+' should be about 2002-6-28 12:15:01' def testDate(self): |
From: Vernon C. <kf...@us...> - 2008-09-05 18:49:21
|
Update of /cvsroot/pywin32/pywin32/adodbapi In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5560 Modified Files: adodbapi.py readme.txt Log Message: v.2.2.1 bugfix for earlier 2.1 bugfix. Do not truncate string values loaded into numeric columns Index: adodbapi.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/adodbapi.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** adodbapi.py 29 Aug 2008 14:30:26 -0000 1.3 --- adodbapi.py 5 Sep 2008 18:49:30 -0000 1.4 *************** *** 1,3 **** ! """adodbapi v2.2 - A python DB API 2.0 interface to Microsoft ADO Copyright (C) 2002 Henrik Ekelund --- 1,3 ---- ! """adodbapi v2.2.1 - A python DB API 2.0 interface to Microsoft ADO Copyright (C) 2002 Henrik Ekelund *************** *** 628,632 **** print 'Parameter %d ADOtype %d, python %s' % (parmIndx,p.Type,type(elem)) if p.Direction in [adParamInput,adParamInputOutput,adParamUnknown]: ! tp = type(elem) if tp in dateconverter.types: if not defaultParameterList and p.Type in adoDateTimeTypes: --- 628,632 ---- print 'Parameter %d ADOtype %d, python %s' % (parmIndx,p.Type,type(elem)) if p.Direction in [adParamInput,adParamInputOutput,adParamUnknown]: ! tp = type(elem) # python type if tp in dateconverter.types: if not defaultParameterList and p.Type in adoDateTimeTypes: *************** *** 644,649 **** p.Value = elem else: ! L = min(L,p.Size) #v2.1 Cole limit data to defined size ! p.Value = elem[:L] #v2.1 Jevon & v2.1 Cole if L>0: #v2.1 Cole something does not like p.Size as Zero p.Size = L #v2.1 Jevon --- 644,652 ---- p.Value = elem else: ! if p.Type in adoStringTypes: #v2.2.1 Cole ! L = min(L,p.Size) #v2.1 Cole limit data to defined size ! p.Value = elem[:L] #v2.1 Jevon & v2.1 Cole ! else: ! p.Value = elem # dont limit if db column is numeric if L>0: #v2.1 Cole something does not like p.Size as Zero p.Size = L #v2.1 Jevon Index: readme.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/adodbapi/readme.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** readme.txt 29 Aug 2008 14:30:55 -0000 1.3 --- readme.txt 5 Sep 2008 18:49:30 -0000 1.4 *************** *** 22,25 **** --- 22,28 ---- Iron Python 2.0b4 or higher. + Whats new in version 2.2.1 + 1. Bugfix for v2.1 item 6: but do not correct the string length if the output column is not a string. + Whats new in version 2.2 1. Runs on Iron Python 2.0b4 with a few restrictions. It will not handle Longs or BLOB correcly, |
From: Roger U. <ru...@us...> - 2008-09-05 07:18:47
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20063 Modified Files: Tag: py3k ToDo.txt Log Message: Couple more things taken care of Index: ToDo.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/Attic/ToDo.txt,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** ToDo.txt 2 Sep 2008 09:44:09 -0000 1.1.2.4 --- ToDo.txt 5 Sep 2008 07:18:57 -0000 1.1.2.5 *************** *** 19,23 **** Pythonwin - xxx LVITEM and TVITEM conversions use PyWinobject_AsTCHAR, result needs to be freed ! LV_COLUMN conversion - same as above xxx win32uimodule - Python_callback has 64-bit issues with HWND, WPARAM, LPARAM --- 19,23 ---- Pythonwin - xxx LVITEM and TVITEM conversions use PyWinobject_AsTCHAR, result needs to be freed ! xxx LV_COLUMN conversion - same as above xxx win32uimodule - Python_callback has 64-bit issues with HWND, WPARAM, LPARAM *************** *** 30,34 **** repr for MFC objects needs work, currently doesn't print associated python class due to recursion - ! maybe special case it in __getattr__ ? Work on direct subclassing of MFC types --- 30,34 ---- repr for MFC objects needs work, currently doesn't print associated python class due to recursion - ! fixed now, but requires using new-style class in 2.x (pywin.mfc.object.Object) Work on direct subclassing of MFC types *************** *** 44,49 **** Autoindent gets spaces/tabs wrong - Several places where 'utf-8' is hardcoded, change to default_scintilla_encoding - Figure out a clean way to switch between commctrl.*A and commctrl.*W constants for hooking messages --- 44,47 ---- |
From: Roger U. <ru...@us...> - 2008-09-05 07:12:27
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17638 Modified Files: Tag: py3k win32assoc.cpp Log Message: Re-enable printing of python instance in ui_assoc_object::repr Index: win32assoc.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32assoc.cpp,v retrieving revision 1.9.2.1 retrieving revision 1.9.2.2 diff -C2 -d -r1.9.2.1 -r1.9.2.2 *** win32assoc.cpp 29 Aug 2008 05:53:29 -0000 1.9.2.1 --- win32assoc.cpp 5 Sep 2008 07:12:35 -0000 1.9.2.2 *************** *** 298,308 **** if (virtualInst == NULL) py_repr=no_repr; ! else ! py_repr=_T("??? some object ???"); ! // else{ ! /* PyObject_Repr or PyObject_Str will cause an infinite loop here, since subclasses will inherit ! *this* repr if they don't define __repr__, ! */ ! /* PyObject *vi_repr=PyObject_Str(virtualInst); if (vi_repr==NULL || !PyWinObject_AsTCHAR(vi_repr, &py_repr, FALSE)){ --- 298,302 ---- if (virtualInst == NULL) py_repr=no_repr; ! else{ PyObject *vi_repr=PyObject_Str(virtualInst); if (vi_repr==NULL || !PyWinObject_AsTCHAR(vi_repr, &py_repr, FALSE)){ *************** *** 314,318 **** Py_XDECREF(vi_repr); } - */ csRet.Format(_T(" - assoc is %p, vi=%s"), assoc, py_repr); if (bfree_repr) --- 308,311 ---- |
From: Roger U. <ru...@us...> - 2008-09-04 23:29:08
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26250 Modified Files: debugger.py Log Message: Save and restore Visible state of debugger windows Index: debugger.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger/debugger.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** debugger.py 3 Sep 2008 21:23:15 -0000 1.18 --- debugger.py 4 Sep 2008 23:29:16 -0000 1.19 *************** *** 185,188 **** --- 185,189 ---- self.list.DeleteAllItems() self.listOK = 0 + win32ui.WriteProfileVal("Debugger Windows\\" + self.title, "Visible", self.IsWindowVisible()) def CreateWindow(self, parent): style = win32con.WS_CHILD | win32con.WS_VISIBLE | win32con.WS_BORDER | commctrl.TVS_HASLINES | commctrl.TVS_LINESATROOT | commctrl.TVS_HASBUTTONS *************** *** 295,299 **** def SaveState(self): ! pass def OnListEndLabelEdit(self, std, extra): --- 296,306 ---- def SaveState(self): ! items = [] ! for i in range(self.GetItemCount()): ! items.append(self.GetItemText(i,0)) ! items.append(self.GetItemText(i,1)) ! win32ui.WriteProfileVal("Debugger Windows\\" + self.title, "BreakpointList", "\t".join(items)) ! win32ui.WriteProfileVal("Debugger Windows\\" + self.title, "Visible", self.IsWindowVisible()) ! return 1 def OnListEndLabelEdit(self, std, extra): *************** *** 359,362 **** --- 366,370 ---- items.append(self.GetItemText(i,0)) win32ui.WriteProfileVal("Debugger Windows\\" + self.title, "Items", "\t".join(items)) + win32ui.WriteProfileVal("Debugger Windows\\" + self.title, "Visible", self.IsWindowVisible()) return 1 *************** *** 444,448 **** frame.FloatControlBar(bar, float, afxres.CBRS_ALIGN_ANY) ! frame.ShowControlBar(bar, 0, 1) --- 452,456 ---- frame.FloatControlBar(bar, float, afxres.CBRS_ALIGN_ANY) ! ## frame.ShowControlBar(bar, 0, 1) *************** *** 615,619 **** self.prep_run(cmd) sys.settrace(self.trace_dispatch) ! if type(cmd) <> types.CodeType: cmd = cmd+'\n' try: --- 623,627 ---- self.prep_run(cmd) sys.settrace(self.trace_dispatch) ! if type(cmd) != types.CodeType: cmd = cmd+'\n' try: *************** *** 684,690 **** else: fname = "??" ! print `name`, fname, frame.f_lineno, frame else: ! print `name`, "None" def set_trace(self): --- 692,698 ---- else: fname = "??" ! print repr(name), fname, frame.f_lineno, frame else: ! print repr(name), "None" def set_trace(self): *************** *** 776,781 **** # Ensure the debugger windows are attached to the debugger. for id, klass, float in DebuggerDialogInfos: ! w = frame.GetControlBar(id).dialog ! w.Init(self) # ALWAYS show debugging toolbar, regardless of saved state --- 784,793 ---- # Ensure the debugger windows are attached to the debugger. for id, klass, float in DebuggerDialogInfos: ! w = frame.GetControlBar(id) ! w.dialog.Init(self) ! # Show toolbar if it was visible during last debug session ! # This would be better done using a CDockState, but that class is not wrapped yet ! if win32ui.GetProfileVal("Debugger Windows\\" + w.dialog.title, "Visible", 0): ! frame.ShowControlBar(w, 1, 1) # ALWAYS show debugging toolbar, regardless of saved state |
From: Roger U. <ru...@us...> - 2008-09-04 20:53:46
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27824 Modified Files: Tag: py3k debugger.py Log Message: Save and restore Visible state of debugger windows Index: debugger.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/debugger/debugger.py,v retrieving revision 1.17.2.2 retrieving revision 1.17.2.3 diff -C2 -d -r1.17.2.2 -r1.17.2.3 *** debugger.py 3 Sep 2008 21:30:18 -0000 1.17.2.2 --- debugger.py 4 Sep 2008 20:53:56 -0000 1.17.2.3 *************** *** 185,188 **** --- 185,189 ---- self.list.DeleteAllItems() self.listOK = 0 + win32ui.WriteProfileVal("Debugger Windows\\" + self.title, "Visible", self.IsWindowVisible()) def CreateWindow(self, parent): style = win32con.WS_CHILD | win32con.WS_VISIBLE | win32con.WS_BORDER | commctrl.TVS_HASLINES | commctrl.TVS_LINESATROOT | commctrl.TVS_HASBUTTONS *************** *** 300,303 **** --- 301,305 ---- items.append(self.GetItemText(i,1)) win32ui.WriteProfileVal("Debugger Windows\\" + self.title, "BreakpointList", "\t".join(items)) + win32ui.WriteProfileVal("Debugger Windows\\" + self.title, "Visible", self.IsWindowVisible()) return 1 *************** *** 364,367 **** --- 366,370 ---- items.append(self.GetItemText(i,0)) win32ui.WriteProfileVal("Debugger Windows\\" + self.title, "Items", "\t".join(items)) + win32ui.WriteProfileVal("Debugger Windows\\" + self.title, "Visible", self.IsWindowVisible()) return 1 *************** *** 449,453 **** frame.FloatControlBar(bar, float, afxres.CBRS_ALIGN_ANY) ! frame.ShowControlBar(bar, 0, 1) --- 452,456 ---- frame.FloatControlBar(bar, float, afxres.CBRS_ALIGN_ANY) ! ## frame.ShowControlBar(bar, 0, 1) *************** *** 593,597 **** def stop_here(self, frame): if self.isInitialBreakpoint: - print ('skip IsInitialBreakpoint') self.isInitialBreakpoint = 0 self.set_continue() --- 596,599 ---- *************** *** 785,790 **** # Ensure the debugger windows are attached to the debugger. for id, klass, float in DebuggerDialogInfos: ! w = frame.GetControlBar(id).dialog ! w.Init(self) # ALWAYS show debugging toolbar, regardless of saved state --- 787,796 ---- # Ensure the debugger windows are attached to the debugger. for id, klass, float in DebuggerDialogInfos: ! w = frame.GetControlBar(id) ! w.dialog.Init(self) ! # Show toolbar if it was visible during last debug session ! # This would be better done using a CDockState, but that class is not wrapped yet ! if win32ui.GetProfileVal("Debugger Windows\\" + w.dialog.title, "Visible", 0): ! frame.ShowControlBar(w, 1, 1) # ALWAYS show debugging toolbar, regardless of saved state |