pywin32-checkins Mailing List for Python for Windows Extensions (Page 56)
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...> - 2008-11-26 01:13:17
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13261/shell/src Modified Files: shell.cpp Log Message: autoduck: Clarify exception semantics for IsUserAnAdmin Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.70 retrieving revision 1.71 diff -C2 -d -r1.70 -r1.71 *** shell.cpp 24 Nov 2008 06:10:08 -0000 1.70 --- shell.cpp 26 Nov 2008 01:13:10 -0000 1.71 *************** *** 2470,2474 **** // @pymethod bool|shell|IsUserAnAdmin|Tests whether the current user is a member of the Administrator's group. ! // @rdesc The result is true or false. static PyObject *PyIsUserAnAdmin(PyObject *self, PyObject *args) { --- 2470,2474 ---- // @pymethod bool|shell|IsUserAnAdmin|Tests whether the current user is a member of the Administrator's group. ! // @rdesc The result is true or false, or a com_error with E_NOTIMPL is raised. static PyObject *PyIsUserAnAdmin(PyObject *self, PyObject *args) { |
From: Mark H. <mha...@us...> - 2008-11-26 01:12:06
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13175/src Modified Files: win32clipboardmodule.cpp Log Message: Merge win32clipboard changes from py3k branch, with a change to SetClipboardText which should be more backwards compatible. Index: win32clipboardmodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32clipboardmodule.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** win32clipboardmodule.cpp 7 Jan 2008 03:10:53 -0000 1.23 --- win32clipboardmodule.cpp 26 Nov 2008 01:11:54 -0000 1.24 *************** *** 313,316 **** --- 313,317 ---- // @pyparm int|format|CF_TEXT|Specifies a clipboard format. For a description of // the standard clipboard formats, see Standard Clipboard Formats. + // In Unicode builds (ie, python 3k), the default is CF_UNICODETEXT. #ifdef UNICODE int format = CF_UNICODETEXT; *************** *** 480,484 **** return NULL; if (!PyWinObject_AsHANDLE(obhglobal, &hglobal)) ! return NULL; size_t size = GlobalSize(hglobal); if (!size) --- 481,485 ---- return NULL; if (!PyWinObject_AsHANDLE(obhglobal, &hglobal)) ! return NULL; size_t size = GlobalSize(hglobal); if (!size) *************** *** 867,874 **** // @pyparm int|format||Specifies a clipboard format. For a description of ! // the standard clipboard formats, see Standard Clipboard Formats. ! // @pyparm int/buffer|hMem||Integer handle to the data in the specified ! // format, or a buffer object (eg, string). // This parameter can be 0, indicating that the window provides data in // the specified clipboard format (renders the format) upon request. If a --- 868,875 ---- // @pyparm int|format||Specifies a clipboard format. For a description of ! // the standard clipboard formats, see Standard Clipboard Formats. // @pyparm int/buffer|hMem||Integer handle to the data in the specified ! // format, or string, unicode, or any object that supports the buffer interface. ! // A global memory object is allocated, and the object's buffer is copied to the new memory. // This parameter can be 0, indicating that the window provides data in // the specified clipboard format (renders the format) upon request. If a *************** *** 889,908 **** if (!PyWinObject_AsHANDLE(obhandle , &handle)){ PyErr_Clear(); ! // @pyparmalt1 int|format||Specifies a clipboard format. For a description of ! // the standard clipboard formats, see Standard Clipboard Formats. ! // @pyparmalt1 object|ob||An object that has a read-buffer interface. ! // A global memory object is allocated, and the objects buffer is copied ! // to the new memory. const void * buf = NULL; Py_ssize_t bufSize = 0; ! ! if (PyObject_AsReadBuffer(obhandle,&buf,&bufSize)==-1) ! RETURN_TYPE_ERR("The object must support the buffer interfaces"); ! // size doesnt include nulls! ! if (PyString_Check(obhandle)) ! bufSize += 1; ! else if (PyUnicode_Check(obhandle)) ! bufSize += sizeof(wchar_t); ! // else assume buffer needs no terminator... handle = GlobalAlloc(GHND, bufSize); if (handle == NULL) { --- 890,907 ---- if (!PyWinObject_AsHANDLE(obhandle , &handle)){ PyErr_Clear(); ! const void * buf = NULL; Py_ssize_t bufSize = 0; ! // In py3k, unicode no longer supports buffer interface ! if (PyUnicode_Check(obhandle)){ ! bufSize = PyUnicode_GET_DATA_SIZE(obhandle) + sizeof(Py_UNICODE); ! buf=(void *)PyUnicode_AS_UNICODE(obhandle); ! } else { ! if (PyObject_AsReadBuffer(obhandle,&buf,&bufSize)==-1) ! return NULL; ! if (PyString_Check(obhandle)) ! bufSize++; // size doesnt include nulls! ! // else assume buffer needs no terminator... ! } handle = GlobalAlloc(GHND, bufSize); if (handle == NULL) { *************** *** 919,922 **** --- 918,922 ---- if (!data) + // XXX - should we GlobalFree the mem? return ReturnAPIError("SetClipboardData"); return PyWinLong_FromHANDLE(data); *************** *** 945,976 **** // @pymethod int|win32clipboard|SetClipboardText|Convienience function to // call SetClipboardData with text. ! static PyObject * py_set_clipboard_text(PyObject* self, PyObject* args) { - #ifdef UNICODE - int format = CF_UNICODETEXT; - #else int format = CF_TEXT; - #endif - TCHAR *text; PyObject *obtext, *ret=NULL; ! DWORD size; ! if (!PyArg_ParseTuple(args, "O:SetClipboardText", ! &obtext)) // @pyparm str/unicode|text||The text to place on the clipboard. return NULL; ! if (!PyWinObject_AsTCHAR(obtext, &text, FALSE, &size)) ! return NULL; HGLOBAL hMem; ! LPTSTR pszDst=NULL; ! hMem = GlobalAlloc(GHND, (size+1) * sizeof(TCHAR)); if (hMem == NULL) PyWin_SetAPIError("GlobalAlloc"); else{ ! pszDst = (TCHAR *)GlobalLock(hMem); ! _tcscpy(pszDst, text); ! pszDst[size] = 0; GlobalUnlock(hMem); HANDLE data; --- 945,992 ---- // @pymethod int|win32clipboard|SetClipboardText|Convienience function to // call SetClipboardData with text. ! // @comm You may pass a Unicode or string/bytes object to this function, ! // but depending on the value of the 'format' param, it may be converted ! // to the appropriate type for that param. ! // @comm Many applications will want to call this function twice, with the ! // same string specified but CF_UNICODETEXT specified the second. static PyObject * py_set_clipboard_text(PyObject* self, PyObject* args) { int format = CF_TEXT; PyObject *obtext, *ret=NULL; ! if (!PyArg_ParseTuple(args, "O|i:SetClipboardText", ! &obtext, // @pyparm str/unicode|text||The text to place on the clipboard. ! &format)) // @pyparm int|format|CF_TEXT|The clipboard format to use - must be CF_TEXT or CF_UNICODETEXT return NULL; ! const void *src = 0; ! DWORD cb = 0; // number of bytes *excluding* NULL ! size_t size_null = 0; ! if (format == CF_TEXT) { ! if (!PyWinObject_AsString(obtext, (char **)&src, FALSE, &cb)) ! return NULL; ! size_null = sizeof(char); ! } else if (format == CF_UNICODETEXT) { ! DWORD cchars; ! if (!PyWinObject_AsWCHAR(obtext, (WCHAR **)&src, FALSE, &cchars)) ! return NULL; ! cb = cchars * sizeof(WCHAR); ! size_null = sizeof(WCHAR); ! } else { ! return PyErr_Format(PyExc_ValueError, "Format arg must be one of CF_TEXT (%d) or CF_UNICODETEXT (%d) - got %d", ! CF_TEXT, CF_UNICODETEXT, format); ! } ! HGLOBAL hMem; ! BYTE *dest=NULL; ! hMem = GlobalAlloc(GHND, cb + size_null); if (hMem == NULL) PyWin_SetAPIError("GlobalAlloc"); else{ ! dest = (BYTE *)GlobalLock(hMem); ! memcpy(dest, src, cb); ! // whack the terminator on. ! memset(dest+cb, 0, size_null); GlobalUnlock(hMem); HANDLE data; *************** *** 983,987 **** ret = PyWinLong_FromHANDLE(data); } ! PyWinObject_FreeTCHAR(text); return ret; // @pyseeapi SetClipboardData --- 999,1006 ---- ret = PyWinLong_FromHANDLE(data); } ! if (format == CF_TEXT) ! PyWinObject_FreeString((char *)src); ! else ! PyWinObject_FreeWCHAR((WCHAR *)src); return ret; // @pyseeapi SetClipboardData *************** *** 1132,1153 **** ! 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_XDECREF(okey); ! Py_XDECREF(oval); ! return rc; ! } ! ! #define ADD_CONSTANT(tok) if (rc=AddConstant(dict,#tok, tok)) return rc ! static int AddConstants(PyObject *dict) { int rc; --- 1151,1157 ---- ! #define ADD_CONSTANT(tok) if (rc=PyModule_AddIntConstant(module, #tok, tok)) return rc ! static int AddConstants(PyObject *module) { int rc; *************** *** 1189,1193 **** if (!dict) return; /* Another serious error!*/ PyWinGlobals_Ensure(); ! AddConstants(dict); Py_INCREF(PyWinExc_ApiError); PyDict_SetItemString(dict, "error", PyWinExc_ApiError); --- 1193,1197 ---- if (!dict) return; /* Another serious error!*/ PyWinGlobals_Ensure(); ! AddConstants(module); Py_INCREF(PyWinExc_ApiError); PyDict_SetItemString(dict, "error", PyWinExc_ApiError); |
From: Mark H. <mha...@us...> - 2008-11-26 01:12:02
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv13175/test Modified Files: test_clipboard.py Log Message: Merge win32clipboard changes from py3k branch, with a change to SetClipboardText which should be more backwards compatible. Index: test_clipboard.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/test_clipboard.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** test_clipboard.py 1 Jun 2007 13:36:53 -0000 1.6 --- test_clipboard.py 26 Nov 2008 01:11:54 -0000 1.7 *************** *** 34,38 **** self.bmp_name = os.path.join(os.path.abspath(this_dir), "..", "Demos", "images", "smiley.bmp") ! self.failUnless(os.path.isfile(self.bmp_name)) flags = win32con.LR_DEFAULTSIZE | win32con.LR_LOADFROMFILE self.bmp_handle = win32gui.LoadImage(0, self.bmp_name, --- 34,38 ---- self.bmp_name = os.path.join(os.path.abspath(this_dir), "..", "Demos", "images", "smiley.bmp") ! self.failUnless(os.path.isfile(self.bmp_name), self.bmp_name) flags = win32con.LR_DEFAULTSIZE | win32con.LR_LOADFROMFILE self.bmp_handle = win32gui.LoadImage(0, self.bmp_name, *************** *** 60,64 **** CloseClipboard() def test_unicode(self): ! val = unicode("test-\xe0\xf2", "mbcs") SetClipboardData(win32con.CF_UNICODETEXT, val) self.failUnlessEqual(GetClipboardData(win32con.CF_UNICODETEXT), val) --- 60,64 ---- CloseClipboard() def test_unicode(self): ! val = u"test-\a9har" SetClipboardData(win32con.CF_UNICODETEXT, val) self.failUnlessEqual(GetClipboardData(win32con.CF_UNICODETEXT), val) *************** *** 66,72 **** val = "test-val" SetClipboardText(val) ! self.failUnlessEqual(GetClipboardData(win32con.CF_TEXT), val) def test_string(self): ! val = "test" SetClipboardData(win32con.CF_TEXT, val) self.failUnlessEqual(GetClipboardData(win32con.CF_TEXT), val) --- 66,77 ---- val = "test-val" SetClipboardText(val) ! # GetClipboardData doesn't to auto string conversions - so on py3k, ! # CF_TEXT returns bytes. ! expected = val.encode("ascii") ! self.failUnlessEqual(GetClipboardData(win32con.CF_TEXT), expected) ! SetClipboardText(val, win32con.CF_UNICODETEXT) ! self.failUnlessEqual(GetClipboardData(win32con.CF_UNICODETEXT), val) def test_string(self): ! val = "test".encode("ascii") SetClipboardData(win32con.CF_TEXT, val) self.failUnlessEqual(GetClipboardData(win32con.CF_TEXT), val) *************** *** 78,93 **** CloseClipboard() def test_mem(self): ! val = "test" SetClipboardData(win32con.CF_TEXT, val) # Get the raw data - this will include the '\0' raw_data = GetGlobalMemory(GetClipboardDataHandle(win32con.CF_TEXT)) ! self.failUnlessEqual(val + '\0', raw_data) def test_bad_mem(self): - if sys.getwindowsversion()[0] > 5: - print "skipping test_bad_mem - fails on Vista (x64 at least - not sure about x32...)" - return self.failUnlessRaises(pywintypes.error, GetGlobalMemory, 0) - self.failUnlessRaises(pywintypes.error, GetGlobalMemory, 1) self.failUnlessRaises(pywintypes.error, GetGlobalMemory, -1) def test_custom_mem(self): test_data = "hello\x00\xff" --- 83,100 ---- CloseClipboard() def test_mem(self): ! val = "test".encode("ascii") ! expected = "test\0".encode("ascii") SetClipboardData(win32con.CF_TEXT, val) # Get the raw data - this will include the '\0' raw_data = GetGlobalMemory(GetClipboardDataHandle(win32con.CF_TEXT)) ! self.failUnlessEqual(expected, raw_data) def test_bad_mem(self): self.failUnlessRaises(pywintypes.error, GetGlobalMemory, 0) self.failUnlessRaises(pywintypes.error, GetGlobalMemory, -1) + if sys.getwindowsversion()[0] <= 5: + # For some reason, the value '1' dies from a 64bit process, but + # "works" (ie, gives the correct exception) from a 32bit process. + # just silently skip this value on Vista. + self.failUnlessRaises(pywintypes.error, GetGlobalMemory, 1) def test_custom_mem(self): test_data = "hello\x00\xff" |
From: Mark H. <mha...@us...> - 2008-11-26 01:05:47
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv12568 Modified Files: win32file.i Log Message: Prevent EncrytptedFile CObject destructor crashing on Vistax64. Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.93 retrieving revision 1.94 diff -C2 -d -r1.93 -r1.94 *** win32file.i 30 Jun 2008 12:53:37 -0000 1.93 --- win32file.i 26 Nov 2008 01:05:36 -0000 1.94 *************** *** 44,47 **** --- 44,64 ---- %include "pywin32.i" + %{ + // older python version's don't get the PyCObject structure definition + // exposed, and we need it to cleanly zap our handles (see + // CloseEncryptedFileRaw below). + // Fortunately, the PyCObject structure has been identical from versions + // 2.3->2.6 - and 2.6 is where it is first made public. + #if (PY_VERSION_HEX < 0x02060000) + typedef struct { + PyObject_HEAD + void *cobject; + void *desc; + void (*destructor)(void *); + } PyCObject; + + #endif + %} + #define FILE_GENERIC_READ FILE_GENERIC_READ #define FILE_GENERIC_WRITE FILE_GENERIC_WRITE *************** *** 3875,3879 **** void encryptedfilecontextdestructor(void *ctxt){ ! if (pfnCloseEncryptedFileRaw) (*pfnCloseEncryptedFileRaw)(ctxt); } --- 3892,3896 ---- void encryptedfilecontextdestructor(void *ctxt){ ! if (pfnCloseEncryptedFileRaw && ctxt) (*pfnCloseEncryptedFileRaw)(ctxt); } *************** *** 4068,4080 **** CHECK_PFN(CloseEncryptedFileRaw); PyObject *obctxt; - PVOID ctxt; if (!PyArg_ParseTuple(args, "O:CloseEncryptedFileRaw", &obctxt)) // @pyparm PyCObject|Context||Context object returned from <om win32file.OpenEncryptedFileRaw> return NULL; ! ctxt=PyCObject_AsVoidPtr(obctxt); ! if (ctxt==NULL) ! return NULL; // function has no return value, make sure to check for memory leaks! ! (*pfnCloseEncryptedFileRaw)(ctxt); Py_INCREF(Py_None); return Py_None; --- 4085,4106 ---- CHECK_PFN(CloseEncryptedFileRaw); PyObject *obctxt; if (!PyArg_ParseTuple(args, "O:CloseEncryptedFileRaw", &obctxt)) // @pyparm PyCObject|Context||Context object returned from <om win32file.OpenEncryptedFileRaw> return NULL; ! // We must nuke our ctxt in the CObject afer closing, else when the ! // object destructs and we attempt to close it a second time, Vista x64 ! // crashes. ! // So must bypass the CObject API for this. ! 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); ! PyCObject *pcobj = (PyCObject *)obctxt; ! if (pcobj->destructor != encryptedfilecontextdestructor) ! return PyErr_Format(PyExc_TypeError, "param must be handle to an encrypted file (got a CObject with invalid destructor)"); ! if (!pcobj->cobject) ! return PyErr_Format(PyExc_ValueError, "This handle has already been closed"); ! // ok - close it, then nuke it. // function has no return value, make sure to check for memory leaks! ! (*pfnCloseEncryptedFileRaw)(pcobj->cobject); ! pcobj->cobject = 0; Py_INCREF(Py_None); return Py_None; |
From: Mark H. <mha...@us...> - 2008-11-25 22:26:19
|
Update of /cvsroot/pywin32/pywin32/com/TestSources/PyCOMTest In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv19421/PyCOMTest Modified Files: PyCOMTest.dsp Log Message: Build test COM object using a static copy of the CRT to help move the binary to different machines. Index: PyCOMTest.dsp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/TestSources/PyCOMTest/PyCOMTest.dsp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyCOMTest.dsp 25 Apr 2004 04:10:48 -0000 1.2 --- PyCOMTest.dsp 25 Nov 2008 22:26:07 -0000 1.3 *************** *** 46,50 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_MBCS" /Yu"stdafx.h" /c ! # ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /Yu"preconn.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 --- 46,50 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_MBCS" /Yu"stdafx.h" /c ! # ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /Yu"preconn.h" /FD /c # ADD BASE MTL /nologo /D "NDEBUG" /win32 # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 *************** *** 60,65 **** # Begin Custom Build OutDir=.\..\Build\Release ! TargetPath=\src\pythonex\com\TestSources\Build\Release\PyCOMTest.dll ! InputPath=\src\pythonex\com\TestSources\Build\Release\PyCOMTest.dll SOURCE="$(InputPath)" --- 60,65 ---- # Begin Custom Build OutDir=.\..\Build\Release ! TargetPath=\src\pywin32\com\TestSources\Build\Release\PyCOMTest.dll ! InputPath=\src\pywin32\com\TestSources\Build\Release\PyCOMTest.dll SOURCE="$(InputPath)" *************** *** 83,87 **** # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_MBCS" /Yu"stdafx.h" /c ! # ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /Yu"preconn.h" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 --- 83,87 ---- # PROP Target_Dir "" # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_WINDLL" /D "_MBCS" /Yu"stdafx.h" /c ! # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "_WINDLL" /D "_AFXDLL" /D "_MBCS" /Yu"preconn.h" /FD /c # ADD BASE MTL /nologo /D "_DEBUG" /win32 # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 *************** *** 96,101 **** # Begin Custom Build OutDir=.\..\Build\Debug ! TargetPath=\src\pythonex\com\TestSources\Build\Debug\PyCOMTest.dll ! InputPath=\src\pythonex\com\TestSources\Build\Debug\PyCOMTest.dll SOURCE="$(InputPath)" --- 96,101 ---- # Begin Custom Build OutDir=.\..\Build\Debug ! TargetPath=\src\pywin32\com\TestSources\Build\Debug\PyCOMTest.dll ! InputPath=\src\pywin32\com\TestSources\Build\Debug\PyCOMTest.dll SOURCE="$(InputPath)" *************** *** 132,137 **** # Begin Custom Build OutDir=.\..\Build\ReleaseU ! TargetPath=\src\pythonex\com\TestSources\Build\ReleaseU\PyCOMTest.dll ! InputPath=\src\pythonex\com\TestSources\Build\ReleaseU\PyCOMTest.dll SOURCE="$(InputPath)" --- 132,137 ---- # Begin Custom Build OutDir=.\..\Build\ReleaseU ! TargetPath=\src\pywin32\com\TestSources\Build\ReleaseU\PyCOMTest.dll ! InputPath=\src\pywin32\com\TestSources\Build\ReleaseU\PyCOMTest.dll SOURCE="$(InputPath)" *************** *** 168,173 **** # Begin Custom Build OutDir=.\..\Build\DebugU ! TargetPath=\src\pythonex\com\TestSources\Build\DebugU\PyCOMTest.dll ! InputPath=\src\pythonex\com\TestSources\Build\DebugU\PyCOMTest.dll SOURCE="$(InputPath)" --- 168,173 ---- # Begin Custom Build OutDir=.\..\Build\DebugU ! TargetPath=\src\pywin32\com\TestSources\Build\DebugU\PyCOMTest.dll ! InputPath=\src\pywin32\com\TestSources\Build\DebugU\PyCOMTest.dll SOURCE="$(InputPath)" |
From: Mark H. <mha...@us...> - 2008-11-24 22:21:59
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32229/test Modified Files: testAXScript.py testPippo.py testPyComTest.py testServers.py util.py Log Message: Make the COM test suite friendlier when run under Vista Index: testAXScript.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testAXScript.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** testAXScript.py 10 Nov 2003 00:49:29 -0000 1.7 --- testAXScript.py 24 Nov 2008 22:21:48 -0000 1.8 *************** *** 15,19 **** from util import RegisterPythonServer self.verbose = verbose ! RegisterPythonServer(file, self.verbose) def testHost(self): --- 15,19 ---- from util import RegisterPythonServer self.verbose = verbose ! RegisterPythonServer(file, 'python', verbose=self.verbose) def testHost(self): Index: testPippo.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testPippo.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** testPippo.py 3 Jun 2007 13:27:02 -0000 1.4 --- testPippo.py 24 Nov 2008 22:21:48 -0000 1.5 *************** *** 7,13 **** class PippoTester(unittest.TestCase): def setUp(self): ! # register the server import pippo_server ! pippo_server.main([pippo_server.__file__]) # create it. self.object = Dispatch("Python.Test.Pippo") --- 7,13 ---- class PippoTester(unittest.TestCase): def setUp(self): ! from win32com.test.util import RegisterPythonServer import pippo_server ! RegisterPythonServer(pippo_server.__file__, "Python.Test.Pippo") # create it. self.object = Dispatch("Python.Test.Pippo") Index: util.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/util.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** util.py 11 Nov 2008 01:02:51 -0000 1.10 --- util.py 24 Nov 2008 22:21:48 -0000 1.11 *************** *** 1,3 **** --- 1,4 ---- import sys, os + import _winreg import win32api import tempfile *************** *** 22,26 **** print "Warning - %d com gateway objects still alive" % c ! def RegisterPythonServer(filename, verbose=0): cmd = '%s "%s" --unattended > nul 2>&1' % (win32api.GetModuleFileName(0), filename) if verbose: --- 23,71 ---- print "Warning - %d com gateway objects still alive" % c ! def RegisterPythonServer(filename, progids=None, verbose=0): ! if progids: ! if isinstance(progids, basestring): ! progids = [progids] ! # we know the CLSIDs we need, but we might not be an admin user ! # and otherwise unable to register them. So as long as the progids ! # exist and the DLL points at our version, assume it already is. ! why_not = None ! for progid in progids: ! try: ! clsid = pythoncom.MakeIID(progid) ! except pythoncom.com_error: ! # no progid - not registered. ! break ! # have a CLSID - open it. ! try: ! hk = _winreg.OpenKey(_winreg.HKEY_CLASSES_ROOT, "CLSID\\%s" % clsid) ! dll = _winreg.QueryValue(hk, "InprocServer32") ! except WindowsError: ! # no CLSID or InProcServer32 - not good! ! break ! if os.path.basename(dll) != os.path.basename(pythoncom.__file__): ! why_not = "%r is registered against a different Python version (%s)" % (progid, dll) ! break ! else: ! #print "Skipping registration of '%s' - already registered" % filename ! return ! # needs registration - see if its likely! ! try: ! from win32com.shell.shell import IsUserAnAdmin ! except ImportError: ! print "Can't import win32com.shell - no idea if you are an admin or not?" ! is_admin = False ! else: ! try: ! is_admin = IsUserAnAdmin() ! except pythoncom.com_error: ! # old, less-secure OS - assume *is* admin. ! is_admin = True ! if not is_admin: ! msg = "%r isn't registered, but I'm not an administrator who can register it." % progids[0] ! if why_not: ! msg += "\n(registration check failed as %s)" % why_not ! raise RuntimeError(msg) ! # so theoretically we are able to register it. cmd = '%s "%s" --unattended > nul 2>&1' % (win32api.GetModuleFileName(0), filename) if verbose: Index: testServers.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testServers.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** testServers.py 4 May 2004 07:01:44 -0000 1.5 --- testServers.py 24 Nov 2008 22:21:48 -0000 1.6 *************** *** 11,17 **** def setUp(self): # Ensure the correct version registered. ! from win32com.servers.interp import Interpreter ! import win32com.server.register ! win32com.server.register.RegisterClasses(Interpreter, quiet=1) def _testInterp(self, interp): --- 11,17 ---- def setUp(self): # Ensure the correct version registered. ! from win32com.test.util import RegisterPythonServer ! from win32com.servers import interp ! RegisterPythonServer(interp.__file__, "Python.Interpreter") def _testInterp(self, interp): Index: testPyComTest.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testPyComTest.py,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** testPyComTest.py 1 Jul 2008 00:11:57 -0000 1.32 --- testPyComTest.py 24 Nov 2008 22:21:48 -0000 1.33 *************** *** 15,19 **** # This test uses a Python implemented COM server - ensure correctly registered. ! RegisterPythonServer(os.path.join(os.path.dirname(__file__), '..', "servers", "test_pycomtest.py")) from win32com.client import gencache --- 15,20 ---- # This test uses a Python implemented COM server - ensure correctly registered. ! RegisterPythonServer(os.path.join(os.path.dirname(__file__), '..', "servers", "test_pycomtest.py"), ! "PyCOMTest.PyCOMTest") from win32com.client import gencache |
From: Mark H. <mha...@us...> - 2008-11-24 06:14:40
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/internet/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7699/com/win32comext/internet/src Modified Files: Tag: py3k PyIInternetSecurityManager.cpp Log Message: integrate some trunk changes Index: PyIInternetSecurityManager.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/internet/src/PyIInternetSecurityManager.cpp,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** PyIInternetSecurityManager.cpp 10 Nov 2008 03:19:56 -0000 1.1.2.3 --- PyIInternetSecurityManager.cpp 24 Nov 2008 06:14:33 -0000 1.1.2.4 *************** *** 132,153 **** // @pyparm <o unicode>|pwszUrl||Description for pwszUrl // @pyparm int|dwAction||Description for dwAction // @pyparm int|dwFlags||Description for dwFlags PyObject *obpwszUrl; LPWSTR pwszUrl; DWORD dwAction; ! PyObject *obContext; DWORD dwFlags; ! if ( !PyArg_ParseTuple(args, "OlOl:ProcessUrlAction", &obpwszUrl, &dwAction, &obContext, &dwFlags) ) return NULL; BOOL bPythonIsHappy = TRUE; ! IID context; ! if (bPythonIsHappy && !PyWinObject_AsBstr(obpwszUrl, &pwszUrl)) bPythonIsHappy = FALSE; ! if (bPythonIsHappy && !PyWinObject_AsIID(obContext, &context)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) return NULL; DWORD dwPolicy = 0; HRESULT hr; PY_INTERFACE_PRECALL; ! hr = pIISM->ProcessUrlAction( pwszUrl, dwAction, (BYTE *)&dwPolicy, sizeof(dwPolicy), (BYTE *)&context, sizeof(context), dwFlags, 0); ! SysFreeString(pwszUrl); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) --- 132,153 ---- // @pyparm <o unicode>|pwszUrl||Description for pwszUrl // @pyparm int|dwAction||Description for dwAction + // @pyparm bytes|context|| // @pyparm int|dwFlags||Description for dwFlags PyObject *obpwszUrl; LPWSTR pwszUrl; DWORD dwAction; ! char *context; ! Py_ssize_t cbcontext; DWORD dwFlags; ! if ( !PyArg_ParseTuple(args, "Olz#l:ProcessUrlAction", &obpwszUrl, &dwAction, &context, &cbcontext, &dwFlags) ) return NULL; BOOL bPythonIsHappy = TRUE; ! if (!PyWinObject_AsWCHAR(obpwszUrl, &pwszUrl)) ! return NULL; DWORD dwPolicy = 0; HRESULT hr; PY_INTERFACE_PRECALL; ! hr = pIISM->ProcessUrlAction( pwszUrl, dwAction, (BYTE *)&dwPolicy, sizeof(dwPolicy), (BYTE *)context, cbcontext, dwFlags, 0); ! PyWinObject_FreeWCHAR(pwszUrl); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) *************** *** 359,372 **** PyObject *obContext; obpwszUrl = MakeOLECHARToObj(pwszUrl); ! if (cbContext==0 || pContext==NULL) { ! obContext = Py_None; ! Py_INCREF(Py_None); ! } else if (cbContext==sizeof(GUID)) ! obContext = PyWinObject_FromIID(*((IID *)pContext)); ! else { ! PyCom_LoggerWarning(NULL, "PyGInternetSecurityManager::ProcessUrlAction has %d bytes for context - what is that?", cbContext); obContext = Py_None; Py_INCREF(Py_None); ! } PyObject *result; HRESULT hr=InvokeViaPolicy("ProcessUrlAction", &result, "OlOll", obpwszUrl, dwAction, obContext, dwFlags, dwReserved); --- 359,370 ---- PyObject *obContext; obpwszUrl = MakeOLECHARToObj(pwszUrl); ! // pContext is documented as being a GUID - but markh has seen IE ! // call this with 78 and 54 bytes in some unusual cases. So ! // just use 'bytes' and the Python code must use magic to get a GUID. ! if (pContext==NULL) { obContext = Py_None; Py_INCREF(Py_None); ! } else ! obContext = PyString_FromStringAndSize((char *)pContext, cbContext); PyObject *result; HRESULT hr=InvokeViaPolicy("ProcessUrlAction", &result, "OlOll", obpwszUrl, dwAction, obContext, dwFlags, dwReserved); |
From: Mark H. <mha...@us...> - 2008-11-24 06:14:39
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7699/Pythonwin/pywin/tools Modified Files: Tag: py3k browser.py Log Message: integrate some trunk changes Index: browser.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools/browser.py,v retrieving revision 1.10.2.2 retrieving revision 1.10.2.3 diff -C2 -d -r1.10.2.2 -r1.10.2.3 *** browser.py 31 Aug 2008 18:15:01 -0000 1.10.2.2 --- browser.py 24 Nov 2008 06:14:33 -0000 1.10.2.3 *************** *** 7,11 **** # >>> browser.Browse(your_module) import __main__ - import string import win32ui from pywin.mfc import dialog --- 7,10 ---- |
From: Mark H. <mha...@us...> - 2008-11-24 06:14:38
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7699/com/win32comext/shell/src Modified Files: Tag: py3k PyIContextMenu.cpp PyICopyHook.cpp PyICopyHook.h shell.cpp Log Message: integrate some trunk changes Index: PyIContextMenu.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIContextMenu.cpp,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** PyIContextMenu.cpp 7 Aug 2008 07:41:33 -0000 1.7 --- PyIContextMenu.cpp 24 Nov 2008 06:14:33 -0000 1.7.2.1 *************** *** 93,100 **** // @pyparm int|uType||One of the shellcon.GCS_* constants // @pyparm int|cchMax|2048|Size of buffer to create for returned string ! UINT idCmd; UINT uType; UINT cchMax = 2048; ! if ( !PyArg_ParseTuple(args, "II|I:GetCommandString", &idCmd, &uType, &cchMax) ) return NULL; --- 93,104 ---- // @pyparm int|uType||One of the shellcon.GCS_* constants // @pyparm int|cchMax|2048|Size of buffer to create for returned string ! PyObject *obCmd; UINT uType; UINT cchMax = 2048; ! if ( !PyArg_ParseTuple(args, "OI|I:GetCommandString", &obCmd, &uType, &cchMax) ) ! return NULL; ! ! UINT_PTR idCmd; ! if (!PyWinLong_AsULONG_PTR(obCmd, (ULONG_PTR *)&idCmd)) return NULL; Index: PyICopyHook.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyICopyHook.cpp,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** PyICopyHook.cpp 3 Jun 2007 14:53:07 -0000 1.4 --- PyICopyHook.cpp 24 Nov 2008 06:14:33 -0000 1.4.2.1 *************** *** 1,3 **** ! // This file implements the ICopyHook Interface and Gateway for Python. // Generated by makegw.py --- 1,4 ---- ! // This file implements the ICopyHookA and ICopyHookW interfaces and ! // Gateways for Python. // Generated by makegw.py *************** *** 10,14 **** // Interface Implementation ! PyICopyHook::PyICopyHook(IUnknown *pdisp): PyIUnknown(pdisp) { --- 11,15 ---- // Interface Implementation ! PyICopyHookA::PyICopyHookA(IUnknown *pdisp): PyIUnknown(pdisp) { *************** *** 16,32 **** } ! PyICopyHook::~PyICopyHook() { } ! /* static */ ICopyHook *PyICopyHook::GetI(PyObject *self) { ! return (ICopyHook *)PyIUnknown::GetI(self); } ! // @pymethod |PyICopyHook|CopyCallback|Description of CopyCallback. ! PyObject *PyICopyHook::CopyCallback(PyObject *self, PyObject *args) { ! ICopyHook *pICH = GetI(self); if ( pICH == NULL ) return NULL; --- 17,33 ---- } ! PyICopyHookA::~PyICopyHookA() { } ! /* static */ ICopyHookA *PyICopyHookA::GetI(PyObject *self) { ! return (ICopyHookA *)PyIUnknown::GetI(self); } ! // @pymethod |PyICopyHookA|CopyCallback|Description of CopyCallback. ! PyObject *PyICopyHookA::CopyCallback(PyObject *self, PyObject *args) { ! ICopyHookA *pICH = GetI(self); if ( pICH == NULL ) return NULL; *************** *** 44,50 **** UINT wFunc; UINT wFlags; ! LPTSTR srcFile; DWORD srcAttribs; ! LPTSTR destFile; DWORD destAttribs; if ( !PyArg_ParseTuple(args, "OiiOlOl:CopyCallback", &obhwnd, &wFunc, &wFlags, &obsrcFile, &srcAttribs, &obdestFile, &destAttribs) ) --- 45,51 ---- UINT wFunc; UINT wFlags; ! LPSTR srcFile; DWORD srcAttribs; ! LPSTR destFile; DWORD destAttribs; if ( !PyArg_ParseTuple(args, "OiiOlOl:CopyCallback", &obhwnd, &wFunc, &wFlags, &obsrcFile, &srcAttribs, &obdestFile, &destAttribs) ) *************** *** 53,64 **** return NULL; BOOL bPythonIsHappy = TRUE; ! if (bPythonIsHappy && !PyWinObject_AsTCHAR(obsrcFile, &srcFile)) bPythonIsHappy = FALSE; ! if (bPythonIsHappy && !PyWinObject_AsTCHAR(obdestFile, &destFile)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pICH->CopyCallback( hwnd, wFunc, wFlags, srcFile, srcAttribs, destFile, destAttribs ); ! PyWinObject_FreeTCHAR(srcFile); ! PyWinObject_FreeTCHAR(destFile); PY_INTERFACE_POSTCALL; --- 54,65 ---- return NULL; BOOL bPythonIsHappy = TRUE; ! if (bPythonIsHappy && !PyWinObject_AsString(obsrcFile, &srcFile)) bPythonIsHappy = FALSE; ! if (bPythonIsHappy && !PyWinObject_AsString(obdestFile, &destFile)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pICH->CopyCallback( hwnd, wFunc, wFlags, srcFile, srcAttribs, destFile, destAttribs ); ! PyWinObject_FreeString(srcFile); ! PyWinObject_FreeString(destFile); PY_INTERFACE_POSTCALL; *************** *** 71,113 **** } ! // @object PyICopyHook|Description of the interface ! static struct PyMethodDef PyICopyHook_methods[] = { ! { "CopyCallback", PyICopyHook::CopyCallback, 1 }, // @pymeth CopyCallback|Description of CopyCallback { NULL } }; ! PyComTypeObject PyICopyHook::type("PyICopyHook", &PyIUnknown::type, ! sizeof(PyICopyHook), ! PyICopyHook_methods, ! GET_PYCOM_CTOR(PyICopyHook)); // --------------------------------------------------- // // Gateway Implementation ! STDMETHODIMP_(UINT) PyGCopyHook::CopyCallback( /* [unique][in] */ HWND hwnd, /* [unique][in] */ UINT wFunc, /* [unique][in] */ UINT wFlags, ! /* [unique][in] */ LPCTSTR srcFile, /* [unique][in] */ DWORD srcAttribs, ! /* [unique][in] */ LPCTSTR destFile, /* [unique][in] */ DWORD destAttribs) { PY_GATEWAY_METHOD; PyObject *obsrcFile; PyObject *obdestFile; ! obsrcFile = PyWinObject_FromTCHAR((LPTSTR)srcFile); ! // Dest file can be NULL for FO_DELETE ! if (destFile!=NULL) ! obdestFile = PyWinObject_FromTCHAR((LPTSTR)destFile); ! else{ ! obdestFile=Py_None; ! Py_INCREF(Py_None); ! } PyObject *result; ! HRESULT hr=InvokeViaPolicy("CopyCallback", &result, "NiiOlOl", PyWinLong_FromHANDLE(hwnd), wFunc, wFlags, obsrcFile, srcAttribs, obdestFile, destAttribs); ! Py_XDECREF(obsrcFile); ! Py_XDECREF(obdestFile); if (FAILED(hr)) return hr; hr = PyInt_AsLong(result); --- 72,206 ---- } ! // @object PyICopyHookA|Description of the interface ! static struct PyMethodDef PyICopyHookA_methods[] = { ! { "CopyCallback", PyICopyHookA::CopyCallback, 1 }, // @pymeth CopyCallback|Description of CopyCallback { NULL } }; ! PyComTypeObject PyICopyHookA::type("PyICopyHookA", &PyIUnknown::type, ! sizeof(PyICopyHookA), ! PyICopyHookA_methods, ! GET_PYCOM_CTOR(PyICopyHookA)); // --------------------------------------------------- // // Gateway Implementation ! STDMETHODIMP_(UINT) PyGCopyHookA::CopyCallback( /* [unique][in] */ HWND hwnd, /* [unique][in] */ UINT wFunc, /* [unique][in] */ UINT wFlags, ! /* [unique][in] */ LPCSTR srcFile, /* [unique][in] */ DWORD srcAttribs, ! /* [unique][in] */ LPCSTR destFile, /* [unique][in] */ DWORD destAttribs) { PY_GATEWAY_METHOD; + PyObject *result; + HRESULT hr=InvokeViaPolicy("CopyCallback", &result, "Niizlzl", PyWinLong_FromHANDLE(hwnd), wFunc, wFlags, srcFile, srcAttribs, destFile, destAttribs); + if (FAILED(hr)) return hr; + hr = PyInt_AsLong(result); + if ((hr==-1) && PyErr_Occurred()) + hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("CopyCallBack"); + Py_DECREF(result); + return hr; + } + + // ICopyHookW + PyICopyHookW::PyICopyHookW(IUnknown *pdisp): + PyIUnknown(pdisp) + { + ob_type = &type; + } + + PyICopyHookW::~PyICopyHookW() + { + } + + /* static */ ICopyHookW *PyICopyHookW::GetI(PyObject *self) + { + return (ICopyHookW *)PyIUnknown::GetI(self); + } + + // @pymethod |PyICopyHookW|CopyCallback|Description of CopyCallback. + PyObject *PyICopyHookW::CopyCallback(PyObject *self, PyObject *args) + { + ICopyHookW *pICH = GetI(self); + if ( pICH == NULL ) + return NULL; + // @pyparm HWND|hwnd||Description for hwnd + // @pyparm int|wFunc||Description for wFunc + // @pyparm int|wFlags||Description for wFlags + // @pyparm string/<o unicode>|srcFile||Description for srcFile + // @pyparm int|srcAttribs||Description for srcAttribs + // @pyparm string/<o unicode>|destFile||Description for destFile + // @pyparm int|destAttribs||Description for destAttribs PyObject *obsrcFile; PyObject *obdestFile; ! HWND hwnd; ! PyObject *obhwnd; ! UINT wFunc; ! UINT wFlags; ! LPWSTR srcFile; ! DWORD srcAttribs; ! LPWSTR destFile; ! DWORD destAttribs; ! if ( !PyArg_ParseTuple(args, "OiiOlOl:CopyCallback", &obhwnd, &wFunc, &wFlags, &obsrcFile, &srcAttribs, &obdestFile, &destAttribs) ) ! return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) ! return NULL; ! BOOL bPythonIsHappy = TRUE; ! if (bPythonIsHappy && !PyWinObject_AsWCHAR(obsrcFile, &srcFile)) bPythonIsHappy = FALSE; ! if (bPythonIsHappy && !PyWinObject_AsWCHAR(obdestFile, &destFile)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) return NULL; ! HRESULT hr; ! PY_INTERFACE_PRECALL; ! hr = pICH->CopyCallback( hwnd, wFunc, wFlags, srcFile, srcAttribs, destFile, destAttribs ); ! PyWinObject_FreeWCHAR(srcFile); ! PyWinObject_FreeWCHAR(destFile); ! ! PY_INTERFACE_POSTCALL; ! ! if ( FAILED(hr) ) ! return PyCom_BuildPyException(hr, pICH, IID_IShellCopyHook ); ! Py_INCREF(Py_None); ! return Py_None; ! ! } ! ! // @object PyICopyHookW|Description of the interface ! static struct PyMethodDef PyICopyHookW_methods[] = ! { ! { "CopyCallback", PyICopyHookW::CopyCallback, 1 }, // @pymeth CopyCallback|Description of CopyCallback ! { NULL } ! }; ! ! PyComTypeObject PyICopyHookW::type("PyICopyHookW", ! &PyIUnknown::type, ! sizeof(PyICopyHookW), ! PyICopyHookW_methods, ! GET_PYCOM_CTOR(PyICopyHookW)); ! // --------------------------------------------------- ! // ! // Gateway Implementation ! STDMETHODIMP_(UINT) PyGCopyHookW::CopyCallback( ! /* [unique][in] */ HWND hwnd, ! /* [unique][in] */ UINT wFunc, ! /* [unique][in] */ UINT wFlags, ! /* [unique][in] */ LPCWSTR srcFile, ! /* [unique][in] */ DWORD srcAttribs, ! /* [unique][in] */ LPCWSTR destFile, ! /* [unique][in] */ DWORD destAttribs) ! { ! PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy("CopyCallback", &result, "NiiNlNl", ! PyWinLong_FromHANDLE(hwnd), ! wFunc, ! wFlags, ! PyWinObject_FromWCHAR(srcFile), ! srcAttribs, ! PyWinObject_FromWCHAR(destFile), ! destAttribs); if (FAILED(hr)) return hr; hr = PyInt_AsLong(result); Index: PyICopyHook.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyICopyHook.h,v retrieving revision 1.1 retrieving revision 1.1.4.1 diff -C2 -d -r1.1 -r1.1.4.1 *** PyICopyHook.h 7 Oct 2003 05:13:22 -0000 1.1 --- PyICopyHook.h 24 Nov 2008 06:14:33 -0000 1.1.4.1 *************** *** 5,13 **** // Interface Declaration ! class PyICopyHook : public PyIUnknown { public: ! MAKE_PYCOM_CTOR(PyICopyHook); ! static ICopyHook *GetI(PyObject *self); static PyComTypeObject type; --- 5,13 ---- // Interface Declaration ! class PyICopyHookA : public PyIUnknown { public: ! MAKE_PYCOM_CTOR(PyICopyHookA); ! static ICopyHookA *GetI(PyObject *self); static PyComTypeObject type; *************** *** 16,31 **** protected: ! PyICopyHook(IUnknown *pdisp); ! ~PyICopyHook(); }; // --------------------------------------------------- // // Gateway Declaration ! class PyGCopyHook : public PyGatewayBase, public ICopyHook { protected: ! PyGCopyHook(PyObject *instance) : PyGatewayBase(instance) { ; } ! PYGATEWAY_MAKE_SUPPORT2(PyGCopyHook, ICopyHook, IID_IShellCopyHook, PyGatewayBase) // ICopyHook --- 16,47 ---- protected: ! PyICopyHookA(IUnknown *pdisp); ! ~PyICopyHookA(); ! }; ! ! class PyICopyHookW : public PyIUnknown ! { ! public: ! MAKE_PYCOM_CTOR(PyICopyHookW); ! static ICopyHookW *GetI(PyObject *self); ! static PyComTypeObject type; ! ! // The Python methods ! static PyObject *CopyCallback(PyObject *self, PyObject *args); ! ! protected: ! PyICopyHookW(IUnknown *pdisp); ! ~PyICopyHookW(); }; + // --------------------------------------------------- // // Gateway Declaration ! class PyGCopyHookA : public PyGatewayBase, public ICopyHookA { protected: ! PyGCopyHookA(PyObject *instance) : PyGatewayBase(instance) { ; } ! PYGATEWAY_MAKE_SUPPORT2(PyGCopyHookA, ICopyHookA, IID_IShellCopyHookA, PyGatewayBase) // ICopyHook *************** *** 34,41 **** UINT wFunc, UINT wFlags, ! LPCTSTR srcFile, DWORD srcAttribs, ! LPCTSTR destFile, DWORD destAttribs); }; --- 50,73 ---- UINT wFunc, UINT wFlags, ! LPCSTR srcFile, DWORD srcAttribs, ! LPCSTR destFile, DWORD destAttribs); + }; + + class PyGCopyHookW : public PyGatewayBase, public ICopyHookW + { + protected: + PyGCopyHookW(PyObject *instance) : PyGatewayBase(instance) { ; } + PYGATEWAY_MAKE_SUPPORT2(PyGCopyHookW, ICopyHookW, IID_IShellCopyHookW, PyGatewayBase) + // ICopyHook + STDMETHOD_(UINT, CopyCallback)( + HWND hwnd, + UINT wFunc, + UINT wFlags, + LPCWSTR srcFile, + DWORD srcAttribs, + LPCWSTR destFile, + DWORD destAttribs); }; Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.68.2.3 retrieving revision 1.68.2.4 diff -C2 -d -r1.68.2.3 -r1.68.2.4 *** shell.cpp 2 Nov 2008 12:43:47 -0000 1.68.2.3 --- shell.cpp 24 Nov 2008 06:14:33 -0000 1.68.2.4 *************** *** 3284,3290 **** PYCOM_INTERFACE_CLIENT_ONLY(ExplorerPaneVisibility), PYCOM_INTERFACE_CLIENT_ONLY(NameSpaceTreeControl), ! // IID_ICopyHook doesn't exist - hack it up ! { &IID_IShellCopyHook, "IShellCopyHook", "IID_IShellCopyHook", &PyICopyHook::type, GET_PYGATEWAY_CTOR(PyGCopyHook) }, ! { &IID_IShellCopyHook, "ICopyHook", "IID_ICopyHook", NULL, NULL }, PYCOM_INTERFACE_FULL(ShellItem), PYCOM_INTERFACE_FULL(ShellItemArray), --- 3284,3295 ---- PYCOM_INTERFACE_CLIENT_ONLY(ExplorerPaneVisibility), PYCOM_INTERFACE_CLIENT_ONLY(NameSpaceTreeControl), ! PYCOM_INTERFACE_FULL(ExplorerCommand), ! PYCOM_INTERFACE_FULL(CopyHookA), ! PYCOM_INTERFACE_FULL(CopyHookW), ! // For b/w compat, Add IID_ICopyHook as IID_CopyHookA ! { &IID_ICopyHookA, "ICopyHook", "IID_ICopyHook", NULL, NULL }, ! PYCOM_INTERFACE_IID_ONLY(ShellCopyHookA), ! PYCOM_INTERFACE_IID_ONLY(ShellCopyHookW), ! PYCOM_INTERFACE_IID_ONLY(ShellCopyHook), PYCOM_INTERFACE_FULL(ShellItem), PYCOM_INTERFACE_FULL(ShellItemArray), |
From: Mark H. <mha...@us...> - 2008-11-24 06:14:38
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7699 Modified Files: Tag: py3k setup.py Log Message: integrate some trunk changes Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.81.2.4 retrieving revision 1.81.2.5 diff -C2 -d -r1.81.2.4 -r1.81.2.5 *** setup.py 2 Nov 2008 11:52:02 -0000 1.81.2.4 --- setup.py 24 Nov 2008 06:14:33 -0000 1.81.2.5 *************** *** 1707,1713 **** PythonEng.cpp StdAfx.cpp Utils.cpp """.split()], depends=[os.path.join("isapi", "src", s) for s in """ControlBlock.h FilterContext.h PyExtensionObjects.h ! PyFilterObjects.h pyISAPI.h pyISAPI_messages.h PythonEng.h StdAfx.h Utils.h """.split()], --- 1707,1717 ---- PythonEng.cpp StdAfx.cpp Utils.cpp """.split()], + # We keep pyISAPI_messages.h out of the depends list, as it is + # generated and we aren't smart enough to say *only* the .cpp etc + # depend on it - so the generated .h says the .mc needs to be + # rebuilt, which re-creates the .h... depends=[os.path.join("isapi", "src", s) for s in """ControlBlock.h FilterContext.h PyExtensionObjects.h ! PyFilterObjects.h pyISAPI.h PythonEng.h StdAfx.h Utils.h """.split()], |
From: Mark H. <mha...@us...> - 2008-11-24 06:10:15
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7417/com/win32comext/shell/src Modified Files: PyICopyHook.cpp PyICopyHook.h shell.cpp Log Message: Add ICopyHookW support. Index: PyICopyHook.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyICopyHook.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyICopyHook.cpp 3 Jun 2007 14:53:07 -0000 1.4 --- PyICopyHook.cpp 24 Nov 2008 06:10:08 -0000 1.5 *************** *** 1,3 **** ! // This file implements the ICopyHook Interface and Gateway for Python. // Generated by makegw.py --- 1,4 ---- ! // This file implements the ICopyHookA and ICopyHookW interfaces and ! // Gateways for Python. // Generated by makegw.py *************** *** 10,14 **** // Interface Implementation ! PyICopyHook::PyICopyHook(IUnknown *pdisp): PyIUnknown(pdisp) { --- 11,15 ---- // Interface Implementation ! PyICopyHookA::PyICopyHookA(IUnknown *pdisp): PyIUnknown(pdisp) { *************** *** 16,32 **** } ! PyICopyHook::~PyICopyHook() { } ! /* static */ ICopyHook *PyICopyHook::GetI(PyObject *self) { ! return (ICopyHook *)PyIUnknown::GetI(self); } ! // @pymethod |PyICopyHook|CopyCallback|Description of CopyCallback. ! PyObject *PyICopyHook::CopyCallback(PyObject *self, PyObject *args) { ! ICopyHook *pICH = GetI(self); if ( pICH == NULL ) return NULL; --- 17,33 ---- } ! PyICopyHookA::~PyICopyHookA() { } ! /* static */ ICopyHookA *PyICopyHookA::GetI(PyObject *self) { ! return (ICopyHookA *)PyIUnknown::GetI(self); } ! // @pymethod |PyICopyHookA|CopyCallback|Description of CopyCallback. ! PyObject *PyICopyHookA::CopyCallback(PyObject *self, PyObject *args) { ! ICopyHookA *pICH = GetI(self); if ( pICH == NULL ) return NULL; *************** *** 44,50 **** UINT wFunc; UINT wFlags; ! LPTSTR srcFile; DWORD srcAttribs; ! LPTSTR destFile; DWORD destAttribs; if ( !PyArg_ParseTuple(args, "OiiOlOl:CopyCallback", &obhwnd, &wFunc, &wFlags, &obsrcFile, &srcAttribs, &obdestFile, &destAttribs) ) --- 45,51 ---- UINT wFunc; UINT wFlags; ! LPSTR srcFile; DWORD srcAttribs; ! LPSTR destFile; DWORD destAttribs; if ( !PyArg_ParseTuple(args, "OiiOlOl:CopyCallback", &obhwnd, &wFunc, &wFlags, &obsrcFile, &srcAttribs, &obdestFile, &destAttribs) ) *************** *** 53,64 **** return NULL; BOOL bPythonIsHappy = TRUE; ! if (bPythonIsHappy && !PyWinObject_AsTCHAR(obsrcFile, &srcFile)) bPythonIsHappy = FALSE; ! if (bPythonIsHappy && !PyWinObject_AsTCHAR(obdestFile, &destFile)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pICH->CopyCallback( hwnd, wFunc, wFlags, srcFile, srcAttribs, destFile, destAttribs ); ! PyWinObject_FreeTCHAR(srcFile); ! PyWinObject_FreeTCHAR(destFile); PY_INTERFACE_POSTCALL; --- 54,65 ---- return NULL; BOOL bPythonIsHappy = TRUE; ! if (bPythonIsHappy && !PyWinObject_AsString(obsrcFile, &srcFile)) bPythonIsHappy = FALSE; ! if (bPythonIsHappy && !PyWinObject_AsString(obdestFile, &destFile)) bPythonIsHappy = FALSE; if (!bPythonIsHappy) return NULL; HRESULT hr; PY_INTERFACE_PRECALL; hr = pICH->CopyCallback( hwnd, wFunc, wFlags, srcFile, srcAttribs, destFile, destAttribs ); ! PyWinObject_FreeString(srcFile); ! PyWinObject_FreeString(destFile); PY_INTERFACE_POSTCALL; *************** *** 71,113 **** } ! // @object PyICopyHook|Description of the interface ! static struct PyMethodDef PyICopyHook_methods[] = { ! { "CopyCallback", PyICopyHook::CopyCallback, 1 }, // @pymeth CopyCallback|Description of CopyCallback { NULL } }; ! PyComTypeObject PyICopyHook::type("PyICopyHook", &PyIUnknown::type, ! sizeof(PyICopyHook), ! PyICopyHook_methods, ! GET_PYCOM_CTOR(PyICopyHook)); // --------------------------------------------------- // // Gateway Implementation ! STDMETHODIMP_(UINT) PyGCopyHook::CopyCallback( /* [unique][in] */ HWND hwnd, /* [unique][in] */ UINT wFunc, /* [unique][in] */ UINT wFlags, ! /* [unique][in] */ LPCTSTR srcFile, /* [unique][in] */ DWORD srcAttribs, ! /* [unique][in] */ LPCTSTR destFile, /* [unique][in] */ DWORD destAttribs) { PY_GATEWAY_METHOD; PyObject *obsrcFile; PyObject *obdestFile; ! obsrcFile = PyWinObject_FromTCHAR((LPTSTR)srcFile); ! // Dest file can be NULL for FO_DELETE ! if (destFile!=NULL) ! obdestFile = PyWinObject_FromTCHAR((LPTSTR)destFile); ! else{ ! obdestFile=Py_None; ! Py_INCREF(Py_None); ! } PyObject *result; ! HRESULT hr=InvokeViaPolicy("CopyCallback", &result, "NiiOlOl", PyWinLong_FromHANDLE(hwnd), wFunc, wFlags, obsrcFile, srcAttribs, obdestFile, destAttribs); ! Py_XDECREF(obsrcFile); ! Py_XDECREF(obdestFile); if (FAILED(hr)) return hr; hr = PyInt_AsLong(result); --- 72,206 ---- } ! // @object PyICopyHookA|Description of the interface ! static struct PyMethodDef PyICopyHookA_methods[] = { ! { "CopyCallback", PyICopyHookA::CopyCallback, 1 }, // @pymeth CopyCallback|Description of CopyCallback { NULL } }; ! PyComTypeObject PyICopyHookA::type("PyICopyHookA", &PyIUnknown::type, ! sizeof(PyICopyHookA), ! PyICopyHookA_methods, ! GET_PYCOM_CTOR(PyICopyHookA)); // --------------------------------------------------- // // Gateway Implementation ! STDMETHODIMP_(UINT) PyGCopyHookA::CopyCallback( /* [unique][in] */ HWND hwnd, /* [unique][in] */ UINT wFunc, /* [unique][in] */ UINT wFlags, ! /* [unique][in] */ LPCSTR srcFile, /* [unique][in] */ DWORD srcAttribs, ! /* [unique][in] */ LPCSTR destFile, /* [unique][in] */ DWORD destAttribs) { PY_GATEWAY_METHOD; + PyObject *result; + HRESULT hr=InvokeViaPolicy("CopyCallback", &result, "Niizlzl", PyWinLong_FromHANDLE(hwnd), wFunc, wFlags, srcFile, srcAttribs, destFile, destAttribs); + if (FAILED(hr)) return hr; + hr = PyInt_AsLong(result); + if ((hr==-1) && PyErr_Occurred()) + hr = MAKE_PYCOM_GATEWAY_FAILURE_CODE("CopyCallBack"); + Py_DECREF(result); + return hr; + } + + // ICopyHookW + PyICopyHookW::PyICopyHookW(IUnknown *pdisp): + PyIUnknown(pdisp) + { + ob_type = &type; + } + + PyICopyHookW::~PyICopyHookW() + { + } + + /* static */ ICopyHookW *PyICopyHookW::GetI(PyObject *self) + { + return (ICopyHookW *)PyIUnknown::GetI(self); + } + + // @pymethod |PyICopyHookW|CopyCallback|Description of CopyCallback. + PyObject *PyICopyHookW::CopyCallback(PyObject *self, PyObject *args) + { + ICopyHookW *pICH = GetI(self); + if ( pICH == NULL ) + return NULL; + // @pyparm HWND|hwnd||Description for hwnd + // @pyparm int|wFunc||Description for wFunc + // @pyparm int|wFlags||Description for wFlags + // @pyparm string/<o unicode>|srcFile||Description for srcFile + // @pyparm int|srcAttribs||Description for srcAttribs + // @pyparm string/<o unicode>|destFile||Description for destFile + // @pyparm int|destAttribs||Description for destAttribs PyObject *obsrcFile; PyObject *obdestFile; ! HWND hwnd; ! PyObject *obhwnd; ! UINT wFunc; ! UINT wFlags; ! LPWSTR srcFile; ! DWORD srcAttribs; ! LPWSTR destFile; ! DWORD destAttribs; ! if ( !PyArg_ParseTuple(args, "OiiOlOl:CopyCallback", &obhwnd, &wFunc, &wFlags, &obsrcFile, &srcAttribs, &obdestFile, &destAttribs) ) ! return NULL; ! if (!PyWinObject_AsHANDLE(obhwnd, (HANDLE *)&hwnd)) ! return NULL; ! BOOL bPythonIsHappy = TRUE; ! if (bPythonIsHappy && !PyWinObject_AsWCHAR(obsrcFile, &srcFile)) bPythonIsHappy = FALSE; ! if (bPythonIsHappy && !PyWinObject_AsWCHAR(obdestFile, &destFile)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) return NULL; ! HRESULT hr; ! PY_INTERFACE_PRECALL; ! hr = pICH->CopyCallback( hwnd, wFunc, wFlags, srcFile, srcAttribs, destFile, destAttribs ); ! PyWinObject_FreeWCHAR(srcFile); ! PyWinObject_FreeWCHAR(destFile); ! ! PY_INTERFACE_POSTCALL; ! ! if ( FAILED(hr) ) ! return PyCom_BuildPyException(hr, pICH, IID_IShellCopyHook ); ! Py_INCREF(Py_None); ! return Py_None; ! ! } ! ! // @object PyICopyHookW|Description of the interface ! static struct PyMethodDef PyICopyHookW_methods[] = ! { ! { "CopyCallback", PyICopyHookW::CopyCallback, 1 }, // @pymeth CopyCallback|Description of CopyCallback ! { NULL } ! }; ! ! PyComTypeObject PyICopyHookW::type("PyICopyHookW", ! &PyIUnknown::type, ! sizeof(PyICopyHookW), ! PyICopyHookW_methods, ! GET_PYCOM_CTOR(PyICopyHookW)); ! // --------------------------------------------------- ! // ! // Gateway Implementation ! STDMETHODIMP_(UINT) PyGCopyHookW::CopyCallback( ! /* [unique][in] */ HWND hwnd, ! /* [unique][in] */ UINT wFunc, ! /* [unique][in] */ UINT wFlags, ! /* [unique][in] */ LPCWSTR srcFile, ! /* [unique][in] */ DWORD srcAttribs, ! /* [unique][in] */ LPCWSTR destFile, ! /* [unique][in] */ DWORD destAttribs) ! { ! PY_GATEWAY_METHOD; PyObject *result; ! HRESULT hr=InvokeViaPolicy("CopyCallback", &result, "NiiNlNl", ! PyWinLong_FromHANDLE(hwnd), ! wFunc, ! wFlags, ! PyWinObject_FromWCHAR(srcFile), ! srcAttribs, ! PyWinObject_FromWCHAR(destFile), ! destAttribs); if (FAILED(hr)) return hr; hr = PyInt_AsLong(result); Index: PyICopyHook.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyICopyHook.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyICopyHook.h 7 Oct 2003 05:13:22 -0000 1.1 --- PyICopyHook.h 24 Nov 2008 06:10:08 -0000 1.2 *************** *** 5,13 **** // Interface Declaration ! class PyICopyHook : public PyIUnknown { public: ! MAKE_PYCOM_CTOR(PyICopyHook); ! static ICopyHook *GetI(PyObject *self); static PyComTypeObject type; --- 5,13 ---- // Interface Declaration ! class PyICopyHookA : public PyIUnknown { public: ! MAKE_PYCOM_CTOR(PyICopyHookA); ! static ICopyHookA *GetI(PyObject *self); static PyComTypeObject type; *************** *** 16,31 **** protected: ! PyICopyHook(IUnknown *pdisp); ! ~PyICopyHook(); }; // --------------------------------------------------- // // Gateway Declaration ! class PyGCopyHook : public PyGatewayBase, public ICopyHook { protected: ! PyGCopyHook(PyObject *instance) : PyGatewayBase(instance) { ; } ! PYGATEWAY_MAKE_SUPPORT2(PyGCopyHook, ICopyHook, IID_IShellCopyHook, PyGatewayBase) // ICopyHook --- 16,47 ---- protected: ! PyICopyHookA(IUnknown *pdisp); ! ~PyICopyHookA(); ! }; ! ! class PyICopyHookW : public PyIUnknown ! { ! public: ! MAKE_PYCOM_CTOR(PyICopyHookW); ! static ICopyHookW *GetI(PyObject *self); ! static PyComTypeObject type; ! ! // The Python methods ! static PyObject *CopyCallback(PyObject *self, PyObject *args); ! ! protected: ! PyICopyHookW(IUnknown *pdisp); ! ~PyICopyHookW(); }; + // --------------------------------------------------- // // Gateway Declaration ! class PyGCopyHookA : public PyGatewayBase, public ICopyHookA { protected: ! PyGCopyHookA(PyObject *instance) : PyGatewayBase(instance) { ; } ! PYGATEWAY_MAKE_SUPPORT2(PyGCopyHookA, ICopyHookA, IID_IShellCopyHookA, PyGatewayBase) // ICopyHook *************** *** 34,41 **** UINT wFunc, UINT wFlags, ! LPCTSTR srcFile, DWORD srcAttribs, ! LPCTSTR destFile, DWORD destAttribs); }; --- 50,73 ---- UINT wFunc, UINT wFlags, ! LPCSTR srcFile, DWORD srcAttribs, ! LPCSTR destFile, DWORD destAttribs); + }; + + class PyGCopyHookW : public PyGatewayBase, public ICopyHookW + { + protected: + PyGCopyHookW(PyObject *instance) : PyGatewayBase(instance) { ; } + PYGATEWAY_MAKE_SUPPORT2(PyGCopyHookW, ICopyHookW, IID_IShellCopyHookW, PyGatewayBase) + // ICopyHook + STDMETHOD_(UINT, CopyCallback)( + HWND hwnd, + UINT wFunc, + UINT wFlags, + LPCWSTR srcFile, + DWORD srcAttribs, + LPCWSTR destFile, + DWORD destAttribs); }; Index: shell.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/shell.cpp,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** shell.cpp 2 Nov 2008 12:42:58 -0000 1.69 --- shell.cpp 24 Nov 2008 06:10:08 -0000 1.70 *************** *** 3272,3278 **** PYCOM_INTERFACE_CLIENT_ONLY(ExplorerPaneVisibility), PYCOM_INTERFACE_CLIENT_ONLY(NameSpaceTreeControl), ! // IID_ICopyHook doesn't exist - hack it up ! { &IID_IShellCopyHook, "IShellCopyHook", "IID_IShellCopyHook", &PyICopyHook::type, GET_PYGATEWAY_CTOR(PyGCopyHook) }, ! { &IID_IShellCopyHook, "ICopyHook", "IID_ICopyHook", NULL, NULL }, PYCOM_INTERFACE_FULL(ShellItem), PYCOM_INTERFACE_FULL(ShellItemArray), --- 3272,3283 ---- PYCOM_INTERFACE_CLIENT_ONLY(ExplorerPaneVisibility), PYCOM_INTERFACE_CLIENT_ONLY(NameSpaceTreeControl), ! PYCOM_INTERFACE_FULL(ExplorerCommand), ! PYCOM_INTERFACE_FULL(CopyHookA), ! PYCOM_INTERFACE_FULL(CopyHookW), ! // For b/w compat, Add IID_ICopyHook as IID_CopyHookA ! { &IID_ICopyHookA, "ICopyHook", "IID_ICopyHook", NULL, NULL }, ! PYCOM_INTERFACE_IID_ONLY(ShellCopyHookA), ! PYCOM_INTERFACE_IID_ONLY(ShellCopyHookW), ! PYCOM_INTERFACE_IID_ONLY(ShellCopyHook), PYCOM_INTERFACE_FULL(ShellItem), PYCOM_INTERFACE_FULL(ShellItemArray), |
From: Mark H. <mha...@us...> - 2008-11-24 06:09:53
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7376/com/win32comext/shell/src Modified Files: PyIContextMenu.cpp Log Message: Fix IContextMenu::GetCommandString to use a UINT_PTR when calling the interface (it was already correct for the gateway) Index: PyIContextMenu.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIContextMenu.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyIContextMenu.cpp 7 Aug 2008 07:41:33 -0000 1.7 --- PyIContextMenu.cpp 24 Nov 2008 06:09:46 -0000 1.8 *************** *** 93,100 **** // @pyparm int|uType||One of the shellcon.GCS_* constants // @pyparm int|cchMax|2048|Size of buffer to create for returned string ! UINT idCmd; UINT uType; UINT cchMax = 2048; ! if ( !PyArg_ParseTuple(args, "II|I:GetCommandString", &idCmd, &uType, &cchMax) ) return NULL; --- 93,104 ---- // @pyparm int|uType||One of the shellcon.GCS_* constants // @pyparm int|cchMax|2048|Size of buffer to create for returned string ! PyObject *obCmd; UINT uType; UINT cchMax = 2048; ! if ( !PyArg_ParseTuple(args, "OI|I:GetCommandString", &obCmd, &uType, &cchMax) ) ! return NULL; ! ! UINT_PTR idCmd; ! if (!PyWinLong_AsULONG_PTR(obCmd, (ULONG_PTR *)&idCmd)) return NULL; |
From: Mark H. <mha...@us...> - 2008-11-24 06:08:09
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/internet/src In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7290/com/win32comext/internet/src Modified Files: PyIInternetSecurityManager.cpp Log Message: ProcessUrlAction() uses bytes instead of a GUID. Index: PyIInternetSecurityManager.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/internet/src/PyIInternetSecurityManager.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIInternetSecurityManager.cpp 10 Nov 2008 03:19:21 -0000 1.2 --- PyIInternetSecurityManager.cpp 24 Nov 2008 06:08:02 -0000 1.3 *************** *** 132,153 **** // @pyparm <o unicode>|pwszUrl||Description for pwszUrl // @pyparm int|dwAction||Description for dwAction // @pyparm int|dwFlags||Description for dwFlags PyObject *obpwszUrl; LPWSTR pwszUrl; DWORD dwAction; ! PyObject *obContext; DWORD dwFlags; ! if ( !PyArg_ParseTuple(args, "OlOl:ProcessUrlAction", &obpwszUrl, &dwAction, &obContext, &dwFlags) ) return NULL; BOOL bPythonIsHappy = TRUE; ! IID context; ! if (bPythonIsHappy && !PyWinObject_AsBstr(obpwszUrl, &pwszUrl)) bPythonIsHappy = FALSE; ! if (bPythonIsHappy && !PyWinObject_AsIID(obContext, &context)) bPythonIsHappy = FALSE; ! if (!bPythonIsHappy) return NULL; DWORD dwPolicy = 0; HRESULT hr; PY_INTERFACE_PRECALL; ! hr = pIISM->ProcessUrlAction( pwszUrl, dwAction, (BYTE *)&dwPolicy, sizeof(dwPolicy), (BYTE *)&context, sizeof(context), dwFlags, 0); ! SysFreeString(pwszUrl); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) --- 132,153 ---- // @pyparm <o unicode>|pwszUrl||Description for pwszUrl // @pyparm int|dwAction||Description for dwAction + // @pyparm bytes|context|| // @pyparm int|dwFlags||Description for dwFlags PyObject *obpwszUrl; LPWSTR pwszUrl; DWORD dwAction; ! char *context; ! Py_ssize_t cbcontext; DWORD dwFlags; ! if ( !PyArg_ParseTuple(args, "Olz#l:ProcessUrlAction", &obpwszUrl, &dwAction, &context, &cbcontext, &dwFlags) ) return NULL; BOOL bPythonIsHappy = TRUE; ! if (!PyWinObject_AsWCHAR(obpwszUrl, &pwszUrl)) ! return NULL; DWORD dwPolicy = 0; HRESULT hr; PY_INTERFACE_PRECALL; ! hr = pIISM->ProcessUrlAction( pwszUrl, dwAction, (BYTE *)&dwPolicy, sizeof(dwPolicy), (BYTE *)context, cbcontext, dwFlags, 0); ! PyWinObject_FreeWCHAR(pwszUrl); PY_INTERFACE_POSTCALL; if ( FAILED(hr) ) *************** *** 359,372 **** PyObject *obContext; obpwszUrl = MakeOLECHARToObj(pwszUrl); ! if (cbContext==0 || pContext==NULL) { ! obContext = Py_None; ! Py_INCREF(Py_None); ! } else if (cbContext==sizeof(GUID)) ! obContext = PyWinObject_FromIID(*((IID *)pContext)); ! else { ! PyCom_LoggerWarning(NULL, "PyGInternetSecurityManager::ProcessUrlAction has %d bytes for context - what is that?", cbContext); obContext = Py_None; Py_INCREF(Py_None); ! } PyObject *result; HRESULT hr=InvokeViaPolicy("ProcessUrlAction", &result, "OlOll", obpwszUrl, dwAction, obContext, dwFlags, dwReserved); --- 359,370 ---- PyObject *obContext; obpwszUrl = MakeOLECHARToObj(pwszUrl); ! // pContext is documented as being a GUID - but markh has seen IE ! // call this with 78 and 54 bytes in some unusual cases. So ! // just use 'bytes' and the Python code must use magic to get a GUID. ! if (pContext==NULL) { obContext = Py_None; Py_INCREF(Py_None); ! } else ! obContext = PyString_FromStringAndSize((char *)pContext, cbContext); PyObject *result; HRESULT hr=InvokeViaPolicy("ProcessUrlAction", &result, "OlOll", obpwszUrl, dwAction, obContext, dwFlags, dwReserved); |
From: Mark H. <mha...@us...> - 2008-11-24 06:07:12
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7243/Pythonwin/pywin/tools Modified Files: browser.py Log Message: remove (unused) string import Index: browser.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/tools/browser.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** browser.py 14 Nov 2008 00:22:25 -0000 1.11 --- browser.py 24 Nov 2008 06:07:06 -0000 1.12 *************** *** 7,11 **** # >>> browser.Browse(your_module) import __main__ - import string import win32ui from pywin.mfc import dialog --- 7,10 ---- |
From: Mark H. <mha...@us...> - 2008-11-24 06:06:50
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7215/Pythonwin/pywin/framework Modified Files: app.py Log Message: Fix typo in how we check for py2.x vs 3.x Index: app.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/app.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** app.py 14 Nov 2008 00:22:25 -0000 1.15 --- app.py 24 Nov 2008 06:06:44 -0000 1.16 *************** *** 375,379 **** try: ! raw_import # must be py2x... sys.modules['__builtin__'].raw_input=Win32RawInput --- 375,379 ---- try: ! raw_input # must be py2x... sys.modules['__builtin__'].raw_input=Win32RawInput |
From: Mark H. <mha...@us...> - 2008-11-24 06:05:58
|
Update of /cvsroot/pywin32/pywin32 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv7088 Modified Files: setup.py Log Message: Remove pyISAPI_messages.h from the isapi 'depends' list as it caused spurious rebuilds of that module. Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** setup.py 13 Nov 2008 10:29:53 -0000 1.85 --- setup.py 24 Nov 2008 06:05:52 -0000 1.86 *************** *** 1614,1620 **** PythonEng.cpp StdAfx.cpp Utils.cpp """.split()], depends=[os.path.join("isapi", "src", s) for s in """ControlBlock.h FilterContext.h PyExtensionObjects.h ! PyFilterObjects.h pyISAPI.h pyISAPI_messages.h PythonEng.h StdAfx.h Utils.h """.split()], --- 1614,1624 ---- PythonEng.cpp StdAfx.cpp Utils.cpp """.split()], + # We keep pyISAPI_messages.h out of the depends list, as it is + # generated and we aren't smart enough to say *only* the .cpp etc + # depend on it - so the generated .h says the .mc needs to be + # rebuilt, which re-creates the .h... depends=[os.path.join("isapi", "src", s) for s in """ControlBlock.h FilterContext.h PyExtensionObjects.h ! PyFilterObjects.h pyISAPI.h PythonEng.h StdAfx.h Utils.h """.split()], |
From: Mark H. <mha...@sk...> - 2008-11-14 22:47:46
|
> [... snip ...] and the py3k branch will be able to be retired. > > There is still a fair bit to go to get there though - specifically > in bytes and buffer handling. > > Here's what I used in my py3k attempt: > try: > memoryViewType = memoryview # will work in p3k > except NameError: > memoryViewType = types.BufferType # will work in 2.6 > memoryview = buffer The rest of pywin32 needs some help for byte literals etc. I've an idea I've run past Roger that might work but I'm yet to see how practical it is. Certainly the above is good to get going! > Okay: I have killed off my crufty CVS checkout and pulled a bzr branch. > (Wow, that was easy!) > I will re-merge my newer stuff from py3k into that trunk. Just to be clear - launchpad hosts a "trunk mirror" and a "py3k integration branch" - please send patches against the latter, not the former. > I want to do > more of the version-specific stuff at import time, so I want to do some > more refactoring anyway. In reviewing the merge changes, I see many > things like: > if win32: > f = rs.Fields[i] > else: # Iron Python > f = rs.Fields.Item[i] > which I'ld like to re-code, if I can, to get rid of the "if" at run > time. > Would something like: > f = getItemValue(rs.Fields,i) > be too confusing? Actually, I think you will find that 'rs.Fields[i]' is just a "shortcut" for 'rs.Fields.Item[i]' by making use of the "default property". So I suspect that you could use the ironpython version in win32 too. If so a simple comment would then do. Cheers, Mark |
From: Vern C. <kf...@ya...> - 2008-11-14 19:23:34
|
Mark: You have no idea how much you just made my day! Mother used to tell me that "great minds run in the same channels." --- On Thu, 11/13/08, Mark Hammond <mha...@sk...> wrote: > To: "'Vern Cole'" <kf...@ya...>, "'Vernon Cole'" <kf...@us...>, pyw...@li... > Date: Thursday, November 13, 2008, 6:33 PM > > Argh! I'm still struggling with version control -- learning three at > > once. My personal & commercial stuff is on Bazaar so I only use CVS for > > pywin32 and am not too good with it. I intended that this checkin be > > applied to the py3k fork only. > > My apologies for the short and cryptic message. You did check in on the > py3k branch - I just wasn't clear. > > [BTW - how are you finding bzr? I'm working with them on a tortoise > implementation, but find windows support is a little lacking and they aren't > that motivated to help fix the niggles - eg, EOL support] I installed Bazaar 1.9 yesterday (that was an adventure in itself, https://bugs.launchpad.net/bugs/238869) so I am just seeing the tortoise for the first time. It may not be "just what the doctor ordered" yet, but I am confident that it will be. > > I used python 2.6 for testing because I needed to import pythoncom and > > win32com, which work on 2.6 and I assumed were not yet ready on py3k. > > (If I had compiled them would they have worked?) > Let me explain what is happening: > > Roger started the py3k work a long time ago, well before '2to3' was much use > at all. The only practical way to proceed was to "fork" the .py code [... snip ...] > So, I'm working towards my goal on a bzr branch - > lp:~mhammond/pywin32/py3k-integration - and this (mostly) works with *both* > 2.3->2.7 and 3.0 from the same source tree. Most of my work these days is > just merging and testing [... snip ...] and the py3k branch will be able to be retired. > There is still a fair bit to go to get there though - specifically in bytes and buffer handling. Here's what I used in my py3k attempt: try: memoryViewType = memoryview # will work in p3k except NameError: memoryViewType = types.BufferType # will work in 2.6 memoryview = buffer > Getting back specifically to ado: this means that while making changes in a > 2.6-only syntax is fine for the py3k branch, it will still leave me/us with > a future merge problem. As we should be able to continue supporting py2.x > versions for a while, it makes the most sense for new versions to continue > to be developed in a Python 2.x syntax, and using 2to3, even manually in the > short term, to test on py3k. That fits with the recommendations from BDFL. > I hope that clarifies things - please let me know if you have any concerns > or comments. I'd be more than welcome to accept bundles/patches against the > bzr branch - even though that branch will also end up being thrown away, it > is currently useful in helping me merge. Okay: I have killed off my crufty CVS checkout and pulled a bzr branch. (Wow, that was easy!) I will re-merge my newer stuff from py3k into that trunk. I want to do more of the version-specific stuff at import time, so I want to do some more refactoring anyway. In reviewing the merge changes, I see many things like: if win32: f = rs.Fields[i] else: # Iron Python f = rs.Fields.Item[i] which I'ld like to re-code, if I can, to get rid of the "if" at run time. Would something like: f = getItemValue(rs.Fields,i) be too confusing? -- Vernon |
From: Mark H. <mha...@sk...> - 2008-11-14 01:37:54
|
> Argh! I'm still struggling with version control -- learning three at > once. My personal & commercial stuff is on Bazaar so I only use CVS for > pywin32 and am not too good with it. I intended that this checkin be > applied to the py3k fork only. My apologies for the short and cryptic message. You did check in on the py3k branch - I just wasn't clear. [BTW - how are you finding bzr? I'm working with them on a tortoise implementation, but find windows support is a little lacking and they aren't that motivated to help fix the niggles - eg, EOL support] > I used python 2.6 for testing because I needed to import pythoncom and > win32com, which work on 2.6 and I assumed were not yet ready on py3k. > (If I had compiled them would they have worked?) Let me explain what is happening: Roger started the py3k work a long time ago, well before '2to3' was much use at all. The only practical way to proceed was to "fork" the .py code by running it through 2to3 then fixing whatever broke. (The C++ code is much less of a problem - the pre-processor helps a lot there). As a result, the py3k branch has all .py code in py3k syntax. I'm personally willing to take a lot of pain in the interests of *not* forking the .py code. The 2to3 tool has improved a lot and is now available as a library. Thus, the strategy I'm aiming for is to maintain all the code in Python 2.x syntax, and use the 2to3 tool to convert the .py code at build time. This is slow, but still workable. However, we aren't *quite* at the point where this works for Roger yet. He doesn't use 'setup.py' but still builds with the Visual Studio projects. As a result, his build process doesn't support the 2to3 conversion. Further, this means you simply can *not* have the pywin32 source tree on your sys.path in py3k - you must convert to an intermediate directory (setup.py handles this by converting to a temp directory, and these are written to site-packages at install time) So, I'm working towards my goal on a bzr branch - lp:~mhammond/pywin32/py3k-integration - and this (mostly) works with *both* 2.3->2.7 and 3.0 from the same source tree. Most of my work these days is just merging and testing - the merging is working towards the following goal: * The py3k branch and the trunk should become identical in everything other than .py code - but all such differences should be limited to 3.x specific changes only (ie, all other 'modernizations' that work OK in 2.3 will be merged to the trunk, leaving only the py3.x specifics) * The bzr integration branch and the trunk should become identical in .py code (implying all .py code is capable os successfully passing through 2to3) * Once done, this implies all 3 will be identical, except for the .py code, and those differences will be only in ways 2to3 can automatically handle. Once we get to this point, hopefully Roger will be able to work with a 2to3 based build and the py3k branch will be able to be retired. There is still a fair bit to go to get there though - specifically in bytes and buffer handling. Getting back specifically to ado: this means that while making changes in a 2.6-only syntax is fine for the py3k branch, it will still leave me/us with a future merge problem. As we should be able to continue supporting py2.x versions for a while, it makes the most sense for new versions to continue to be developed in a Python 2.x syntax, and using 2to3, even manually in the short term, to test on py3k. I hope that clarifies things - please let me know if you have any concerns or comments. I'd be more than welcome to accept bundles/patches against the bzr branch - even though that branch will also end up being thrown away, it is currently useful in helping me merge. Cheers, Mark |
From: Mark H. <mha...@us...> - 2008-11-14 00:22:37
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24802/Pythonwin/pywin/framework Modified Files: app.py dlgappcore.py help.py intpydde.py mdi_pychecker.py scriptutils.py startup.py stdin.py winout.py Log Message: Various modernizations to .py code via the py3k branch. Index: mdi_pychecker.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/mdi_pychecker.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mdi_pychecker.py 23 Oct 2008 07:39:12 -0000 1.3 --- mdi_pychecker.py 14 Nov 2008 00:22:25 -0000 1.4 *************** *** 57,61 **** if os.path.isdir(d): d = d.lower() ! if not dirs.has_key(d): dirs[d] = None if recurse: --- 57,61 ---- if os.path.isdir(d): d = d.lower() ! if d not in dirs: dirs[d] = None if recurse: *************** *** 63,67 **** for sd in subdirs: sd = sd.lower() ! if not dirs.has_key(sd): dirs[sd] = None elif os.path.isfile(d): --- 63,67 ---- for sd in subdirs: sd = sd.lower() ! if sd not in dirs: dirs[sd] = None elif os.path.isfile(d): *************** *** 69,73 **** else: x = None ! if os.environ.has_key(d): x = dirpath(os.environ[d]) elif d[:5] == 'HKEY_': --- 69,73 ---- else: x = None ! if d in os.environ: x = dirpath(os.environ[d]) elif d[:5] == 'HKEY_': *************** *** 90,94 **** if x: for xd in x: ! if not dirs.has_key(xd): dirs[xd] = None if recurse: --- 90,94 ---- if x: for xd in x: ! if xd not in dirs: dirs[xd] = None if recurse: *************** *** 96,100 **** for sd in subdirs: sd = sd.lower() ! if not dirs.has_key(sd): dirs[sd] = None self.dirs = [] --- 96,100 ---- for sd in subdirs: sd = sd.lower() ! if sd not in dirs: dirs[sd] = None self.dirs = [] Index: startup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/startup.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** startup.py 9 Aug 2008 18:37:22 -0000 1.4 --- startup.py 14 Nov 2008 00:22:25 -0000 1.5 *************** *** 57,61 **** import app if app.AppBuilder is None: ! raise TypeError, "No application object has been registered" app.App = app.AppBuilder() --- 57,61 ---- import app if app.AppBuilder is None: ! raise TypeError("No application object has been registered") app.App = app.AppBuilder() Index: stdin.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/stdin.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** stdin.py 1 Oct 2008 14:44:52 -0000 1.4 --- stdin.py 14 Nov 2008 00:22:25 -0000 1.5 *************** *** 22,26 **** true = 1 false = 0 ! get_input_line = raw_input class Stdin: --- 22,29 ---- true = 1 false = 0 ! try: ! get_input_line = raw_input # py2x ! except NameError: ! get_input_line = input # py3k class Stdin: *************** *** 120,124 **** """ if self.closed: ! return apply(self.real_file.readlines, sizehint) result = [] --- 123,127 ---- """ if self.closed: ! return self.real_file.readlines(*sizehint) result = [] Index: app.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/app.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** app.py 11 Aug 2008 00:38:28 -0000 1.14 --- app.py 14 Nov 2008 00:22:25 -0000 1.15 *************** *** 11,17 **** import string import os ! from pywin.mfc import window, dialog, thread, afxres import traceback ! from pywin.framework import scriptutils ## NOTE: App and AppBuild should NOT be used - instead, you should contruct your --- 11,20 ---- import string import os ! from pywin.mfc import window, dialog, afxres ! from pywin.mfc.thread import WinApp import traceback ! import regutil ! ! import scriptutils ## NOTE: App and AppBuild should NOT be used - instead, you should contruct your *************** *** 113,121 **** return 0 ! class CApp(thread.WinApp): " A class for the application " def __init__(self): self.oldCallbackCaller = None ! thread.WinApp.__init__(self, win32ui.GetApp() ) self.idleHandlers = [] --- 116,124 ---- return 0 ! class CApp(WinApp): " A class for the application " def __init__(self): self.oldCallbackCaller = None ! WinApp.__init__(self, win32ui.GetApp() ) self.idleHandlers = [] *************** *** 169,173 **** thisRet = handler(handler, count) except: ! print "Idle handler %s failed" % (`handler`) traceback.print_exc() print "Idle handler removed from list" --- 172,176 ---- thisRet = handler(handler, count) except: ! print "Idle handler %s failed" % (repr(handler)) traceback.print_exc() print "Idle handler removed from list" *************** *** 196,200 **** def OnHelp(self,id, code): try: - import regutil if id==win32ui.ID_HELP_GUI_REF: helpFile = regutil.GetRegisteredHelpFile("Pythonwin Reference") --- 199,202 ---- *************** *** 365,382 **** ret=dialog.GetSimpleInput(prompt) if ret==None: ! raise KeyboardInterrupt, "operation cancelled" return ret def Win32Input(prompt=None): "Provide input() for gui apps" ! return eval(raw_input(prompt)) ! sys.modules['__builtin__'].raw_input=Win32RawInput ! sys.modules['__builtin__'].input=Win32Input def HaveGoodGUI(): """Returns true if we currently have a good gui available. """ ! return sys.modules.has_key("pywin.framework.startup") def CreateDefaultGUI( appClass = None): --- 367,390 ---- ret=dialog.GetSimpleInput(prompt) if ret==None: ! raise KeyboardInterrupt("operation cancelled") return ret def Win32Input(prompt=None): "Provide input() for gui apps" ! return eval(input(prompt)) ! try: ! raw_import ! # must be py2x... ! sys.modules['__builtin__'].raw_input=Win32RawInput ! except NameError: ! # must be py3k ! import code ! code.InteractiveConsole.input=Win32Input def HaveGoodGUI(): """Returns true if we currently have a good gui available. """ ! return "pywin.framework.startup" in sys.modules def CreateDefaultGUI( appClass = None): Index: intpydde.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/intpydde.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** intpydde.py 22 Jun 2006 13:55:49 -0000 1.2 --- intpydde.py 14 Nov 2008 00:22:25 -0000 1.3 *************** *** 10,15 **** from pywin.mfc import object from dde import * ! import traceback ! import string class DDESystemTopic(object.Object): --- 10,14 ---- from pywin.mfc import object from dde import * ! import sys, traceback class DDESystemTopic(object.Object): *************** *** 22,28 **** self.app.OnDDECommand(data) except: # The DDE Execution failed. print "Error executing DDE command." ! traceback.print_exc() return 0 --- 21,28 ---- self.app.OnDDECommand(data) except: + t,v,tb = sys.exc_info() # The DDE Execution failed. print "Error executing DDE command." ! traceback.print_exception(t,v,tb) return 0 Index: dlgappcore.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/dlgappcore.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dlgappcore.py 21 Jun 2005 08:04:42 -0000 1.3 --- dlgappcore.py 14 Nov 2008 00:22:25 -0000 1.4 *************** *** 55,59 **** if self.frame is None: ! raise error, "No dialog was created by CreateDialog()" return --- 55,59 ---- if self.frame is None: ! raise error("No dialog was created by CreateDialog()") return Index: help.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/help.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** help.py 2 Oct 2008 13:03:55 -0000 1.13 --- help.py 14 Nov 2008 00:22:25 -0000 1.14 *************** *** 143,147 **** if helpIDMap: ! for id, (desc, fname) in helpIDMap.items(): otherMenu.AppendMenu(win32con.MF_ENABLED|win32con.MF_STRING,id, desc) else: --- 143,147 ---- if helpIDMap: ! for id, (desc, fname) in helpIDMap.iteritems(): otherMenu.AppendMenu(win32con.MF_ENABLED|win32con.MF_STRING,id, desc) else: Index: winout.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/winout.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** winout.py 9 Aug 2008 16:47:07 -0000 1.14 --- winout.py 14 Nov 2008 00:22:25 -0000 1.15 *************** *** 24,28 **** from pywin.mfc import docview from pywin.framework import app, window - from pywintypes import UnicodeType import win32ui, win32api, win32con import Queue --- 24,27 ---- *************** *** 109,113 **** if type(appendParams)!=type(()): appendParams = (appendParams,) ! apply(menu.AppendMenu, appendParams) menu.TrackPopupMenu(params[5]) # track at mouse position. return 0 --- 108,112 ---- if type(appendParams)!=type(()): appendParams = (appendParams,) ! menu.AppendMenu(*appendParams) menu.TrackPopupMenu(params[5]) # track at mouse position. return 0 *************** *** 131,139 **** return 1 except win32api.error, details: ! try: ! msg = details[2] ! except: ! msg = str(details) ! win32ui.SetStatusText("The help file could not be opened - %s" % msg) return 1 except: --- 130,134 ---- return 1 except win32api.error, details: ! win32ui.SetStatusText("The help file could not be opened - %s" % details.strerror) return 1 except: *************** *** 428,432 **** return 0 ! def QueueFlush(self, max = sys.maxint): # Returns true if the queue is empty after the flush # debug("Queueflush - %d, %d\n" % (max, self.outputQueue.qsize())) --- 423,427 ---- return 0 ! def QueueFlush(self, max = None): # Returns true if the queue is empty after the flush # debug("Queueflush - %d, %d\n" % (max, self.outputQueue.qsize())) *************** *** 434,454 **** items = [] rc = 0 ! while max > 0: try: item = self.outputQueue.get_nowait() - if is_platform_unicode: - # Note is_platform_unicode is never true any more! - if not isinstance(item, UnicodeType): - item = unicode(item, default_platform_encoding) - item = item.encode(default_scintilla_encoding) # What scintilla uses. - else: - # try and display using mbcs encoding - if isinstance(item, UnicodeType): - item = item.encode("mbcs") items.append(item) except Queue.Empty: rc = 1 break ! max = max - 1 if len(items) != 0: if not self.CheckRecreateWindow(): --- 429,441 ---- items = [] rc = 0 ! while max is None or max > 0: try: item = self.outputQueue.get_nowait() items.append(item) except Queue.Empty: rc = 1 break ! if max is not None: ! max = max - 1 if len(items) != 0: if not self.CheckRecreateWindow(): *************** *** 498,502 **** def RTFWindowOutput(*args, **kw): kw['makeView'] = WindowOutputViewRTF ! return apply( WindowOutput, args, kw ) --- 485,489 ---- def RTFWindowOutput(*args, **kw): kw['makeView'] = WindowOutputViewRTF ! return WindowOutput(*args, **kw) *************** *** 509,516 **** w = WindowOutput(queueing=flags.WQ_IDLE) w.write("First bit of text\n") ! import thread for i in range(5): w.write("Hello from the main thread\n") ! thread.start_new(thread_test, (w,)) for i in range(2): w.write("Hello from the main thread\n") --- 496,503 ---- w = WindowOutput(queueing=flags.WQ_IDLE) w.write("First bit of text\n") ! import _thread for i in range(5): w.write("Hello from the main thread\n") ! _thread.start_new(thread_test, (w,)) for i in range(2): w.write("Hello from the main thread\n") Index: scriptutils.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/scriptutils.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** scriptutils.py 23 Oct 2008 03:42:43 -0000 1.19 --- scriptutils.py 14 Nov 2008 00:22:25 -0000 1.20 *************** *** 97,101 **** modBits.append(modBit) # If on path, _and_ existing package of that name loaded. ! if IsOnPythonPath(path) and sys.modules.has_key(modBit) and \ ( os.path.exists(os.path.join(path, '__init__.py')) or \ os.path.exists(os.path.join(path, '__init__.pyc')) or \ --- 97,101 ---- modBits.append(modBit) # If on path, _and_ existing package of that name loaded. ! if IsOnPythonPath(path) and modBit in sys.modules and \ ( os.path.exists(os.path.join(path, '__init__.py')) or \ os.path.exists(os.path.join(path, '__init__.pyc')) or \ *************** *** 159,165 **** if bAutoSave and \ ! (len(pathName)>0 or \ ! doc.GetTitle()[:8]=="Untitled" or \ ! doc.GetTitle()[:6]=="Script"): # if not a special purpose window if doc.IsModified(): try: --- 159,165 ---- if bAutoSave and \ ! (len(pathName)>0 or \ ! doc.GetTitle()[:8]=="Untitled" or \ ! doc.GetTitle()[:6]=="Script"): # if not a special purpose window if doc.IsModified(): try: *************** *** 362,366 **** if pathName is not None: ! if os.path.splitext(pathName)[1].lower() <> ".py": pathName = None --- 362,366 ---- if pathName is not None: ! if os.path.splitext(pathName)[1].lower() != ".py": pathName = None *************** *** 378,382 **** modName, modExt = os.path.splitext(modName) newPath = None ! for key, mod in sys.modules.items(): if hasattr(mod, '__file__'): fname = mod.__file__ --- 378,382 ---- modName, modExt = os.path.splitext(modName) newPath = None ! for key, mod in sys.modules.iteritems(): if hasattr(mod, '__file__'): fname = mod.__file__ *************** *** 392,396 **** if newPath: sys.path.append(newPath) ! if sys.modules.has_key(modName): bNeedReload = 1 what = "reload" --- 392,396 ---- if newPath: sys.path.append(newPath) ! if modName in sys.modules: bNeedReload = 1 what = "reload" *************** *** 404,408 **** try: ! # always do an import, as it is cheap is already loaded. This ensures # it is in our name space. codeObj = compile('import '+modName,'<auto import>','exec') --- 404,408 ---- try: ! # always do an import, as it is cheap if it's already loaded. This ensures # it is in our name space. codeObj = compile('import '+modName,'<auto import>','exec') *************** *** 454,458 **** def RunTabNanny(filename): ! import cStringIO tabnanny = FindTabNanny() if tabnanny is None: --- 454,461 ---- def RunTabNanny(filename): ! try: ! import cStringIO as io ! except ImportError: ! import io tabnanny = FindTabNanny() if tabnanny is None: *************** *** 461,465 **** # Capture the tab-nanny output ! newout = cStringIO.StringIO() old_out = sys.stderr, sys.stdout sys.stderr = sys.stdout = newout --- 464,468 ---- # Capture the tab-nanny output ! newout = io.StringIO() old_out = sys.stderr, sys.stdout sys.stderr = sys.stdout = newout |
From: Mark H. <mha...@us...> - 2008-11-14 00:22:33
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/directsound/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24802/com/win32comext/directsound/test Modified Files: ds_record.py ds_test.py Log Message: Various modernizations to .py code via the py3k branch. Index: ds_record.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/directsound/test/ds_record.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ds_record.py 7 Mar 2005 22:18:45 -0000 1.1 --- ds_record.py 14 Nov 2008 00:22:25 -0000 1.2 *************** *** 1,5 **** import pywintypes import struct ! import win32event import win32com.directsound.directsound as ds --- 1,6 ---- import pywintypes import struct ! import win32event, win32api ! import os import win32com.directsound.directsound as ds *************** *** 38,42 **** data = buffer.Update(0, 352800) ! f = open('recording.wav', 'wb') f.write(wav_header_pack(sdesc.lpwfxFormat, 352800)) f.write(data) --- 39,45 ---- data = buffer.Update(0, 352800) ! fname=os.path.join(win32api.GetTempPath(), 'test_directsound_record.wav') ! f = open(fname, 'wb') 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.5 diff -C2 -d -r1.4 -r1.5 *** ds_test.py 7 Mar 2005 22:18:45 -0000 1.4 --- ds_test.py 14 Nov 2008 00:22:25 -0000 1.5 *************** *** 4,8 **** import os import pywintypes ! import win32event import win32com.directsound.directsound as ds # next two lines are for for debugging: --- 4,9 ---- import os import pywintypes ! import win32event, win32api ! import os import win32com.directsound.directsound as ds # next two lines are for for debugging: *************** *** 24,28 **** # 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() --- 25,29 ---- # 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() *************** *** 329,334 **** data = buffer.Update(0, 352800) ! ! f = open('recording.wav', 'wb') f.write(wav_header_pack(sdesc.lpwfxFormat, 352800)) f.write(data) --- 330,335 ---- data = buffer.Update(0, 352800) ! fname=os.path.join(win32api.GetTempPath(), 'test_directsound_record.wav') ! f = open(fname, 'wb') f.write(wav_header_pack(sdesc.lpwfxFormat, 352800)) f.write(data) |
From: Mark H. <mha...@us...> - 2008-11-14 00:22:33
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24802/win32/Lib Modified Files: mmsystem.py netbios.py ntsecuritycon.py pywintypes.py sspi.py sspicon.py win32pdhutil.py Log Message: Various modernizations to .py code via the py3k branch. Index: sspicon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/sspicon.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** sspicon.py 12 Feb 2006 14:10:02 -0000 1.4 --- sspicon.py 14 Nov 2008 00:22:25 -0000 1.5 *************** *** 280,391 **** SEC_E_NO_KERB_KEY = -2146892984 ! ERROR_IPSEC_QM_POLICY_EXISTS = 13000L ! ERROR_IPSEC_QM_POLICY_NOT_FOUND = 13001L ! ERROR_IPSEC_QM_POLICY_IN_USE = 13002L ! ERROR_IPSEC_MM_POLICY_EXISTS = 13003L ! ERROR_IPSEC_MM_POLICY_NOT_FOUND = 13004L ! ERROR_IPSEC_MM_POLICY_IN_USE = 13005L ! ERROR_IPSEC_MM_FILTER_EXISTS = 13006L ! ERROR_IPSEC_MM_FILTER_NOT_FOUND = 13007L ! ERROR_IPSEC_TRANSPORT_FILTER_EXISTS = 13008L ! ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND = 13009L ! ERROR_IPSEC_MM_AUTH_EXISTS = 13010L ! ERROR_IPSEC_MM_AUTH_NOT_FOUND = 13011L ! ERROR_IPSEC_MM_AUTH_IN_USE = 13012L ! ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND = 13013L ! ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND = 13014L ! ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND = 13015L ! ERROR_IPSEC_TUNNEL_FILTER_EXISTS = 13016L ! ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND = 13017L ! ERROR_IPSEC_MM_FILTER_PENDING_DELETION = 13018L ! ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION = 13019L ! ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION = 13020L ! ERROR_IPSEC_MM_POLICY_PENDING_DELETION = 13021L ! ERROR_IPSEC_MM_AUTH_PENDING_DELETION = 13022L ! ERROR_IPSEC_QM_POLICY_PENDING_DELETION = 13023L ! WARNING_IPSEC_MM_POLICY_PRUNED = 13024L ! WARNING_IPSEC_QM_POLICY_PRUNED = 13025L ! ERROR_IPSEC_IKE_NEG_STATUS_BEGIN = 13800L ! ERROR_IPSEC_IKE_AUTH_FAIL = 13801L ! ERROR_IPSEC_IKE_ATTRIB_FAIL = 13802L ! ERROR_IPSEC_IKE_NEGOTIATION_PENDING = 13803L ! ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR = 13804L ! ERROR_IPSEC_IKE_TIMED_OUT = 13805L ! ERROR_IPSEC_IKE_NO_CERT = 13806L ! ERROR_IPSEC_IKE_SA_DELETED = 13807L ! ERROR_IPSEC_IKE_SA_REAPED = 13808L ! ERROR_IPSEC_IKE_MM_ACQUIRE_DROP = 13809L ! ERROR_IPSEC_IKE_QM_ACQUIRE_DROP = 13810L ! ERROR_IPSEC_IKE_QUEUE_DROP_MM = 13811L ! ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM = 13812L ! ERROR_IPSEC_IKE_DROP_NO_RESPONSE = 13813L ! ERROR_IPSEC_IKE_MM_DELAY_DROP = 13814L ! ERROR_IPSEC_IKE_QM_DELAY_DROP = 13815L ! ERROR_IPSEC_IKE_ERROR = 13816L ! ERROR_IPSEC_IKE_CRL_FAILED = 13817L ! ERROR_IPSEC_IKE_INVALID_KEY_USAGE = 13818L ! ERROR_IPSEC_IKE_INVALID_CERT_TYPE = 13819L ! ERROR_IPSEC_IKE_NO_PRIVATE_KEY = 13820L ! ERROR_IPSEC_IKE_DH_FAIL = 13822L ! ERROR_IPSEC_IKE_INVALID_HEADER = 13824L ! ERROR_IPSEC_IKE_NO_POLICY = 13825L ! ERROR_IPSEC_IKE_INVALID_SIGNATURE = 13826L ! ERROR_IPSEC_IKE_KERBEROS_ERROR = 13827L ! ERROR_IPSEC_IKE_NO_PUBLIC_KEY = 13828L ! ERROR_IPSEC_IKE_PROCESS_ERR = 13829L ! ERROR_IPSEC_IKE_PROCESS_ERR_SA = 13830L ! ERROR_IPSEC_IKE_PROCESS_ERR_PROP = 13831L ! ERROR_IPSEC_IKE_PROCESS_ERR_TRANS = 13832L ! ERROR_IPSEC_IKE_PROCESS_ERR_KE = 13833L ! ERROR_IPSEC_IKE_PROCESS_ERR_ID = 13834L ! ERROR_IPSEC_IKE_PROCESS_ERR_CERT = 13835L ! ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ = 13836L ! ERROR_IPSEC_IKE_PROCESS_ERR_HASH = 13837L ! ERROR_IPSEC_IKE_PROCESS_ERR_SIG = 13838L ! ERROR_IPSEC_IKE_PROCESS_ERR_NONCE = 13839L ! ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY = 13840L ! ERROR_IPSEC_IKE_PROCESS_ERR_DELETE = 13841L ! ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR = 13842L ! ERROR_IPSEC_IKE_INVALID_PAYLOAD = 13843L ! ERROR_IPSEC_IKE_LOAD_SOFT_SA = 13844L ! ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN = 13845L ! ERROR_IPSEC_IKE_INVALID_COOKIE = 13846L ! ERROR_IPSEC_IKE_NO_PEER_CERT = 13847L ! ERROR_IPSEC_IKE_PEER_CRL_FAILED = 13848L ! ERROR_IPSEC_IKE_POLICY_CHANGE = 13849L ! ERROR_IPSEC_IKE_NO_MM_POLICY = 13850L ! ERROR_IPSEC_IKE_NOTCBPRIV = 13851L ! ERROR_IPSEC_IKE_SECLOADFAIL = 13852L ! ERROR_IPSEC_IKE_FAILSSPINIT = 13853L ! ERROR_IPSEC_IKE_FAILQUERYSSP = 13854L ! ERROR_IPSEC_IKE_SRVACQFAIL = 13855L ! ERROR_IPSEC_IKE_SRVQUERYCRED = 13856L ! ERROR_IPSEC_IKE_GETSPIFAIL = 13857L ! ERROR_IPSEC_IKE_INVALID_FILTER = 13858L ! ERROR_IPSEC_IKE_OUT_OF_MEMORY = 13859L ! ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED = 13860L ! ERROR_IPSEC_IKE_INVALID_POLICY = 13861L ! ERROR_IPSEC_IKE_UNKNOWN_DOI = 13862L ! ERROR_IPSEC_IKE_INVALID_SITUATION = 13863L ! ERROR_IPSEC_IKE_DH_FAILURE = 13864L ! ERROR_IPSEC_IKE_INVALID_GROUP = 13865L ! ERROR_IPSEC_IKE_ENCRYPT = 13866L ! ERROR_IPSEC_IKE_DECRYPT = 13867L ! ERROR_IPSEC_IKE_POLICY_MATCH = 13868L ! ERROR_IPSEC_IKE_UNSUPPORTED_ID = 13869L ! ERROR_IPSEC_IKE_INVALID_HASH = 13870L ! ERROR_IPSEC_IKE_INVALID_HASH_ALG = 13871L ! ERROR_IPSEC_IKE_INVALID_HASH_SIZE = 13872L ! ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG = 13873L ! ERROR_IPSEC_IKE_INVALID_AUTH_ALG = 13874L ! ERROR_IPSEC_IKE_INVALID_SIG = 13875L ! ERROR_IPSEC_IKE_LOAD_FAILED = 13876L ! ERROR_IPSEC_IKE_RPC_DELETE = 13877L ! ERROR_IPSEC_IKE_BENIGN_REINIT = 13878L ! ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY = 13879L ! ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN = 13881L ! ERROR_IPSEC_IKE_MM_LIMIT = 13882L ! ERROR_IPSEC_IKE_NEGOTIATION_DISABLED = 13883L ! ERROR_IPSEC_IKE_NEG_STATUS_END = 13884L CRYPT_E_MSG_ERROR = ((-2146889727)) CRYPT_E_UNKNOWN_ALGO = ((-2146889726)) --- 280,391 ---- SEC_E_NO_KERB_KEY = -2146892984 ! ERROR_IPSEC_QM_POLICY_EXISTS = 13000 ! ERROR_IPSEC_QM_POLICY_NOT_FOUND = 13001 ! ERROR_IPSEC_QM_POLICY_IN_USE = 13002 ! ERROR_IPSEC_MM_POLICY_EXISTS = 13003 ! ERROR_IPSEC_MM_POLICY_NOT_FOUND = 13004 ! ERROR_IPSEC_MM_POLICY_IN_USE = 13005 ! ERROR_IPSEC_MM_FILTER_EXISTS = 13006 ! ERROR_IPSEC_MM_FILTER_NOT_FOUND = 13007 ! ERROR_IPSEC_TRANSPORT_FILTER_EXISTS = 13008 ! ERROR_IPSEC_TRANSPORT_FILTER_NOT_FOUND = 13009 ! ERROR_IPSEC_MM_AUTH_EXISTS = 13010 ! ERROR_IPSEC_MM_AUTH_NOT_FOUND = 13011 ! ERROR_IPSEC_MM_AUTH_IN_USE = 13012 ! ERROR_IPSEC_DEFAULT_MM_POLICY_NOT_FOUND = 13013 ! ERROR_IPSEC_DEFAULT_MM_AUTH_NOT_FOUND = 13014 ! ERROR_IPSEC_DEFAULT_QM_POLICY_NOT_FOUND = 13015 ! ERROR_IPSEC_TUNNEL_FILTER_EXISTS = 13016 ! ERROR_IPSEC_TUNNEL_FILTER_NOT_FOUND = 13017 ! ERROR_IPSEC_MM_FILTER_PENDING_DELETION = 13018 ! ERROR_IPSEC_TRANSPORT_FILTER_PENDING_DELETION = 13019 ! ERROR_IPSEC_TUNNEL_FILTER_PENDING_DELETION = 13020 ! ERROR_IPSEC_MM_POLICY_PENDING_DELETION = 13021 ! ERROR_IPSEC_MM_AUTH_PENDING_DELETION = 13022 ! ERROR_IPSEC_QM_POLICY_PENDING_DELETION = 13023 ! WARNING_IPSEC_MM_POLICY_PRUNED = 13024 ! WARNING_IPSEC_QM_POLICY_PRUNED = 13025 ! ERROR_IPSEC_IKE_NEG_STATUS_BEGIN = 13800 ! ERROR_IPSEC_IKE_AUTH_FAIL = 13801 ! ERROR_IPSEC_IKE_ATTRIB_FAIL = 13802 ! ERROR_IPSEC_IKE_NEGOTIATION_PENDING = 13803 ! ERROR_IPSEC_IKE_GENERAL_PROCESSING_ERROR = 13804 ! ERROR_IPSEC_IKE_TIMED_OUT = 13805 ! ERROR_IPSEC_IKE_NO_CERT = 13806 ! ERROR_IPSEC_IKE_SA_DELETED = 13807 ! ERROR_IPSEC_IKE_SA_REAPED = 13808 ! ERROR_IPSEC_IKE_MM_ACQUIRE_DROP = 13809 ! ERROR_IPSEC_IKE_QM_ACQUIRE_DROP = 13810 ! ERROR_IPSEC_IKE_QUEUE_DROP_MM = 13811 ! ERROR_IPSEC_IKE_QUEUE_DROP_NO_MM = 13812 ! ERROR_IPSEC_IKE_DROP_NO_RESPONSE = 13813 ! ERROR_IPSEC_IKE_MM_DELAY_DROP = 13814 ! ERROR_IPSEC_IKE_QM_DELAY_DROP = 13815 ! ERROR_IPSEC_IKE_ERROR = 13816 ! ERROR_IPSEC_IKE_CRL_FAILED = 13817 ! ERROR_IPSEC_IKE_INVALID_KEY_USAGE = 13818 ! ERROR_IPSEC_IKE_INVALID_CERT_TYPE = 13819 ! ERROR_IPSEC_IKE_NO_PRIVATE_KEY = 13820 ! ERROR_IPSEC_IKE_DH_FAIL = 13822 ! ERROR_IPSEC_IKE_INVALID_HEADER = 13824 ! ERROR_IPSEC_IKE_NO_POLICY = 13825 ! ERROR_IPSEC_IKE_INVALID_SIGNATURE = 13826 ! ERROR_IPSEC_IKE_KERBEROS_ERROR = 13827 ! ERROR_IPSEC_IKE_NO_PUBLIC_KEY = 13828 ! ERROR_IPSEC_IKE_PROCESS_ERR = 13829 ! ERROR_IPSEC_IKE_PROCESS_ERR_SA = 13830 ! ERROR_IPSEC_IKE_PROCESS_ERR_PROP = 13831 ! ERROR_IPSEC_IKE_PROCESS_ERR_TRANS = 13832 ! ERROR_IPSEC_IKE_PROCESS_ERR_KE = 13833 ! ERROR_IPSEC_IKE_PROCESS_ERR_ID = 13834 ! ERROR_IPSEC_IKE_PROCESS_ERR_CERT = 13835 ! ERROR_IPSEC_IKE_PROCESS_ERR_CERT_REQ = 13836 ! ERROR_IPSEC_IKE_PROCESS_ERR_HASH = 13837 ! ERROR_IPSEC_IKE_PROCESS_ERR_SIG = 13838 ! ERROR_IPSEC_IKE_PROCESS_ERR_NONCE = 13839 ! ERROR_IPSEC_IKE_PROCESS_ERR_NOTIFY = 13840 ! ERROR_IPSEC_IKE_PROCESS_ERR_DELETE = 13841 ! ERROR_IPSEC_IKE_PROCESS_ERR_VENDOR = 13842 ! ERROR_IPSEC_IKE_INVALID_PAYLOAD = 13843 ! ERROR_IPSEC_IKE_LOAD_SOFT_SA = 13844 ! ERROR_IPSEC_IKE_SOFT_SA_TORN_DOWN = 13845 ! ERROR_IPSEC_IKE_INVALID_COOKIE = 13846 ! ERROR_IPSEC_IKE_NO_PEER_CERT = 13847 ! ERROR_IPSEC_IKE_PEER_CRL_FAILED = 13848 ! ERROR_IPSEC_IKE_POLICY_CHANGE = 13849 ! ERROR_IPSEC_IKE_NO_MM_POLICY = 13850 ! ERROR_IPSEC_IKE_NOTCBPRIV = 13851 ! ERROR_IPSEC_IKE_SECLOADFAIL = 13852 ! ERROR_IPSEC_IKE_FAILSSPINIT = 13853 ! ERROR_IPSEC_IKE_FAILQUERYSSP = 13854 ! ERROR_IPSEC_IKE_SRVACQFAIL = 13855 ! ERROR_IPSEC_IKE_SRVQUERYCRED = 13856 ! ERROR_IPSEC_IKE_GETSPIFAIL = 13857 ! ERROR_IPSEC_IKE_INVALID_FILTER = 13858 ! ERROR_IPSEC_IKE_OUT_OF_MEMORY = 13859 ! ERROR_IPSEC_IKE_ADD_UPDATE_KEY_FAILED = 13860 ! ERROR_IPSEC_IKE_INVALID_POLICY = 13861 ! ERROR_IPSEC_IKE_UNKNOWN_DOI = 13862 ! ERROR_IPSEC_IKE_INVALID_SITUATION = 13863 ! ERROR_IPSEC_IKE_DH_FAILURE = 13864 ! ERROR_IPSEC_IKE_INVALID_GROUP = 13865 ! ERROR_IPSEC_IKE_ENCRYPT = 13866 ! ERROR_IPSEC_IKE_DECRYPT = 13867 ! ERROR_IPSEC_IKE_POLICY_MATCH = 13868 ! ERROR_IPSEC_IKE_UNSUPPORTED_ID = 13869 ! ERROR_IPSEC_IKE_INVALID_HASH = 13870 ! ERROR_IPSEC_IKE_INVALID_HASH_ALG = 13871 ! ERROR_IPSEC_IKE_INVALID_HASH_SIZE = 13872 ! ERROR_IPSEC_IKE_INVALID_ENCRYPT_ALG = 13873 ! ERROR_IPSEC_IKE_INVALID_AUTH_ALG = 13874 ! ERROR_IPSEC_IKE_INVALID_SIG = 13875 ! ERROR_IPSEC_IKE_LOAD_FAILED = 13876 ! ERROR_IPSEC_IKE_RPC_DELETE = 13877 ! ERROR_IPSEC_IKE_BENIGN_REINIT = 13878 ! ERROR_IPSEC_IKE_INVALID_RESPONDER_LIFETIME_NOTIFY = 13879 ! ERROR_IPSEC_IKE_INVALID_CERT_KEYLEN = 13881 ! ERROR_IPSEC_IKE_MM_LIMIT = 13882 ! ERROR_IPSEC_IKE_NEGOTIATION_DISABLED = 13883 ! ERROR_IPSEC_IKE_NEG_STATUS_END = 13884 CRYPT_E_MSG_ERROR = ((-2146889727)) CRYPT_E_UNKNOWN_ALGO = ((-2146889726)) Index: ntsecuritycon.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/ntsecuritycon.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ntsecuritycon.py 20 Jan 2008 03:43:44 -0000 1.9 --- ntsecuritycon.py 14 Nov 2008 00:22:25 -0000 1.10 *************** *** 644,681 **** ## from aclui.h # SI_OBJECT_INFO.dwFlags ! SI_EDIT_PERMS = 0x00000000L ! SI_EDIT_OWNER = 0x00000001L ! SI_EDIT_AUDITS = 0x00000002L ! SI_CONTAINER = 0x00000004L ! SI_READONLY = 0x00000008L ! SI_ADVANCED = 0x00000010L ! SI_RESET = 0x00000020L ! SI_OWNER_READONLY = 0x00000040L ! SI_EDIT_PROPERTIES = 0x00000080L ! SI_OWNER_RECURSE = 0x00000100L ! SI_NO_ACL_PROTECT = 0x00000200L ! SI_NO_TREE_APPLY = 0x00000400L ! SI_PAGE_TITLE = 0x00000800L ! SI_SERVER_IS_DC = 0x00001000L ! SI_RESET_DACL_TREE = 0x00004000L ! SI_RESET_SACL_TREE = 0x00008000L ! SI_OBJECT_GUID = 0x00010000L ! SI_EDIT_EFFECTIVE = 0x00020000L ! SI_RESET_DACL = 0x00040000L ! SI_RESET_SACL = 0x00080000L ! SI_RESET_OWNER = 0x00100000L ! SI_NO_ADDITIONAL_PERMISSION = 0x00200000L ! SI_MAY_WRITE = 0x10000000L SI_EDIT_ALL = (SI_EDIT_PERMS | SI_EDIT_OWNER | SI_EDIT_AUDITS) ! SI_AUDITS_ELEVATION_REQUIRED = 0x02000000L ! SI_VIEW_ONLY = 0x00400000L ! SI_OWNER_ELEVATION_REQUIRED = 0x04000000L ! SI_PERMS_ELEVATION_REQUIRED = 0x01000000L # SI_ACCESS.dwFlags ! SI_ACCESS_SPECIFIC = 0x00010000L ! SI_ACCESS_GENERAL = 0x00020000L ! SI_ACCESS_CONTAINER = 0x00040000L ! SI_ACCESS_PROPERTY = 0x00080000L # SI_PAGE_TYPE enum --- 644,681 ---- ## from aclui.h # SI_OBJECT_INFO.dwFlags ! SI_EDIT_PERMS = 0x00000000 ! SI_EDIT_OWNER = 0x00000001 ! SI_EDIT_AUDITS = 0x00000002 ! SI_CONTAINER = 0x00000004 ! SI_READONLY = 0x00000008 ! SI_ADVANCED = 0x00000010 ! SI_RESET = 0x00000020 ! SI_OWNER_READONLY = 0x00000040 ! SI_EDIT_PROPERTIES = 0x00000080 ! SI_OWNER_RECURSE = 0x00000100 ! SI_NO_ACL_PROTECT = 0x00000200 ! SI_NO_TREE_APPLY = 0x00000400 ! SI_PAGE_TITLE = 0x00000800 ! SI_SERVER_IS_DC = 0x00001000 ! SI_RESET_DACL_TREE = 0x00004000 ! SI_RESET_SACL_TREE = 0x00008000 ! SI_OBJECT_GUID = 0x00010000 ! SI_EDIT_EFFECTIVE = 0x00020000 ! SI_RESET_DACL = 0x00040000 ! SI_RESET_SACL = 0x00080000 ! SI_RESET_OWNER = 0x00100000 ! SI_NO_ADDITIONAL_PERMISSION = 0x00200000 ! SI_MAY_WRITE = 0x10000000 SI_EDIT_ALL = (SI_EDIT_PERMS | SI_EDIT_OWNER | SI_EDIT_AUDITS) ! SI_AUDITS_ELEVATION_REQUIRED = 0x02000000 ! SI_VIEW_ONLY = 0x00400000 ! SI_OWNER_ELEVATION_REQUIRED = 0x04000000 ! SI_PERMS_ELEVATION_REQUIRED = 0x01000000 # SI_ACCESS.dwFlags ! SI_ACCESS_SPECIFIC = 0x00010000 ! SI_ACCESS_GENERAL = 0x00020000 ! SI_ACCESS_CONTAINER = 0x00040000 ! SI_ACCESS_PROPERTY = 0x00080000 # SI_PAGE_TYPE enum *************** *** 686,689 **** SI_PAGE_EFFECTIVE =4 ! CFSTR_ACLUI_SID_INFO_LIST = u"CFSTR_ACLUI_SID_INFO_LIST" PSPCB_SI_INITDIALOG = 1025 ## WM_USER+1 --- 686,689 ---- SI_PAGE_EFFECTIVE =4 ! CFSTR_ACLUI_SID_INFO_LIST = "CFSTR_ACLUI_SID_INFO_LIST" PSPCB_SI_INITDIALOG = 1025 ## WM_USER+1 Index: pywintypes.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/pywintypes.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** pywintypes.py 11 Mar 2008 04:23:31 -0000 1.13 --- pywintypes.py 14 Nov 2008 00:22:25 -0000 1.14 *************** *** 1,4 **** # Magic utility that "redirects" to pywintypesxx.dll ! def __import_pywin32_system_module__(modname, globs): # This has been through a number of iterations. The problem: how to --- 1,5 ---- # Magic utility that "redirects" to pywintypesxx.dll ! import imp, sys, os ! sys.modules['pywintypes_loader']=sys.modules['pywintypes'] def __import_pywin32_system_module__(modname, globs): # This has been through a number of iterations. The problem: how to *************** *** 18,22 **** # on pywintypesXX.dll. It then can check if the DLL we are looking for # lib is already loaded. - import imp, sys, os if not sys.platform.startswith("win32"): # These extensions can be built on Linux via the 'mainwin' toolkit. --- 19,22 ---- *************** *** 34,38 **** globs.update(mod.__dict__) return ! raise ImportError, "No dynamic module " + modname # See if this is a debug build. for suffix_item in imp.get_suffixes(): --- 34,38 ---- globs.update(mod.__dict__) return ! raise ImportError("No dynamic module " + modname) # See if this is a debug build. for suffix_item in imp.get_suffixes(): *************** *** 58,63 **** break else: ! raise ImportError, \ ! "Module '%s' isn't in frozen sys.path %s" % (modname, sys.path) else: # First see if it already in our process - if so, we must use that. --- 58,62 ---- break else: ! raise ImportError("Module '%s' isn't in frozen sys.path %s" % (modname, sys.path)) else: # First see if it already in our process - if so, we must use that. *************** *** 96,102 **** if found is None: # give up in disgust. ! raise ImportError, \ ! "No system module '%s' (%s)" % (modname, filename) ! # Python can load the module mod = imp.load_module(modname, None, found, --- 95,99 ---- if found is None: # give up in disgust. ! raise ImportError("No system module '%s' (%s)" % (modname, filename)) # Python can load the module mod = imp.load_module(modname, None, found, Index: sspi.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/sspi.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sspi.py 13 Feb 2006 14:47:20 -0000 1.3 --- sspi.py 14 Nov 2008 00:22:25 -0000 1.4 *************** *** 18,27 **** error = win32security.error - try: - True, False - except NameError: - False = 1==0 - True = not False - class _BaseAuth(object): def __init__(self): --- 18,21 ---- Index: netbios.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/netbios.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** netbios.py 22 Mar 2006 10:41:05 -0000 1.4 --- netbios.py 14 Nov 2008 00:22:25 -0000 1.5 *************** *** 1,5 **** import win32wnet import struct - import string # Constants generated by h2py from nb30.h --- 1,4 ---- *************** *** 194,198 **** class NCBStruct: def __init__(self, items): ! self._format = string.join(map(lambda item: item[0], items), "") self._items = items self._buffer_ = win32wnet.NCBBuffer(struct.calcsize(self._format)) --- 193,197 ---- class NCBStruct: def __init__(self, items): ! self._format = "".join([item[0] for item in items]) self._items = items self._buffer_ = win32wnet.NCBBuffer(struct.calcsize(self._format)) *************** *** 217,235 **** vals.append(None) ! self._buffer_[:] = apply( struct.pack, (self._format,) + tuple(vals) ) def _unpack(self): items = struct.unpack(self._format, self._buffer_) assert len(items)==len(self._items), "unexpected number of items to unpack!" ! for (format, name), val in map(None, self._items, items): self.__dict__[name] = val def __setattr__(self, attr, val): ! if not self.__dict__.has_key(attr) and attr[0]!='_': for format, attr_name in self._items: if attr==attr_name: break else: ! raise AttributeError, attr self.__dict__[attr] = val --- 216,234 ---- vals.append(None) ! self._buffer_[:] = struct.pack(*(self._format,) + tuple(vals)) def _unpack(self): items = struct.unpack(self._format, self._buffer_) assert len(items)==len(self._items), "unexpected number of items to unpack!" ! for (format, name), val in zip(self._items, items): self.__dict__[name] = val def __setattr__(self, attr, val): ! if attr not in self.__dict__ and attr[0]!='_': for format, attr_name in self._items: if attr==attr_name: break else: ! raise AttributeError(attr) self.__dict__[attr] = val *************** *** 266,270 **** ncb.Buffer = la_enum rc = Netbios(ncb) ! if rc != 0: raise RuntimeError, "Unexpected result %d" % (rc,) for i in range(la_enum.length): ncb.Reset() --- 265,269 ---- ncb.Buffer = la_enum rc = Netbios(ncb) ! if rc != 0: raise RuntimeError("Unexpected result %d" % (rc,)) for i in range(la_enum.length): ncb.Reset() *************** *** 272,276 **** ncb.Lana_num = ord(la_enum.lana[i]) rc = Netbios(ncb) ! if rc != 0: raise RuntimeError, "Unexpected result %d" % (rc,) ncb.Reset() ncb.Command = NCBASTAT --- 271,275 ---- ncb.Lana_num = ord(la_enum.lana[i]) rc = Netbios(ncb) ! if rc != 0: raise RuntimeError("Unexpected result %d" % (rc,)) ncb.Reset() ncb.Command = NCBASTAT Index: mmsystem.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/mmsystem.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mmsystem.py 10 Jan 2006 04:29:49 -0000 1.2 --- mmsystem.py 14 Nov 2008 00:22:25 -0000 1.3 *************** *** 109,119 **** DRV_MCI_FIRST = DRV_RESERVED DRV_MCI_LAST = (DRV_RESERVED + 0xFFF) ! CALLBACK_TYPEMASK = 0x00070000l ! CALLBACK_NULL = 0x00000000l ! CALLBACK_WINDOW = 0x00010000l ! CALLBACK_TASK = 0x00020000l ! CALLBACK_FUNCTION = 0x00030000l CALLBACK_THREAD = (CALLBACK_TASK) ! CALLBACK_EVENT = 0x00050000l SND_SYNC = 0x0000 SND_ASYNC = 0x0001 --- 109,119 ---- DRV_MCI_FIRST = DRV_RESERVED DRV_MCI_LAST = (DRV_RESERVED + 0xFFF) ! CALLBACK_TYPEMASK = 0x00070000 ! CALLBACK_NULL = 0x00000000 ! CALLBACK_WINDOW = 0x00010000 ! CALLBACK_TASK = 0x00020000 ! CALLBACK_FUNCTION = 0x00030000 CALLBACK_THREAD = (CALLBACK_TASK) ! CALLBACK_EVENT = 0x00050000 SND_SYNC = 0x0000 SND_ASYNC = 0x0001 *************** *** 122,130 **** SND_LOOP = 0x0008 SND_NOSTOP = 0x0010 ! SND_NOWAIT = 0x00002000L ! SND_ALIAS = 0x00010000L ! SND_ALIAS_ID = 0x00110000L ! SND_FILENAME = 0x00020000L ! SND_RESOURCE = 0x00040004L SND_PURGE = 0x0040 SND_APPLICATION = 0x0080 --- 122,130 ---- SND_LOOP = 0x0008 SND_NOSTOP = 0x0010 ! SND_NOWAIT = 0x00002000 ! SND_ALIAS = 0x00010000 ! SND_ALIAS_ID = 0x00110000 ! SND_FILENAME = 0x00020000 ! SND_RESOURCE = 0x00040004 SND_PURGE = 0x0040 SND_APPLICATION = 0x0080 *************** *** 141,145 **** WIM_CLOSE = MM_WIM_CLOSE WIM_DATA = MM_WIM_DATA ! WAVE_MAPPER = 0xFFFFFFFFL WAVE_FORMAT_QUERY = 0x0001 WAVE_ALLOWSYNC = 0x0002 --- 141,145 ---- WIM_CLOSE = MM_WIM_CLOSE WIM_DATA = MM_WIM_DATA ! WAVE_MAPPER = -1 # 0xFFFFFFFF WAVE_FORMAT_QUERY = 0x0001 WAVE_ALLOWSYNC = 0x0002 *************** *** 195,199 **** MIM_MOREDATA = MM_MIM_MOREDATA MOM_POSITIONCB = MM_MOM_POSITIONCB ! MIDI_IO_STATUS = 0x00000020L MIDI_CACHE_ALL = 1 MIDI_CACHE_BESTFIT = 2 --- 195,199 ---- MIM_MOREDATA = MM_MIM_MOREDATA MOM_POSITIONCB = MM_MOM_POSITIONCB ! MIDI_IO_STATUS = 0x00000020 MIDI_CACHE_ALL = 1 MIDI_CACHE_BESTFIT = 2 *************** *** 213,228 **** MHDR_INQUEUE = 0x00000004 MHDR_ISSTRM = 0x00000008 ! MEVT_F_SHORT = 0x00000000L ! MEVT_F_LONG = 0x80000000L ! MEVT_F_CALLBACK = 0x40000000L def MEVT_EVENTTYPE(x): return ((BYTE)(((x)>>24)&0xFF)) ! def MEVT_EVENTPARM(x): return ((DWORD)((x)&0x00FFFFFFL)) MIDISTRM_ERROR = (-2) ! MIDIPROP_SET = 0x80000000L ! MIDIPROP_GET = 0x40000000L ! MIDIPROP_TIMEDIV = 0x00000001L ! MIDIPROP_TEMPO = 0x00000002L AUXCAPS_CDAUDIO = 1 AUXCAPS_AUXIN = 2 --- 213,228 ---- MHDR_INQUEUE = 0x00000004 MHDR_ISSTRM = 0x00000008 ! MEVT_F_SHORT = 0x00000000 ! MEVT_F_LONG = -2147483648 # 0x80000000 ! MEVT_F_CALLBACK = 0x40000000 def MEVT_EVENTTYPE(x): return ((BYTE)(((x)>>24)&0xFF)) ! def MEVT_EVENTPARM(x): return ((DWORD)((x)&0x00FFFFFF)) MIDISTRM_ERROR = (-2) ! MIDIPROP_SET = -2147483648 # 0x80000000 ! MIDIPROP_GET = 0x40000000 ! MIDIPROP_TIMEDIV = 0x00000001 ! MIDIPROP_TEMPO = 0x00000002 AUXCAPS_CDAUDIO = 1 AUXCAPS_AUXIN = 2 *************** *** 235,254 **** MIXERR_INVALVALUE = (MIXERR_BASE + 2) MIXERR_LASTERROR = (MIXERR_BASE + 2) ! MIXER_OBJECTF_HANDLE = 0x80000000L ! MIXER_OBJECTF_MIXER = 0x00000000L MIXER_OBJECTF_HMIXER = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIXER) ! MIXER_OBJECTF_WAVEOUT = 0x10000000L MIXER_OBJECTF_HWAVEOUT = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_WAVEOUT) ! MIXER_OBJECTF_WAVEIN = 0x20000000L MIXER_OBJECTF_HWAVEIN = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_WAVEIN) ! MIXER_OBJECTF_MIDIOUT = 0x30000000L MIXER_OBJECTF_HMIDIOUT = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIDIOUT) ! MIXER_OBJECTF_MIDIIN = 0x40000000L MIXER_OBJECTF_HMIDIIN = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIDIIN) ! MIXER_OBJECTF_AUX = 0x50000000L ! MIXERLINE_LINEF_ACTIVE = 0x00000001L ! MIXERLINE_LINEF_DISCONNECTED = 0x00008000L ! MIXERLINE_LINEF_SOURCE = 0x80000000L ! MIXERLINE_COMPONENTTYPE_DST_FIRST = 0x00000000L MIXERLINE_COMPONENTTYPE_DST_UNDEFINED = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 0) MIXERLINE_COMPONENTTYPE_DST_DIGITAL = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 1) --- 235,254 ---- MIXERR_INVALVALUE = (MIXERR_BASE + 2) MIXERR_LASTERROR = (MIXERR_BASE + 2) ! MIXER_OBJECTF_HANDLE = -2147483648 # 0x80000000 ! MIXER_OBJECTF_MIXER = 0x00000000 MIXER_OBJECTF_HMIXER = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIXER) ! MIXER_OBJECTF_WAVEOUT = 0x10000000 MIXER_OBJECTF_HWAVEOUT = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_WAVEOUT) ! MIXER_OBJECTF_WAVEIN = 0x20000000 MIXER_OBJECTF_HWAVEIN = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_WAVEIN) ! MIXER_OBJECTF_MIDIOUT = 0x30000000 MIXER_OBJECTF_HMIDIOUT = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIDIOUT) ! MIXER_OBJECTF_MIDIIN = 0x40000000 MIXER_OBJECTF_HMIDIIN = (MIXER_OBJECTF_HANDLE|MIXER_OBJECTF_MIDIIN) ! MIXER_OBJECTF_AUX = 0x50000000 ! MIXERLINE_LINEF_ACTIVE = 0x00000001 ! MIXERLINE_LINEF_DISCONNECTED = 0x00008000 ! MIXERLINE_LINEF_SOURCE = -2147483648 # 0x80000000 ! MIXERLINE_COMPONENTTYPE_DST_FIRST = 0x00000000 MIXERLINE_COMPONENTTYPE_DST_UNDEFINED = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 0) MIXERLINE_COMPONENTTYPE_DST_DIGITAL = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 1) *************** *** 261,265 **** MIXERLINE_COMPONENTTYPE_DST_VOICEIN = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8) MIXERLINE_COMPONENTTYPE_DST_LAST = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8) ! MIXERLINE_COMPONENTTYPE_SRC_FIRST = 0x00001000L MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 0) MIXERLINE_COMPONENTTYPE_SRC_DIGITAL = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 1) --- 261,265 ---- MIXERLINE_COMPONENTTYPE_DST_VOICEIN = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8) MIXERLINE_COMPONENTTYPE_DST_LAST = (MIXERLINE_COMPONENTTYPE_DST_FIRST + 8) ! MIXERLINE_COMPONENTTYPE_SRC_FIRST = 0x00001000 MIXERLINE_COMPONENTTYPE_SRC_UNDEFINED = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 0) MIXERLINE_COMPONENTTYPE_SRC_DIGITAL = (MIXERLINE_COMPONENTTYPE_SRC_FIRST + 1) *************** *** 280,316 **** MIXERLINE_TARGETTYPE_MIDIIN = 4 MIXERLINE_TARGETTYPE_AUX = 5 ! MIXER_GETLINEINFOF_DESTINATION = 0x00000000L ! MIXER_GETLINEINFOF_SOURCE = 0x00000001L ! MIXER_GETLINEINFOF_LINEID = 0x00000002L ! MIXER_GETLINEINFOF_COMPONENTTYPE = 0x00000003L ! MIXER_GETLINEINFOF_TARGETTYPE = 0x00000004L ! MIXER_GETLINEINFOF_QUERYMASK = 0x0000000FL ! MIXERCONTROL_CONTROLF_UNIFORM = 0x00000001L ! MIXERCONTROL_CONTROLF_MULTIPLE = 0x00000002L ! MIXERCONTROL_CONTROLF_DISABLED = 0x80000000L ! MIXERCONTROL_CT_CLASS_MASK = 0xF0000000L ! MIXERCONTROL_CT_CLASS_CUSTOM = 0x00000000L ! MIXERCONTROL_CT_CLASS_METER = 0x10000000L ! MIXERCONTROL_CT_CLASS_SWITCH = 0x20000000L ! MIXERCONTROL_CT_CLASS_NUMBER = 0x30000000L ! MIXERCONTROL_CT_CLASS_SLIDER = 0x40000000L ! MIXERCONTROL_CT_CLASS_FADER = 0x50000000L ! MIXERCONTROL_CT_CLASS_TIME = 0x60000000L ! MIXERCONTROL_CT_CLASS_LIST = 0x70000000L ! MIXERCONTROL_CT_SUBCLASS_MASK = 0x0F000000L ! MIXERCONTROL_CT_SC_SWITCH_BOOLEAN = 0x00000000L ! MIXERCONTROL_CT_SC_SWITCH_BUTTON = 0x01000000L ! MIXERCONTROL_CT_SC_METER_POLLED = 0x00000000L ! MIXERCONTROL_CT_SC_TIME_MICROSECS = 0x00000000L ! MIXERCONTROL_CT_SC_TIME_MILLISECS = 0x01000000L ! MIXERCONTROL_CT_SC_LIST_SINGLE = 0x00000000L ! MIXERCONTROL_CT_SC_LIST_MULTIPLE = 0x01000000L ! MIXERCONTROL_CT_UNITS_MASK = 0x00FF0000L ! MIXERCONTROL_CT_UNITS_CUSTOM = 0x00000000L ! MIXERCONTROL_CT_UNITS_BOOLEAN = 0x00010000L ! MIXERCONTROL_CT_UNITS_SIGNED = 0x00020000L ! MIXERCONTROL_CT_UNITS_UNSIGNED = 0x00030000L ! MIXERCONTROL_CT_UNITS_DECIBELS = 0x00040000L ! MIXERCONTROL_CT_UNITS_PERCENT = 0x00050000L MIXERCONTROL_CONTROLTYPE_CUSTOM = (MIXERCONTROL_CT_CLASS_CUSTOM | MIXERCONTROL_CT_UNITS_CUSTOM) MIXERCONTROL_CONTROLTYPE_BOOLEANMETER = (MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_BOOLEAN) --- 280,316 ---- MIXERLINE_TARGETTYPE_MIDIIN = 4 MIXERLINE_TARGETTYPE_AUX = 5 ! MIXER_GETLINEINFOF_DESTINATION = 0x00000000 ! MIXER_GETLINEINFOF_SOURCE = 0x00000001 ! MIXER_GETLINEINFOF_LINEID = 0x00000002 ! MIXER_GETLINEINFOF_COMPONENTTYPE = 0x00000003 ! MIXER_GETLINEINFOF_TARGETTYPE = 0x00000004 ! MIXER_GETLINEINFOF_QUERYMASK = 0x0000000F ! MIXERCONTROL_CONTROLF_UNIFORM = 0x00000001 ! MIXERCONTROL_CONTROLF_MULTIPLE = 0x00000002 ! MIXERCONTROL_CONTROLF_DISABLED = -2147483648 # 0x80000000 ! MIXERCONTROL_CT_CLASS_MASK = -268435456 # 0xF0000000 ! MIXERCONTROL_CT_CLASS_CUSTOM = 0x00000000 ! MIXERCONTROL_CT_CLASS_METER = 0x10000000 ! MIXERCONTROL_CT_CLASS_SWITCH = 0x20000000 ! MIXERCONTROL_CT_CLASS_NUMBER = 0x30000000 ! MIXERCONTROL_CT_CLASS_SLIDER = 0x40000000 ! MIXERCONTROL_CT_CLASS_FADER = 0x50000000 ! MIXERCONTROL_CT_CLASS_TIME = 0x60000000 ! MIXERCONTROL_CT_CLASS_LIST = 0x70000000 ! MIXERCONTROL_CT_SUBCLASS_MASK = 0x0F000000 ! MIXERCONTROL_CT_SC_SWITCH_BOOLEAN = 0x00000000 ! MIXERCONTROL_CT_SC_SWITCH_BUTTON = 0x01000000 ! MIXERCONTROL_CT_SC_METER_POLLED = 0x00000000 ! MIXERCONTROL_CT_SC_TIME_MICROSECS = 0x00000000 ! MIXERCONTROL_CT_SC_TIME_MILLISECS = 0x01000000 ! MIXERCONTROL_CT_SC_LIST_SINGLE = 0x00000000 ! MIXERCONTROL_CT_SC_LIST_MULTIPLE = 0x01000000 ! MIXERCONTROL_CT_UNITS_MASK = 0x00FF0000 ! MIXERCONTROL_CT_UNITS_CUSTOM = 0x00000000 ! MIXERCONTROL_CT_UNITS_BOOLEAN = 0x00010000 ! MIXERCONTROL_CT_UNITS_SIGNED = 0x00020000 ! MIXERCONTROL_CT_UNITS_UNSIGNED = 0x00030000 ! MIXERCONTROL_CT_UNITS_DECIBELS = 0x00040000 ! MIXERCONTROL_CT_UNITS_PERCENT = 0x00050000 MIXERCONTROL_CONTROLTYPE_CUSTOM = (MIXERCONTROL_CT_CLASS_CUSTOM | MIXERCONTROL_CT_UNITS_CUSTOM) MIXERCONTROL_CONTROLTYPE_BOOLEANMETER = (MIXERCONTROL_CT_CLASS_METER | MIXERCONTROL_CT_SC_METER_POLLED | MIXERCONTROL_CT_UNITS_BOOLEAN) *************** *** 343,356 **** MIXERCONTROL_CONTROLTYPE_MICROTIME = (MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MICROSECS | MIXERCONTROL_CT_UNITS_UNSIGNED) MIXERCONTROL_CONTROLTYPE_MILLITIME = (MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MILLISECS | MIXERCONTROL_CT_UNITS_UNSIGNED) ! MIXER_GETLINECONTROLSF_ALL = 0x00000000L ! MIXER_GETLINECONTROLSF_ONEBYID = 0x00000001L ! MIXER_GETLINECONTROLSF_ONEBYTYPE = 0x00000002L ! MIXER_GETLINECONTROLSF_QUERYMASK = 0x0000000FL ! MIXER_GETCONTROLDETAILSF_VALUE = 0x00000000L ! MIXER_GETCONTROLDETAILSF_LISTTEXT = 0x00000001L ! MIXER_GETCONTROLDETAILSF_QUERYMASK = 0x0000000FL ! MIXER_SETCONTROLDETAILSF_VALUE = 0x00000000L ! MIXER_SETCONTROLDETAILSF_CUSTOM = 0x00000001L ! MIXER_SETCONTROLDETAILSF_QUERYMASK = 0x0000000FL TIMERR_NOERROR = (0) TIMERR_NOCANDO = (TIMERR_BASE+1) --- 343,356 ---- MIXERCONTROL_CONTROLTYPE_MICROTIME = (MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MICROSECS | MIXERCONTROL_CT_UNITS_UNSIGNED) MIXERCONTROL_CONTROLTYPE_MILLITIME = (MIXERCONTROL_CT_CLASS_TIME | MIXERCONTROL_CT_SC_TIME_MILLISECS | MIXERCONTROL_CT_UNITS_UNSIGNED) ! MIXER_GETLINECONTROLSF_ALL = 0x00000000 ! MIXER_GETLINECONTROLSF_ONEBYID = 0x00000001 ! MIXER_GETLINECONTROLSF_ONEBYTYPE = 0x00000002 ! MIXER_GETLINECONTROLSF_QUERYMASK = 0x0000000F ! MIXER_GETCONTROLDETAILSF_VALUE = 0x00000000 ! MIXER_GETCONTROLDETAILSF_LISTTEXT = 0x00000001 ! MIXER_GETCONTROLDETAILSF_QUERYMASK = 0x0000000F ! MIXER_SETCONTROLDETAILSF_VALUE = 0x00000000 ! MIXER_SETCONTROLDETAILSF_CUSTOM = 0x00000001 ! MIXER_SETCONTROLDETAILSF_QUERYMASK = 0x0000000F TIMERR_NOERROR = (0) TIMERR_NOCANDO = (TIMERR_BASE+1) *************** *** 373,435 **** JOY_BUTTON3CHG = 0x0400 JOY_BUTTON4CHG = 0x0800 ! JOY_BUTTON5 = 0x00000010l ! JOY_BUTTON6 = 0x00000020l ! JOY_BUTTON7 = 0x00000040l ! JOY_BUTTON8 = 0x00000080l ! JOY_BUTTON9 = 0x00000100l ! JOY_BUTTON10 = 0x00000200l ! JOY_BUTTON11 = 0x00000400l ! JOY_BUTTON12 = 0x00000800l ! JOY_BUTTON13 = 0x00001000l ! JOY_BUTTON14 = 0x00002000l ! JOY_BUTTON15 = 0x00004000l ! JOY_BUTTON16 = 0x00008000l ! JOY_BUTTON17 = 0x00010000l ! JOY_BUTTON18 = 0x00020000l ! JOY_BUTTON19 = 0x00040000l ! JOY_BUTTON20 = 0x00080000l ! JOY_BUTTON21 = 0x00100000l ! JOY_BUTTON22 = 0x00200000l ! JOY_BUTTON23 = 0x00400000l ! JOY_BUTTON24 = 0x00800000l ! JOY_BUTTON25 = 0x01000000l ! JOY_BUTTON26 = 0x02000000l ! JOY_BUTTON27 = 0x04000000l ! JOY_BUTTON28 = 0x08000000l ! JOY_BUTTON29 = 0x10000000l ! JOY_BUTTON30 = 0x20000000l ! JOY_BUTTON31 = 0x40000000l ! JOY_BUTTON32 = 0x80000000l JOY_POVFORWARD = 0 JOY_POVRIGHT = 9000 JOY_POVBACKWARD = 18000 JOY_POVLEFT = 27000 ! JOY_RETURNX = 0x00000001l ! JOY_RETURNY = 0x00000002l ! JOY_RETURNZ = 0x00000004l ! JOY_RETURNR = 0x00000008l ! JOY_RETURNU = 0x00000010l ! JOY_RETURNV = 0x00000020l ! JOY_RETURNPOV = 0x00000040l ! JOY_RETURNBUTTONS = 0x00000080l ! JOY_RETURNRAWDATA = 0x00000100l ! JOY_RETURNPOVCTS = 0x00000200l ! JOY_RETURNCENTERED = 0x00000400l ! JOY_USEDEADZONE = 0x00000800l JOY_RETURNALL = (JOY_RETURNX | JOY_RETURNY | JOY_RETURNZ | \ JOY_RETURNR | JOY_RETURNU | JOY_RETURNV | \ JOY_RETURNPOV | JOY_RETURNBUTTONS) ! JOY_CAL_READALWAYS = 0x00010000l ! JOY_CAL_READXYONLY = 0x00020000l ! JOY_CAL_READ3 = 0x00040000l ! JOY_CAL_READ4 = 0x00080000l ! JOY_CAL_READXONLY = 0x00100000l ! JOY_CAL_READYONLY = 0x00200000l ! JOY_CAL_READ5 = 0x00400000l ! JOY_CAL_READ6 = 0x00800000l ! JOY_CAL_READZONLY = 0x01000000l ! JOY_CAL_READRONLY = 0x02000000l ! JOY_CAL_READUONLY = 0x04000000l ! JOY_CAL_READVONLY = 0x08000000l JOYSTICKID1 = 0 JOYSTICKID2 = 1 --- 373,435 ---- JOY_BUTTON3CHG = 0x0400 JOY_BUTTON4CHG = 0x0800 ! JOY_BUTTON5 = 0x00000010 ! JOY_BUTTON6 = 0x00000020 ! JOY_BUTTON7 = 0x00000040 ! JOY_BUTTON8 = 0x00000080 ! JOY_BUTTON9 = 0x00000100 ! JOY_BUTTON10 = 0x00000200 ! JOY_BUTTON11 = 0x00000400 ! JOY_BUTTON12 = 0x00000800 ! JOY_BUTTON13 = 0x00001000 ! JOY_BUTTON14 = 0x00002000 ! JOY_BUTTON15 = 0x00004000 ! JOY_BUTTON16 = 0x00008000 ! JOY_BUTTON17 = 0x00010000 ! JOY_BUTTON18 = 0x00020000 ! JOY_BUTTON19 = 0x00040000 ! JOY_BUTTON20 = 0x00080000 ! JOY_BUTTON21 = 0x00100000 ! JOY_BUTTON22 = 0x00200000 ! JOY_BUTTON23 = 0x00400000 ! JOY_BUTTON24 = 0x00800000 ! JOY_BUTTON25 = 0x01000000 ! JOY_BUTTON26 = 0x02000000 ! JOY_BUTTON27 = 0x04000000 ! JOY_BUTTON28 = 0x08000000 ! JOY_BUTTON29 = 0x10000000 ! JOY_BUTTON30 = 0x20000000 ! JOY_BUTTON31 = 0x40000000 ! JOY_BUTTON32 = -2147483648 # 0x80000000 JOY_POVFORWARD = 0 JOY_POVRIGHT = 9000 JOY_POVBACKWARD = 18000 JOY_POVLEFT = 27000 ! JOY_RETURNX = 0x00000001 ! JOY_RETURNY = 0x00000002 ! JOY_RETURNZ = 0x00000004 ! JOY_RETURNR = 0x00000008 ! JOY_RETURNU = 0x00000010 ! JOY_RETURNV = 0x00000020 ! JOY_RETURNPOV = 0x00000040 ! JOY_RETURNBUTTONS = 0x00000080 ! JOY_RETURNRAWDATA = 0x00000100 ! JOY_RETURNPOVCTS = 0x00000200 ! JOY_RETURNCENTERED = 0x00000400 ! JOY_USEDEADZONE = 0x00000800 JOY_RETURNALL = (JOY_RETURNX | JOY_RETURNY | JOY_RETURNZ | \ JOY_RETURNR | JOY_RETURNU | JOY_RETURNV | \ JOY_RETURNPOV | JOY_RETURNBUTTONS) ! JOY_CAL_READALWAYS = 0x00010000 ! JOY_CAL_READXYONLY = 0x00020000 ! JOY_CAL_READ3 = 0x00040000 ! JOY_CAL_READ4 = 0x00080000 ! JOY_CAL_READXONLY = 0x00100000 ! JOY_CAL_READYONLY = 0x00200000 ! JOY_CAL_READ5 = 0x00400000 ! JOY_CAL_READ6 = 0x00800000 ! JOY_CAL_READZONLY = 0x01000000 ! JOY_CAL_READRONLY = 0x02000000 ! JOY_CAL_READUONLY = 0x04000000 ! JOY_CAL_READVONLY = 0x08000000 JOYSTICKID1 = 0 JOYSTICKID2 = 1 *************** *** 667,730 **** MCI_NOTIFY_ABORTED = 0x0004 MCI_NOTIFY_FAILURE = 0x0008 ! MCI_NOTIFY = 0x00000001L ! MCI_WAIT = 0x00000002L ! MCI_FROM = 0x00000004L ! MCI_TO = 0x00000008L ! MCI_TRACK = 0x00000010L ! MCI_OPEN_SHAREABLE = 0x00000100L ! MCI_OPEN_ELEMENT = 0x00000200L ! MCI_OPEN_ALIAS = 0x00000400L ! MCI_OPEN_ELEMENT_ID = 0x00000800L ! MCI_OPEN_TYPE_ID = 0x00001000L ! MCI_OPEN_TYPE = 0x00002000L ! MCI_SEEK_TO_START = 0x00000100L ! MCI_SEEK_TO_END = 0x00000200L ! MCI_STATUS_ITEM = 0x00000100L ! MCI_STATUS_START = 0x00000200L ! MCI_STATUS_LENGTH = 0x00000001L ! MCI_STATUS_POSITION = 0x00000002L ! MCI_STATUS_NUMBER_OF_TRACKS = 0x00000003L ! MCI_STATUS_MODE = 0x00000004L ! MCI_STATUS_MEDIA_PRESENT = 0x00000005L ! MCI_STATUS_TIME_FORMAT = 0x00000006L ! MCI_STATUS_READY = 0x00000007L ! MCI_STATUS_CURRENT_TRACK = 0x00000008L ! MCI_INFO_PRODUCT = 0x00000100L ! MCI_INFO_FILE = 0x00000200L ! MCI_INFO_MEDIA_UPC = 0x00000400L ! MCI_INFO_MEDIA_IDENTITY = 0x00000800L ! MCI_INFO_NAME = 0x00001000L ! MCI_INFO_COPYRIGHT = 0x00002000L ! MCI_GETDEVCAPS_ITEM = 0x00000100L ! MCI_GETDEVCAPS_CAN_RECORD = 0x00000001L ! MCI_GETDEVCAPS_HAS_AUDIO = 0x00000002L ! MCI_GETDEVCAPS_HAS_VIDEO = 0x00000003L ! MCI_GETDEVCAPS_DEVICE_TYPE = 0x00000004L ! MCI_GETDEVCAPS_USES_FILES = 0x00000005L ! MCI_GETDEVCAPS_COMPOUND_DEVICE = 0x00000006L ! MCI_GETDEVCAPS_CAN_EJECT = 0x00000007L ! MCI_GETDEVCAPS_CAN_PLAY = 0x00000008L ! MCI_GETDEVCAPS_CAN_SAVE = 0x00000009L ! MCI_SYSINFO_QUANTITY = 0x00000100L ! MCI_SYSINFO_OPEN = 0x00000200L ! MCI_SYSINFO_NAME = 0x00000400L ! MCI_SYSINFO_INSTALLNAME = 0x00000800L ! MCI_SET_DOOR_OPEN = 0x00000100L ! MCI_SET_DOOR_CLOSED = 0x00000200L ! MCI_SET_TIME_FORMAT = 0x00000400L ! MCI_SET_AUDIO = 0x00000800L ! MCI_SET_VIDEO = 0x00001000L ! MCI_SET_ON = 0x00002000L ! MCI_SET_OFF = 0x00004000L ! MCI_SET_AUDIO_ALL = 0x00000000L ! MCI_SET_AUDIO_LEFT = 0x00000001L ! MCI_SET_AUDIO_RIGHT = 0x00000002L ! MCI_BREAK_KEY = 0x00000100L ! MCI_BREAK_HWND = 0x00000200L ! MCI_BREAK_OFF = 0x00000400L ! MCI_RECORD_INSERT = 0x00000100L ! MCI_RECORD_OVERWRITE = 0x00000200L ! MCI_SAVE_FILE = 0x00000100L ! MCI_LOAD_FILE = 0x00000100L MCI_VD_MODE_PARK = (MCI_VD_OFFSET + 1) MCI_VD_MEDIA_CLV = (MCI_VD_OFFSET + 2) --- 667,730 ---- MCI_NOTIFY_ABORTED = 0x0004 MCI_NOTIFY_FAILURE = 0x0008 ! MCI_NOTIFY = 0x00000001 ! MCI_WAIT = 0x00000002 ! MCI_FROM = 0x00000004 ! MCI_TO = 0x00000008 ! MCI_TRACK = 0x00000010 ! MCI_OPEN_SHAREABLE = 0x00000100 ! MCI_OPEN_ELEMENT = 0x00000200 ! MCI_OPEN_ALIAS = 0x00000400 ! MCI_OPEN_ELEMENT_ID = 0x00000800 ! MCI_OPEN_TYPE_ID = 0x00001000 ! MCI_OPEN_TYPE = 0x00002000 ! MCI_SEEK_TO_START = 0x00000100 ! MCI_SEEK_TO_END = 0x00000200 ! MCI_STATUS_ITEM = 0x00000100 ! MCI_STATUS_START = 0x00000200 ! MCI_STATUS_LENGTH = 0x00000001 ! MCI_STATUS_POSITION = 0x00000002 ! MCI_STATUS_NUMBER_OF_TRACKS = 0x00000003 ! MCI_STATUS_MODE = 0x00000004 ! MCI_STATUS_MEDIA_PRESENT = 0x00000005 ! MCI_STATUS_TIME_FORMAT = 0x00000006 ! MCI_STATUS_READY = 0x00000007 ! MCI_STATUS_CURRENT_TRACK = 0x00000008 ! MCI_INFO_PRODUCT = 0x00000100 ! MCI_INFO_FILE = 0x00000200 ! MCI_INFO_MEDIA_UPC = 0x00000400 ! MCI_INFO_MEDIA_IDENTITY = 0x00000800 ! MCI_INFO_NAME = 0x00001000 ! MCI_INFO_COPYRIGHT = 0x00002000 ! MCI_GETDEVCAPS_ITEM = 0x00000100 ! MCI_GETDEVCAPS_CAN_RECORD = 0x00000001 ! MCI_GETDEVCAPS_HAS_AUDIO = 0x00000002 ! MCI_GETDEVCAPS_HAS_VIDEO = 0x00000003 ! MCI_GETDEVCAPS_DEVICE_TYPE = 0x00000004 ! MCI_GETDEVCAPS_USES_FILES = 0x00000005 ! MCI_GETDEVCAPS_COMPOUND_DEVICE = 0x00000006 ! MCI_GETDEVCAPS_CAN_EJECT = 0x00000007 ! MCI_GETDEVCAPS_CAN_PLAY = 0x00000008 ! MCI_GETDEVCAPS_CAN_SAVE = 0x00000009 ! MCI_SYSINFO_QUANTITY = 0x00000100 ! MCI_SYSINFO_OPEN = 0x00000200 ! MCI_SYSINFO_NAME = 0x00000400 ! MCI_SYSINFO_INSTALLNAME = 0x00000800 ! MCI_SET_DOOR_OPEN = 0x00000100 ! MCI_SET_DOOR_CLOSED = 0x00000200 ! MCI_SET_TIME_FORMAT = 0x00000400 ! MCI_SET_AUDIO = 0x00000800 ! MCI_SET_VIDEO = 0x00001000 ! MCI_SET_ON = 0x00002000 ! MCI_SET_OFF = 0x00004000 ! MCI_SET_AUDIO_ALL = 0x00000000 ! MCI_SET_AUDIO_LEFT = 0x00000001 ! MCI_SET_AUDIO_RIGHT = 0x00000002 ! MCI_BREAK_KEY = 0x00000100 ! MCI_BREAK_HWND = 0x00000200 ! MCI_BREAK_OFF = 0x00000400 ! MCI_RECORD_INSERT = 0x00000100 ! MCI_RECORD_OVERWRITE = 0x00000200 ! MCI_SAVE_FILE = 0x00000100 ! MCI_LOAD_FILE = 0x00000100 MCI_VD_MODE_PARK = (MCI_VD_OFFSET + 1) MCI_VD_MEDIA_CLV = (MCI_VD_OFFSET + 2) *************** *** 732,782 **** MCI_VD_MEDIA_OTHER = (MCI_VD_OFFSET + 4) MCI_VD_FORMAT_TRACK = 0x4001 ! MCI_VD_PLAY_REVERSE = 0x00010000L ! MCI_VD_PLAY_FAST = 0x00020000L ! MCI_VD_PLAY_SPEED = 0x00040000L ! MCI_VD_PLAY_SCAN = 0x00080000L ! MCI_VD_PLAY_SLOW = 0x00100000L ! MCI_VD_SEEK_REVERSE = 0x00010000L ! MCI_VD_STATUS_SPEED = 0x00004002L ! MCI_VD_STATUS_FORWARD = 0x00004003L ! MCI_VD_STATUS_MEDIA_TYPE = 0x00004004L ! MCI_VD_STATUS_SIDE = 0x00004005L ! MCI_VD_STATUS_DISC_SIZE = 0x00004006L ! MCI_VD_GETDEVCAPS_CLV = 0x00010000L ! MCI_VD_GETDEVCAPS_CAV = 0x00020000L ! MCI_VD_SPIN_UP = 0x00010000L ! MCI_VD_SPIN_DOWN = 0x00020000L ! MCI_VD_GETDEVCAPS_CAN_REVERSE = 0x00004002L ! MCI_VD_GETDEVCAPS_FAST_RATE = 0x00004003L ! MCI_VD_GETDEVCAPS_SLOW_RATE = 0x00004004L ! MCI_VD_GETDEVCAPS_NORMAL_RATE = 0x00004005L ! MCI_VD_STEP_FRAMES = 0x00010000L ! MCI_VD_STEP_REVERSE = 0x00020000L ! MCI_VD_ESCAPE_STRING = 0x00000100L ! MCI_CDA_STATUS_TYPE_TRACK = 0x00004001L MCI_CDA_TRACK_AUDIO = (MCI_CD_OFFSET + 0) MCI_CDA_TRACK_OTHER = (MCI_CD_OFFSET + 1) MCI_WAVE_PCM = (MCI_WAVE_OFFSET + 0) MCI_WAVE_MAPPER = (MCI_WAVE_OFFSET + 1) ! MCI_WAVE_OPEN_BUFFER = 0x00010000L ! MCI_WAVE_SET_FORMATTAG = 0x00010000L ! MCI_WAVE_SET_CHANNELS = 0x00020000L ! MCI_WAVE_SET_SAMPLESPERSEC = 0x00040000L ! MCI_WAVE_SET_AVGBYTESPERSEC = 0x00080000L ! MCI_WAVE_SET_BLOCKALIGN = 0x00100000L ! MCI_WAVE_SET_BITSPERSAMPLE = 0x00200000L ! MCI_WAVE_INPUT = 0x00400000L ! MCI_WAVE_OUTPUT = 0x00800000L ! MCI_WAVE_STATUS_FORMATTAG = 0x00004001L ! MCI_WAVE_STATUS_CHANNELS = 0x00004002L ! MCI_WAVE_STATUS_SAMPLESPERSEC = 0x00004003L ! MCI_WAVE_STATUS_AVGBYTESPERSEC = 0x00004004L ! MCI_WAVE_STATUS_BLOCKALIGN = 0x00004005L ! MCI_WAVE_STATUS_BITSPERSAMPLE = 0x00004006L ! MCI_WAVE_STATUS_LEVEL = 0x00004007L ! MCI_WAVE_SET_ANYINPUT = 0x04000000L ! MCI_WAVE_SET_ANYOUTPUT = 0x08000000L ! MCI_WAVE_GETDEVCAPS_INPUTS = 0x00004001L ! MCI_WAVE_GETDEVCAPS_OUTPUTS = 0x00004002L MCI_SEQ_DIV_PPQN = (0 + MCI_SEQ_OFFSET) MCI_SEQ_DIV_SMPTE_24 = (1 + MCI_SEQ_OFFSET) --- 732,782 ---- MCI_VD_MEDIA_OTHER = (MCI_VD_OFFSET + 4) MCI_VD_FORMAT_TRACK = 0x4001 ! MCI_VD_PLAY_REVERSE = 0x00010000 ! MCI_VD_PLAY_FAST = 0x00020000 ! MCI_VD_PLAY_SPEED = 0x00040000 ! MCI_VD_PLAY_SCAN = 0x00080000 ! MCI_VD_PLAY_SLOW = 0x00100000 ! MCI_VD_SEEK_REVERSE = 0x00010000 ! MCI_VD_STATUS_SPEED = 0x00004002 ! MCI_VD_STATUS_FORWARD = 0x00004003 ! MCI_VD_STATUS_MEDIA_TYPE = 0x00004004 ! MCI_VD_STATUS_SIDE = 0x00004005 ! MCI_VD_STATUS_DISC_SIZE = 0x00004006 ! MCI_VD_GETDEVCAPS_CLV = 0x00010000 ! MCI_VD_GETDEVCAPS_CAV = 0x00020000 ! MCI_VD_SPIN_UP = 0x00010000 ! MCI_VD_SPIN_DOWN = 0x00020000 ! MCI_VD_GETDEVCAPS_CAN_REVERSE = 0x00004002 ! MCI_VD_GETDEVCAPS_FAST_RATE = 0x00004003 ! MCI_VD_GETDEVCAPS_SLOW_RATE = 0x00004004 ! MCI_VD_GETDEVCAPS_NORMAL_RATE = 0x00004005 ! MCI_VD_STEP_FRAMES = 0x00010000 ! MCI_VD_STEP_REVERSE = 0x00020000 ! MCI_VD_ESCAPE_STRING = 0x00000100 ! MCI_CDA_STATUS_TYPE_TRACK = 0x00004001 MCI_CDA_TRACK_AUDIO = (MCI_CD_OFFSET + 0) MCI_CDA_TRACK_OTHER = (MCI_CD_OFFSET + 1) MCI_WAVE_PCM = (MCI_WAVE_OFFSET + 0) MCI_WAVE_MAPPER = (MCI_WAVE_OFFSET + 1) ! MCI_WAVE_OPEN_BUFFER = 0x00010000 ! MCI_WAVE_SET_FORMATTAG = 0x00010000 ! MCI_WAVE_SET_CHANNELS = 0x00020000 ! MCI_WAVE_SET_SAMPLESPERSEC = 0x00040000 ! MCI_WAVE_SET_AVGBYTESPERSEC = 0x00080000 ! MCI_WAVE_SET_BLOCKALIGN = 0x00100000 ! MCI_WAVE_SET_BITSPERSAMPLE = 0x00200000 ! MCI_WAVE_INPUT = 0x00400000 ! MCI_WAVE_OUTPUT = 0x00800000 ! MCI_WAVE_STATUS_FORMATTAG = 0x00004001 ! MCI_WAVE_STATUS_CHANNELS = 0x00004002 ! MCI_WAVE_STATUS_SAMPLESPERSEC = 0x00004003 ! MCI_WAVE_STATUS_AVGBYTESPERSEC = 0x00004004 ! MCI_WAVE_STATUS_BLOCKALIGN = 0x00004005 ! MCI_WAVE_STATUS_BITSPERSAMPLE = 0x00004006 ! MCI_WAVE_STATUS_LEVEL = 0x00004007 ! MCI_WAVE_SET_ANYINPUT = 0x04000000 ! MCI_WAVE_SET_ANYOUTPUT = 0x08000000 ! MCI_WAVE_GETDEVCAPS_INPUTS = 0x00004001 ! MCI_WAVE_GETDEVCAPS_OUTPUTS = 0x00004002 MCI_SEQ_DIV_PPQN = (0 + MCI_SEQ_OFFSET) MCI_SEQ_DIV_SMPTE_24 = (1 + MCI_SEQ_OFFSET) *************** *** 790,866 **** MCI_SEQ_NONE = 65533 MCI_SEQ_MAPPER = 65535 ! MCI_SEQ_STATUS_TEMPO = 0x00004002L ! MCI_SEQ_STATUS_PORT = 0x00004003L ! MCI_SEQ_STATUS_SLAVE = 0x00004007L ! MCI_SEQ_STATUS_MASTER = 0x00004008L ! MCI_SEQ_STATUS_OFFSET = 0x00004009L ! MCI_SEQ_STATUS_DIVTYPE = 0x0000400AL ! MCI_SEQ_STATUS_NAME = 0x0000400BL ! MCI_SEQ_STATUS_COPYRIGHT = 0x0000400CL ! MCI_SEQ_SET_TEMPO = 0x00010000L ! MCI_SEQ_SET_PORT = 0x00020000L ! MCI_SEQ_SET_SLAVE = 0x00040000L ! MCI_SEQ_SET_MASTER = 0x00080000L ! MCI_SEQ_SET_OFFSET = 0x01000000L ! MCI_ANIM_OPEN_WS = 0x00010000L ! MCI_ANIM_OPEN_PARENT = 0x00020000L ! MCI_ANIM_OPEN_NOSTATIC = 0x00040000L ! MCI_ANIM_PLAY_SPEED = 0x00010000L ! MCI_ANIM_PLAY_REVERSE = 0x00020000L ! MCI_ANIM_PLAY_FAST = 0x00040000L ! MCI_ANIM_PLAY_SLOW = 0x00080000L ! MCI_ANIM_PLAY_SCAN = 0x00100000L ! MCI_ANIM_STEP_REVERSE = 0x00010000L ! MCI_ANIM_STEP_FRAMES = 0x00020000L ! MCI_ANIM_STATUS_SPEED = 0x00004001L ! MCI_ANIM_STATUS_FORWARD = 0x00004002L ! MCI_ANIM_STATUS_HWND = 0x00004003L ! MCI_ANIM_STATUS_HPAL = 0x00004004L ! MCI_ANIM_STATUS_STRETCH = 0x00004005L ! MCI_ANIM_INFO_TEXT = 0x00010000L ! MCI_ANIM_GETDEVCAPS_CAN_REVERSE = 0x00004001L ! MCI_ANIM_GETDEVCAPS_FAST_RATE = 0x00004002L ! MCI_ANIM_GETDEVCAPS_SLOW_RATE = 0x00004003L ! MCI_ANIM_GETDEVCAPS_NORMAL_RATE = 0x00004004L ! MCI_ANIM_GETDEVCAPS_PALETTES = 0x00004006L ! MCI_ANIM_GETDEVCAPS_CAN_STRETCH = 0x00004007L ! MCI_ANIM_GETDEVCAPS_MAX_WINDOWS = 0x00004008L ! MCI_ANIM_REALIZE_NORM = 0x00010000L ! MCI_ANIM_REALIZE_BKGD = 0x00020000L ! MCI_ANIM_WINDOW_HWND = 0x00010000L ! MCI_ANIM_WINDOW_STATE = 0x00040000L ! MCI_ANIM_WINDOW_TEXT = 0x00080000L ! MCI_ANIM_WINDOW_ENABLE_STRETCH = 0x00100000L ! MCI_ANIM_WINDOW_DISABLE_STRETCH = 0x00200000L ! MCI_ANIM_WINDOW_DEFAULT = 0x00000000L ! MCI_ANIM_RECT = 0x00010000L ! MCI_ANIM_PUT_SOURCE = 0x00020000L ! MCI_ANIM_PUT_DESTINATION = 0x00040000L ! MCI_ANIM_WHERE_SOURCE = 0x00020000L ! MCI_ANIM_WHERE_DESTINATION = 0x00040000L ! MCI_ANIM_UPDATE_HDC = 0x00020000L ! MCI_OVLY_OPEN_WS = 0x00010000L ! MCI_OVLY_OPEN_PARENT = 0x00020000L ! MCI_OVLY_STATUS_HWND = 0x00004001L ! MCI_OVLY_STATUS_STRETCH = 0x00004002L ! MCI_OVLY_INFO_TEXT = 0x00010000L ! MCI_OVLY_GETDEVCAPS_CAN_STRETCH = 0x00004001L ! MCI_OVLY_GETDEVCAPS_CAN_FREEZE = 0x00004002L ! MCI_OVLY_GETDEVCAPS_MAX_WINDOWS = 0x00004003L ! MCI_OVLY_WINDOW_HWND = 0x00010000L ! MCI_OVLY_WINDOW_STATE = 0x00040000L ! MCI_OVLY_WINDOW_TEXT = 0x00080000L ! MCI_OVLY_WINDOW_ENABLE_STRETCH = 0x00100000L ! MCI_OVLY_WINDOW_DISABLE_STRETCH = 0x00200000L ! MCI_OVLY_WINDOW_DEFAULT = 0x00000000L ! MCI_OVLY_RECT = 0x00010000L ! MCI_OVLY_PUT_SOURCE = 0x00020000L ! MCI_OVLY_PUT_DESTINATION = 0x00040000L ! MCI_OVLY_PUT_FRAME = 0x00080000L ! MCI_OVLY_PUT_VIDEO = 0x00100000L ! MCI_OVLY_WHERE_SOURCE = 0x00020000L ! MCI_OVLY_WHERE_DESTINATION = 0x00040000L ! MCI_OVLY_WHERE_FRAME = 0x00080000L ! MCI_OVLY_WHERE_VIDEO = 0x00100000L SELECTDIB = 41 def DIBINDEX(n): return MAKELONG((n),0x10FF) --- 790,866 ---- MCI_SEQ_NONE = 65533 MCI_SEQ_MAPPER = 65535 ! MCI_SEQ_STATUS_TEMPO = 0x00004002 ! MCI_SEQ_STATUS_PORT = 0x00004003 ! MCI_SEQ_STATUS_SLAVE = 0x00004007 ! MCI_SEQ_STATUS_MASTER = 0x00004008 ! MCI_SEQ_STATUS_OFFSET = 0x00004009 ! MCI_SEQ_STATUS_DIVTYPE = 0x0000400A ! MCI_SEQ_STATUS_NAME = 0x0000400B ! MCI_SEQ_STATUS_COPYRIGHT = 0x0000400C ! MCI_SEQ_SET_TEMPO = 0x00010000 ! MCI_SEQ_SET_PORT = 0x00020000 ! MCI_SEQ_SET_SLAVE = 0x00040000 ! MCI_SEQ_SET_MASTER = 0x00080000 ! MCI_SEQ_SET_OFFSET = 0x01000000 ! MCI_ANIM_OPEN_WS = 0x00010000 ! MCI_ANIM_OPEN_PARENT = 0x00020000 ! MCI_ANIM_OPEN_NOSTATIC = 0x00040000 ! MCI_ANIM_PLAY_SPEED = 0x00010000 ! MCI_ANIM_PLAY_REVERSE = 0x00020000 ! MCI_ANIM_PLAY_FAST = 0x00040000 ! MCI_ANIM_PLAY_SLOW = 0x00080000 ! MCI_ANIM_PLAY_SCAN = 0x00100000 ! MCI_ANIM_STEP_REVERSE = 0x00010000 ! MCI_ANIM_STEP_FRAMES = 0x00020000 ! MCI_ANIM_STATUS_SPEED = 0x00004001 ! MCI_ANIM_STATUS_FORWARD = 0x00004002 ! MCI_ANIM_STATUS_HWND = 0x00004003 ! MCI_ANIM_STATUS_HPAL = 0x00004004 ! MCI_ANIM_STATUS_STRETCH = 0x00004005 ! MCI_ANIM_INFO_TEXT = 0x00010000 ! MCI_ANIM_GETDEVCAPS_CAN_REVERSE = 0x00004001 ! MCI_ANIM_GETDEVCAPS_FAST_RATE = 0x00004002 ! MCI_ANIM_GETDEVCAPS_SLOW_RATE = 0x00004003 ! MCI_ANIM_GETDEVCAPS_NORMAL_RATE = 0x00004004 ! MCI_ANIM_GETDEVCAPS_PALETTES = 0x00004006 ! MCI_ANIM_GETDEVCAPS_CAN_STRETCH = 0x00004007 ! MCI_ANIM_GETDEVCAPS_MAX_WINDOWS = 0x00004008 ! MCI_ANIM_REALIZE_NORM = 0x00010000 ! MCI_ANIM_REALIZE_BKGD = 0x00020000 ! MCI_ANIM_WINDOW_HWND = 0x00010000 ! MCI_ANIM_WINDOW_STATE = 0x00040000 ! MCI_ANIM_WINDOW_TEXT = 0x00080000 ! MCI_ANIM_WINDOW_ENABLE_STRETCH = 0x00100000 ! MCI_ANIM_WINDOW_DISABLE_STRETCH = 0x00200000 ! MCI_ANIM_WINDOW_DEFAULT = 0x00000000 ! MCI_ANIM_RECT = 0x00010000 ! MCI_ANIM_PUT_SOURCE = 0x00020000 ! MCI_ANIM_PUT_DESTINATION = 0x00040000 ! MCI_ANIM_WHERE_SOURCE = 0x00020000 ! MCI_ANIM_WHERE_DESTINATION = 0x00040000 ! MCI_ANIM_UPDATE_HDC = 0x00020000 ! MCI_OVLY_OPEN_WS = 0x00010000 ! MCI_OVLY_OPEN_PARENT = 0x00020000 ! MCI_OVLY_STATUS_HWND = 0x00004001 ! MCI_OVLY_STATUS_STRETCH = 0x00004002 ! MCI_OVLY_INFO_TEXT = 0x00010000 ! MCI_OVLY_GETDEVCAPS_CAN_STRETCH = 0x00004001 ! MCI_OVLY_GETDEVCAPS_CAN_FREEZE = 0x00004002 ! MCI_OVLY_GETDEVCAPS_MAX_WINDOWS = 0x00004003 ! MCI_OVLY_WINDOW_HWND = 0x00010000 ! MCI_OVLY_WINDOW_STATE = 0x00040000 ! MCI_OVLY_WINDOW_TEXT = 0x00080000 ! MCI_OVLY_WINDOW_ENABLE_STRETCH = 0x00100000 ! MCI_OVLY_WINDOW_DISABLE_STRETCH = 0x00200000 ! MCI_OVLY_WINDOW_DEFAULT = 0x00000000 ! MCI_OVLY_RECT = 0x00010000 ! MCI_OVLY_PUT_SOURCE = 0x00020000 ! MCI_OVLY_PUT_DESTINATION = 0x00040000 ! MCI_OVLY_PUT_FRAME = 0x00080000 ! MCI_OVLY_PUT_VIDEO = 0x00100000 ! MCI_OVLY_WHERE_SOURCE = 0x00020000 ! MCI_OVLY_WHERE_DESTINATION = 0x00040000 ! MCI_OVLY_WHERE_FRAME = 0x00080000 ! MCI_OVLY_WHERE_VIDEO = 0x00100000 SELECTDIB = 41 def DIBINDEX(n): return MAKELONG((n),0x10FF) Index: win32pdhutil.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32pdhutil.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** win32pdhutil.py 16 Jul 2006 09:38:57 -0000 1.12 --- win32pdhutil.py 14 Nov 2008 00:22:25 -0000 1.13 *************** *** 19,23 **** """ ! import win32pdh, string, time error = win32pdh.error --- 19,23 ---- """ ! import win32pdh, time error = win32pdh.error *************** *** 34,38 **** "Counter 009") counter_list = counter_reg_value[0] ! for i in range(0, len(counter_list) - 1, 2): try: counter_id = int(counter_list[i]) --- 34,38 ---- "Counter 009") counter_list = counter_reg_value[0] ! for i in xrange(0, len(counter_list) - 1, 2): try: counter_id = int(counter_list[i]) *************** *** 79,83 **** if bRefresh: # PDH docs say this is how you do a refresh. win32pdh.EnumObjects(None, machine, 0, 1) ! instanceName = string.lower(instanceName) items, instances = win32pdh.EnumObjectItems(None,None,object, -1) # Track multiple instances. --- 79,83 ---- if bRefresh: # PDH docs say this is how you do a refresh. win32pdh.EnumObjects(None, machine, 0, 1) ! instanceName = instanceName.lower() items, instances = win32pdh.EnumObjectItems(None,None,object, -1) # Track multiple instances. *************** *** 90,96 **** ret = [] ! for instance, max_instances in instance_dict.items(): for inum in xrange(max_instances+1): ! if string.lower(instance) == instanceName: ret.append(GetPerformanceAttributes(object, counter, instance, inum, format, --- 90,96 ---- ret = [] ! for instance, max_instances in instance_dict.iteritems(): for inum in xrange(max_instances+1): ! if instance.lower() == instanceName: ret.append(GetPerformanceAttributes(object, counter, instance, inum, format, *************** *** 112,117 **** # Bit of a hack to get useful info. items = [find_pdh_counter_localized_name("ID Process")] + items[:5] ! print "Process Name", string.join(items,",") ! for instance, max_instances in instance_dict.items(): for inum in xrange(max_instances+1): hq = win32pdh.OpenQuery() --- 112,117 ---- # Bit of a hack to get useful info. items = [find_pdh_counter_localized_name("ID Process")] + items[:5] ! print "Process Name", ",".join(items) ! for instance, max_instances in instance_dict.iteritems(): for inum in xrange(max_instances+1): hq = win32pdh.OpenQuery() *************** *** 134,137 **** --- 134,139 ---- win32pdh.CloseQuery(hq) + # NOTE: This BrowseCallback doesn't seem to work on Vista for markh. + # XXX - look at why!? def BrowseCallBackDemo(counter): machine, object, instance, parentInstance, index, counterName = \ |
From: Mark H. <mha...@us...> - 2008-11-14 00:22:31
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24802/com/win32com/test Modified Files: testShell.py Log Message: Various modernizations to .py code via the py3k branch. Index: testShell.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testShell.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** testShell.py 22 Sep 2006 05:05:51 -0000 1.10 --- testShell.py 14 Nov 2008 00:22:25 -0000 1.11 *************** *** 4,7 **** --- 4,12 ---- import copy + try: + sys_maxsize = sys.maxsize # 2.6 and later - maxsize != maxint on 64bits + except AttributeError: + sys_maxsize = sys.maxint + import win32con import pythoncom *************** *** 98,104 **** # The returned objects *always* have dwFlags and cFileName. ! if not fd.has_key('dwFlags'): del fd2['dwFlags'] ! if not fd.has_key('cFileName'): self.assertEqual(fd2['cFileName'], '') del fd2['cFileName'] --- 103,109 ---- # The returned objects *always* have dwFlags and cFileName. ! if 'dwFlags' not in fd: del fd2['dwFlags'] ! if 'cFileName' not in fd: self.assertEqual(fd2['cFileName'], '') del fd2['cFileName'] *************** *** 130,134 **** ftLastAccessTime=pythoncom.MakeTime(11), ftLastWriteTime=pythoncom.MakeTime(12), ! nFileSize=sys.maxint + 1) self._testRT(d) --- 135,139 ---- ftLastAccessTime=pythoncom.MakeTime(11), ftLastWriteTime=pythoncom.MakeTime(12), ! nFileSize=sys_maxsize + 1) self._testRT(d) *************** *** 138,142 **** # no kw-args to dict in 2.2 - not worth converting! return ! d = [dict(cFileName=u"foo.txt", sizel=(1,2), pointl=(3,4), --- 143,147 ---- # no kw-args to dict in 2.2 - not worth converting! return ! d = [dict(cFileName="foo.txt", sizel=(1,2), pointl=(3,4), *************** *** 145,150 **** ftLastAccessTime=pythoncom.MakeTime(11), ftLastWriteTime=pythoncom.MakeTime(12), ! nFileSize=sys.maxint + 1), ! dict(cFileName=u"foo2.txt", sizel=(1,2), pointl=(3,4), --- 150,155 ---- ftLastAccessTime=pythoncom.MakeTime(11), ftLastWriteTime=pythoncom.MakeTime(12), ! nFileSize=sys_maxsize + 1), ! dict(cFileName="foo2.txt", sizel=(1,2), pointl=(3,4), *************** *** 153,157 **** ftLastAccessTime=pythoncom.MakeTime(11), ftLastWriteTime=pythoncom.MakeTime(12), ! nFileSize=sys.maxint + 1), dict(cFileName=u"foo\xa9.txt", sizel=(1,2), --- 158,162 ---- ftLastAccessTime=pythoncom.MakeTime(11), ftLastWriteTime=pythoncom.MakeTime(12), ! nFileSize=sys_maxsize + 1), dict(cFileName=u"foo\xa9.txt", sizel=(1,2), *************** *** 161,165 **** ftLastAccessTime=pythoncom.MakeTime(11), ftLastWriteTime=pythoncom.MakeTime(12), ! nFileSize=sys.maxint + 1), ] s = shell.FILEGROUPDESCRIPTORAsString(d, 1) --- 166,170 ---- ftLastAccessTime=pythoncom.MakeTime(11), ftLastWriteTime=pythoncom.MakeTime(12), ! nFileSize=sys_maxsize + 1), ] s = shell.FILEGROUPDESCRIPTORAsString(d, 1) |
From: Mark H. <mha...@us...> - 2008-11-14 00:22:31
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24802/Pythonwin/pywin/scintilla Modified Files: IDLEenvironment.py bindings.py control.py view.py Log Message: Various modernizations to .py code via the py3k branch. Index: control.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/control.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** control.py 2 Sep 2008 23:03:38 -0000 1.18 --- control.py 14 Nov 2008 00:22:25 -0000 1.19 *************** *** 6,9 **** --- 6,10 ---- from pywin.mfc import window + from pywin import default_scintilla_encoding import win32con import win32ui *************** *** 13,16 **** --- 14,18 ---- import string import os + import sys import scintillacon *************** *** 59,63 **** def SCIAddText(self, text): ! self.SendMessage(scintillacon.SCI_ADDTEXT, buffer(text)) def SCIAddStyledText(self, text, style = None): # If style is None, text is assumed to be a "native" Scintilla buffer. --- 61,65 ---- def SCIAddText(self, text): ! self.SendMessage(scintillacon.SCI_ADDTEXT, text.encode(default_scintilla_encoding)) def SCIAddStyledText(self, text, style = None): # If style is None, text is assumed to be a "native" Scintilla buffer. *************** *** 65,75 **** # assumed to apply to the entire string. if style is not None: ! text = map(lambda char, style=style: char+chr(style), text) text = ''.join(text) ! self.SendMessage(scintillacon.SCI_ADDSTYLEDTEXT, buffer(text)) def SCIInsertText(self, text, pos=-1): ! sma = array.array('c', text+"\0") ! (a,l) = sma.buffer_info() ! self.SendScintilla(scintillacon.SCI_INSERTTEXT, pos, a) def SCISetSavePoint(self): self.SendScintilla(scintillacon.SCI_SETSAVEPOINT) --- 67,76 ---- # assumed to apply to the entire string. if style is not None: ! text = list(map(lambda char, style=style: char+chr(style), text)) text = ''.join(text) ! self.SendMessage(scintillacon.SCI_ADDSTYLEDTEXT, text.encode(default_scintilla_encoding)) def SCIInsertText(self, text, pos=-1): ! buff=(text+'\0').encode(default_scintilla_encoding) ! self.SendScintilla(scintillacon.SCI_INSERTTEXT, pos, buff) def SCISetSavePoint(self): self.SendScintilla(scintillacon.SCI_SETSAVEPOINT) *************** *** 108,114 **** return self.SendScintilla(scintillacon.SCI_STYLESETEOLFILLED, num, v) def SCIStyleSetFont(self, num, name, characterset=0): ! buff = array.array('c', name + "\0") ! addressBuffer = buff.buffer_info()[0] ! self.SendScintilla(scintillacon.SCI_STYLESETFONT, num, addressBuffer) self.SendScintilla(scintillacon.SCI_STYLESETCHARACTERSET, num, characterset) def SCIStyleSetBold(self, num, bBold): --- 109,114 ---- return self.SendScintilla(scintillacon.SCI_STYLESETEOLFILLED, num, v) def SCIStyleSetFont(self, num, name, characterset=0): ! buff = (name + "\0").encode(default_scintilla_encoding) ! self.SendScintilla(scintillacon.SCI_STYLESETFONT, num, buff) self.SendScintilla(scintillacon.SCI_STYLESETCHARACTERSET, num, characterset) def SCIStyleSetBold(self, num, bBold): *************** *** 181,187 **** if type(text) in [type([]), type(())]: text = ' '.join(text) ! buff = array.array('c', text + "\0") ! addressBuffer = buff.buffer_info()[0] ! return self.SendScintilla(scintillacon.SCI_AUTOCSHOW, 0, addressBuffer) def SCIAutoCCancel(self): self.SendScintilla(scintillacon.SCI_AUTOCCANCEL) --- 181,186 ---- if type(text) in [type([]), type(())]: text = ' '.join(text) ! buff = (text + "\0").encode(default_scintilla_encoding) ! return self.SendScintilla(scintillacon.SCI_AUTOCSHOW, 0, buff) def SCIAutoCCancel(self): self.SendScintilla(scintillacon.SCI_AUTOCCANCEL) *************** *** 191,197 **** return self.SendScintilla(scintillacon.SCI_AUTOCCOMPLETE) def SCIAutoCStops(self, stops): ! buff = array.array('c', stops + "\0") ! addressBuffer = buff.buffer_info()[0] ! self.SendScintilla(scintillacon.SCI_AUTOCSTOPS, 0, addressBuffer) def SCIAutoCSetAutoHide(self, hide): self.SendScintilla(scintillacon.SCI_AUTOCSETAUTOHIDE, hide) --- 190,195 ---- return self.SendScintilla(scintillacon.SCI_AUTOCCOMPLETE) def SCIAutoCStops(self, stops): ! buff = (stops + "\0").encode(default_scintilla_encoding) ! self.SendScintilla(scintillacon.SCI_AUTOCSTOPS, 0, buff) def SCIAutoCSetAutoHide(self, hide): self.SendScintilla(scintillacon.SCI_AUTOCSETAUTOHIDE, hide) *************** *** 219,225 **** # Lexer etc def SCISetKeywords(self, keywords, kw_list_no = 0): ! ar = array.array('c', keywords+"\0") ! (a,l) = ar.buffer_info() ! self.SendScintilla(scintillacon.SCI_SETKEYWORDS, kw_list_no, a) def SCISetProperty(self, name, value): name_buff = array.array('c', name + "\0") --- 217,222 ---- # Lexer etc def SCISetKeywords(self, keywords, kw_list_no = 0): ! buff = (keywords+"\0").encode(default_scintilla_encoding) ! self.SendScintilla(scintillacon.SCI_SETKEYWORDS, kw_list_no, buff) def SCISetProperty(self, name, value): name_buff = array.array('c', name + "\0") *************** *** 280,290 **** """ findtextex_fmt='llPll' ! buff = array.array('c', findText + "\0") ! addressBuffer = buff.buffer_info()[0] ! ft = struct.pack(findtextex_fmt, range[0], range[1], addressBuffer, 0, 0) ! ftBuff = array.array('c', ft) ! addressFtBuff = ftBuff.buffer_info()[0] ! rc = self.SendScintilla(EM_FINDTEXTEX, flags, addressFtBuff) ! ftUnpacked = struct.unpack(findtextex_fmt, ftBuff.tostring()) return rc, (ftUnpacked[3], ftUnpacked[4]) --- 277,287 ---- """ findtextex_fmt='llPll' ! ## Scintilla does not handle unicode in EM_FINDTEXT msg (FINDTEXTEX struct) ! txt_buff = (findText+'\0').encode(default_scintilla_encoding) ! txt_array = array.array('b', txt_buff) ! ft_buff = struct.pack(findtextex_fmt, range[0], range[1], txt_array.buffer_info()[0], 0, 0) ! ft_array = array.array('b', ft_buff) ! rc = self.SendScintilla(EM_FINDTEXTEX, flags, ft_array.buffer_info()[0]) ! ftUnpacked = struct.unpack(findtextex_fmt, ft_array) return rc, (ftUnpacked[3], ftUnpacked[4]) *************** *** 303,307 **** addressTxtBuf = txtBuf.buffer_info()[0] self.SendScintilla(EM_GETSELTEXT, 0, addressTxtBuf) ! return txtBuf.tostring()[:-1] def SetSel(self, start=0, end=None): --- 300,304 ---- addressTxtBuf = txtBuf.buffer_info()[0] self.SendScintilla(EM_GETSELTEXT, 0, addressTxtBuf) ! return txtBuf.tostring().decode(default_scintilla_encoding) def SetSel(self, start=0, end=None): *************** *** 347,363 **** assert start >= 0 and start <= self.GetTextLength(), "The start postion is invalid" assert end >= 0 and end <= self.GetTextLength(), "The end postion is invalid" ! initer = "=" * (end - start + 1) ! buff = array.array('c', initer) addressBuffer = buff.buffer_info()[0] tr = struct.pack('llP', start, end, addressBuffer) ! trBuff = array.array('c', tr) addressTrBuff = trBuff.buffer_info()[0] numChars = self.SendScintilla(EM_GETTEXTRANGE, 0, addressTrBuff) ! return buff.tostring()[:numChars] ! def ReplaceSel(self, str): ! buff = array.array('c', str + "\0") ! self.SendScintilla(scintillacon.SCI_REPLACESEL, 0, buff.buffer_info()[0]); ! buff = None def GetLine(self, line=-1): --- 344,363 ---- assert start >= 0 and start <= self.GetTextLength(), "The start postion is invalid" assert end >= 0 and end <= self.GetTextLength(), "The end postion is invalid" ! initer = ("=" * (end - start + 1)).encode("ascii") # ensure bytes in both 2x and 3k ! if sys.version_info >= (3,): ! byte_format = 'b' ! else: ! byte_format = 'c' ! buff = array.array(byte_format, initer) addressBuffer = buff.buffer_info()[0] tr = struct.pack('llP', start, end, addressBuffer) ! trBuff = array.array(byte_format, tr) addressTrBuff = trBuff.buffer_info()[0] numChars = self.SendScintilla(EM_GETTEXTRANGE, 0, addressTrBuff) ! return buff.tostring()[:numChars].decode(default_scintilla_encoding) ! def ReplaceSel(self, str): ! buff = (str + "\0").encode(default_scintilla_encoding) ! self.SendScintilla(scintillacon.SCI_REPLACESEL, 0, buff) def GetLine(self, line=-1): *************** *** 377,382 **** def SetWordWrap(self, mode): ! if mode <> win32ui.CRichEditView_WrapNone: ! raise ValueError, "We dont support word-wrap (I dont think :-)" class CScintillaColorEditInterface(CScintillaEditInterface): --- 377,382 ---- def SetWordWrap(self, mode): ! if mode != win32ui.CRichEditView_WrapNone: ! raise ValueError("We dont support word-wrap (I dont think :-)") class CScintillaColorEditInterface(CScintillaEditInterface): Index: view.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/view.py,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** view.py 3 Sep 2008 02:59:44 -0000 1.29 --- view.py 14 Nov 2008 00:22:25 -0000 1.30 *************** *** 194,200 **** doc = self.GetDocument() ! # Enable Unicode if we can ! if is_platform_unicode: ! self.SendScintilla(scintillacon.SCI_SETCODEPAGE, scintillacon.SC_CP_UTF8, 0) # Create margins self.SendScintilla(scintillacon.SCI_SETMARGINTYPEN, 1, scintillacon.SC_MARGIN_SYMBOL); --- 194,199 ---- doc = self.GetDocument() ! # Enable Unicode ! self.SendScintilla(scintillacon.SCI_SETCODEPAGE, scintillacon.SC_CP_UTF8, 0) # Create margins self.SendScintilla(scintillacon.SCI_SETMARGINTYPEN, 1, scintillacon.SC_MARGIN_SYMBOL); *************** *** 389,396 **** doc = self.GetDocument() s = self.GetTextRange() ! if is_platform_unicode: ! s = unicode(s,"utf-8").encode("mbcs") f = open(filename, 'wb') ! f.write(s) f.close() doc.SetModifiedFlag(0) --- 388,395 ---- 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) *************** *** 439,453 **** funDesc = typeInfo.GetFuncDesc(iFun) funName = typeInfo.GetNames(funDesc.memid)[0] ! if not items_dict.has_key(funName): items_dict[funName] = None except: pass except: ! win32ui.SetStatusText("Error attempting to get object attributes - %s" % (`sys.exc_info()[0]`,)) ! # ensure all keys are strings. ! items = map(str, items_dict.keys()) # All names that start with "_" go! ! items = filter(lambda word: word[0]!='_', items) if not items: --- 438,452 ---- funDesc = typeInfo.GetFuncDesc(iFun) funName = typeInfo.GetNames(funDesc.memid)[0] ! if funName not in items_dict: items_dict[funName] = None except: pass except: ! win32ui.SetStatusText("Error attempting to get object attributes - %s" % (repr(sys.exc_info()[0]),)) ! # ensure all keys are strings. ! items = [str(k) for k in items_dict.keys()] # All names that start with "_" go! ! items = [k for k in items if not k.startswith('_')] if not items: *************** *** 466,477 **** text = self.GetTextRange(self.LineIndex(minline),endpos) try: ! list = re.findall(r"\b"+left+"\.\w+",text) except re.error: # parens etc may make an invalid RE, but this code wouldnt # benefit even if the RE did work :-) ! list = [] prefix = len(left)+1 unique = {} ! for li in list: unique[li[prefix:]] = 1 # Assuming traditional usage of self... --- 465,476 ---- text = self.GetTextRange(self.LineIndex(minline),endpos) try: ! l = re.findall(r"\b"+left+"\.\w+",text) except re.error: # parens etc may make an invalid RE, but this code wouldnt # benefit even if the RE did work :-) ! l = [] prefix = len(left)+1 unique = {} ! for li in l: unique[li[prefix:]] = 1 # Assuming traditional usage of self... *************** *** 479,483 **** self._UpdateWithClassMethods(unique,curclass) ! items = filter(lambda word: word[:2]!='__' or word[-2:]!='__', unique.keys()) # Ignore the word currently to the right of the dot - probably a red-herring. try: --- 478,482 ---- self._UpdateWithClassMethods(unique,curclass) ! items = [word for word in unique.keys() if word[:2]!='__' or word[-2:]!='__'] # Ignore the word currently to the right of the dot - probably a red-herring. try: *************** *** 530,534 **** curclass = None # Find out which class we are in ! for item in clbrdata.values(): if item.module==curmodule: item_lineno = item.lineno - 1 # Scintilla counts lines from 0, whereas pyclbr - from 1 --- 529,533 ---- curclass = None # Find out which class we are in ! for item in clbrdata.itervalues(): if item.module==curmodule: item_lineno = item.lineno - 1 # Scintilla counts lines from 0, whereas pyclbr - from 1 Index: bindings.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/bindings.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** bindings.py 9 Aug 2008 16:47:07 -0000 1.5 --- bindings.py 14 Nov 2008 00:22:25 -0000 1.6 *************** *** 6,9 **** --- 6,10 ---- import keycodes import sys + import traceback HANDLER_ARGS_GUESS=0 *************** *** 50,54 **** def complete_configure(self): ! for id in command_to_events.keys(): self.parent_view.HookCommand(self._OnCommand, id) --- 51,55 ---- def complete_configure(self): ! for id in command_to_events.iterkeys(): self.parent_view.HookCommand(self._OnCommand, id) *************** *** 81,85 **** if id is None: # See if we even have an event of that name!? ! if not self.bindings.has_key(event): return None id = self.bind_command(event) --- 82,86 ---- if id is None: # See if we even have an event of that name!? ! if event not in self.bindings: return None id = self.bind_command(event) *************** *** 139,143 **** else: args = (event_param,) ! rc = apply(binding.handler, args) if handler_args_type==HANDLER_ARGS_IDLE: # Convert to our return code. --- 140,144 ---- else: args = (event_param,) ! rc = binding.handler(*args) if handler_args_type==HANDLER_ARGS_IDLE: # Convert to our return code. *************** *** 147,151 **** rc = 1 except: ! import traceback message = "Firing event '%s' failed." % event print message --- 148,155 ---- rc = 1 except: ! # ??? - hrm - py3k might want: ! # traceback.print_exc(chain=False) ! # but why? We do a normal print_exc() below (and py2k ! # doesn't have that param. message = "Firing event '%s' failed." % event print message Index: IDLEenvironment.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/scintilla/IDLEenvironment.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** IDLEenvironment.py 9 Aug 2008 16:47:07 -0000 1.11 --- IDLEenvironment.py 14 Nov 2008 00:22:25 -0000 1.12 *************** *** 9,12 **** --- 9,13 ---- from pywin.mfc.dialog import GetSimpleInput + from pywin import default_scintilla_encoding wordchars = string.ascii_uppercase + string.ascii_lowercase + string.digits *************** *** 15,18 **** --- 16,20 ---- pass + class EmptyRange(Exception): # Internally raised. pass *************** *** 42,46 **** if self.finished: return "" ! if not self.__dict__.has_key("_scint_lines"): # XXX - note - assumes this is only called once the file is loaded! self._scint_lines = self.text.edit.GetTextRange().split("\n") --- 44,48 ---- if self.finished: return "" ! if "_scint_lines" not in self.__dict__: # XXX - note - assumes this is only called once the file is loaded! self._scint_lines = self.text.edit.GetTextRange().split("\n") *************** *** 49,53 **** if i >= len(sl): return "" ! return sl[i]+"\n" try: --- 51,55 ---- if i >= len(sl): return "" ! return (sl[i]+"\n").encode(default_scintilla_encoding) try: *************** *** 69,73 **** self.extension_menus = None try: ! for ext in self.extensions.values(): closer = getattr(ext, "close", None) if closer is not None: --- 71,75 ---- self.extension_menus = None try: ! for ext in self.extensions.itervalues(): closer = getattr(ext, "close", None) if closer is not None: *************** *** 84,88 **** ext = self.extensions[extension] = klass(self) # Find and bind all the events defined in the extension. ! events = filter(lambda item: item[-6:]=="_event", dir(klass)) for event in events: name = "<<%s>>" % (event[:-6].replace("_", "-"), ) --- 86,90 ---- ext = self.extensions[extension] = klass(self) # Find and bind all the events defined in the extension. ! events = [item for item in dir(klass) if item[-6:]=="_event"] for event in events: name = "<<%s>>" % (event[:-6].replace("_", "-"), ) *************** *** 94,102 **** bindings = self.edit.bindings ret = [] ! for ext in self.extensions.values(): menudefs = getattr(ext, "menudefs", []) for name, items in menudefs: if name == menu_name: ! for text, event in filter(lambda item: item is not None, items): text = text.replace("&", "&&") text = text.replace("_", "&") --- 96,104 ---- bindings = self.edit.bindings ret = [] ! for ext in self.extensions.itervalues(): menudefs = getattr(ext, "menudefs", []) for name, items in menudefs: if name == menu_name: ! for text, event in [item for item in items if item is not None]: text = text.replace("&", "&&") text = text.replace("_", "&") *************** *** 202,206 **** def TkIndexToOffset(bm, edit, marks): base, nextTokPos = _NextTok(bm, 0) ! if base is None: raise ValueError, "Empty bookmark ID!" if base.find(".")>0: try: --- 204,208 ---- def TkIndexToOffset(bm, edit, marks): base, nextTokPos = _NextTok(bm, 0) ! if base is None: raise ValueError("Empty bookmark ID!") if base.find(".")>0: try: *************** *** 208,212 **** if col=="first" or col=="last": # Tag name ! if line != "sel": raise ValueError, "Tags arent here!" sel = edit.GetSel() if sel[0]==sel[1]: --- 210,214 ---- if col=="first" or col=="last": # Tag name ! if line != "sel": raise ValueError("Tags arent here!") sel = edit.GetSel() if sel[0]==sel[1]: *************** *** 226,230 **** pos = pos + int(col) except (ValueError, IndexError): ! raise ValueError, "Unexpected literal in '%s'" % base elif base == 'insert': pos = edit.GetSel()[0] --- 228,232 ---- pos = pos + int(col) except (ValueError, IndexError): ! raise ValueError("Unexpected literal in '%s'" % base) elif base == 'insert': pos = edit.GetSel()[0] *************** *** 238,242 **** pos = marks[base] except KeyError: ! raise ValueError, "Unsupported base offset or undefined mark '%s'" % base while 1: --- 240,244 ---- pos = marks[base] except KeyError: ! raise ValueError("Unsupported base offset or undefined mark '%s'" % base) while 1: *************** *** 245,252 **** if word in ['+','-']: num, nextTokPos = _NextTok(bm, nextTokPos) ! if num is None: raise ValueError, "+/- operator needs 2 args" what, nextTokPos = _NextTok(bm, nextTokPos) ! if what is None: raise ValueError, "+/- operator needs 2 args" ! if what[0] <> "c": raise ValueError, "+/- only supports chars" if word=='+': pos = pos + int(num) --- 247,254 ---- if word in ['+','-']: num, nextTokPos = _NextTok(bm, nextTokPos) ! if num is None: raise ValueError("+/- operator needs 2 args") what, nextTokPos = _NextTok(bm, nextTokPos) ! if what is None: raise ValueError("+/- operator needs 2 args") ! if what[0] != "c": raise ValueError("+/- only supports chars") if word=='+': pos = pos + int(num) *************** *** 268,272 **** pos = pos + 1 else: ! raise ValueError, "Unsupported relative offset '%s'" % word return max(pos, 0) # Tkinter is tollerant of -ve indexes - we aren't --- 270,274 ---- pos = pos + 1 else: ! raise ValueError("Unsupported relative offset '%s'" % word) return max(pos, 0) # Tkinter is tollerant of -ve indexes - we aren't *************** *** 349,355 **** pos = self._getoffset(pos) except EmptyRange: ! raise TextError, "Empty range" self.edit.SetSel((pos, pos)) # IDLE only deals with "\n" - we will be nicer bits = text.split('\n') self.edit.SCIAddText(bits[0]) --- 351,358 ---- pos = self._getoffset(pos) except EmptyRange: ! raise TextError("Empty range") self.edit.SetSel((pos, pos)) # IDLE only deals with "\n" - we will be nicer + bits = text.split('\n') self.edit.SCIAddText(bits[0]) *************** *** 363,367 **** if end is not None: end = self._getoffset(end) except EmptyRange: ! raise TextError, "Empty range" # If end is specified and == start, then we must delete nothing. if start==end: return --- 366,370 ---- if end is not None: end = self._getoffset(end) except EmptyRange: ! raise TextError("Empty range") # If end is specified and == start, then we must delete nothing. if start==end: return *************** *** 396,400 **** pos = self._getoffset(pos) except EmptyRange: ! raise TextError, "Empty range '%s'" % pos if name == "insert": self.edit.SetSel( pos ) --- 399,403 ---- pos = self._getoffset(pos) except EmptyRange: ! raise TextError("Empty range '%s'" % pos) if name == "insert": self.edit.SetSel( pos ) *************** *** 403,417 **** def tag_add(self, name, start, end): ! if name != "sel": raise ValueError, "Only sel tag is supported" try: start = self._getoffset(start) end = self._getoffset(end) except EmptyRange: ! raise TextError, "Empty range" self.edit.SetSel( start, end ) def tag_remove(self, name, start, end): if name !="sel" or start != "1.0" or end != "end": ! raise ValueError, "Cant remove this tag" # Turn the sel into a cursor self.edit.SetSel(self.edit.GetSel()[0]) --- 406,420 ---- def tag_add(self, name, start, end): ! if name != "sel": raise ValueError("Only sel tag is supported") try: start = self._getoffset(start) end = self._getoffset(end) except EmptyRange: ! raise TextError("Empty range") self.edit.SetSel( start, end ) def tag_remove(self, name, start, end): if name !="sel" or start != "1.0" or end != "end": ! raise ValueError("Cant remove this tag") # Turn the sel into a cursor self.edit.SetSel(self.edit.GetSel()[0]) |
From: Mark H. <mha...@us...> - 2008-11-14 00:22:31
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/app In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv24802/Pythonwin/pywin/Demos/app Modified Files: customprint.py Log Message: Various modernizations to .py code via the py3k branch. Index: customprint.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/Demos/app/customprint.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** customprint.py 9 Aug 2008 16:46:40 -0000 1.3 --- customprint.py 14 Nov 2008 00:22:25 -0000 1.4 *************** *** 34,38 **** } self.pens = {} ! for name, color in self.colors.items(): self.pens[name] = win32ui.CreatePen(win32con.PS_SOLID, 5, color) --- 34,38 ---- } self.pens = {} ! for name, color in self.colors.iteritems(): self.pens[name] = win32ui.CreatePen(win32con.PS_SOLID, 5, color) *************** *** 49,53 **** x,y = self.size delta = 2 ! colors = self.colors.keys() colors.sort() colors = colors*2 --- 49,53 ---- x,y = self.size delta = 2 ! colors = list(self.colors.keys()) colors.sort() colors = colors*2 *************** *** 169,173 **** def OnInitDialog(self): self.magCtl = self.GetDlgItem(IDC_PRINT_MAG_EDIT) ! self.magCtl.SetWindowText(`self['mag']`) return dialog.PrintDialog.OnInitDialog(self) def OnOK(self): --- 169,173 ---- def OnInitDialog(self): self.magCtl = self.GetDlgItem(IDC_PRINT_MAG_EDIT) ! self.magCtl.SetWindowText(repr(self['mag'])) return dialog.PrintDialog.OnInitDialog(self) def OnOK(self): |