pywin32-checkins Mailing List for Python for Windows Extensions (Page 77)
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-05-15 10:57:05
|
Update of /cvsroot/pywin32/pywin32/isapi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2971 Modified Files: ControlBlock.h PyExtensionObjects.cpp PyExtensionObjects.h PythonEng.cpp Log Message: Inline esb.WriteHeaders to avoid extra strlens, have exceptions correctly reflect the actual function being called and add SetFlushFlag (HSE_REQ_SET_FLUSH_FLAG) Index: PythonEng.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/PythonEng.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PythonEng.cpp 17 Jan 2007 04:40:12 -0000 1.5 --- PythonEng.cpp 15 May 2008 10:57:09 -0000 1.6 *************** *** 368,372 **** pcb->SetStatus(HSE_STATUS_ERROR); pcb->SetLogMessage(errmsg); ! pcb->WriteHeaders(_T("200 OK"), _T("Content-type: text/html\r\n\r\n"), false); pcb->WriteStream(htmlStream, strlen(htmlStream)); if (windows_error) { --- 368,379 ---- pcb->SetStatus(HSE_STATUS_ERROR); pcb->SetLogMessage(errmsg); ! HSE_SEND_HEADER_EX_INFO SendHeaderExInfo; ! SendHeaderExInfo.pszStatus = "200 OK"; ! SendHeaderExInfo.cchStatus = strlen(SendHeaderExInfo.pszStatus); ! SendHeaderExInfo.pszHeader = "Content-type: text/html\r\n\r\n"; ! SendHeaderExInfo.cchHeader = strlen(SendHeaderExInfo.pszHeader); ! SendHeaderExInfo.fKeepConn = FALSE; ! EXTENSION_CONTROL_BLOCK * ecb = pcb->GetECB(); ! ecb->ServerSupportFunction(ecb->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &SendHeaderExInfo, NULL,NULL); pcb->WriteStream(htmlStream, strlen(htmlStream)); if (windows_error) { Index: ControlBlock.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/ControlBlock.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ControlBlock.h 7 Mar 2007 01:52:46 -0000 1.5 --- ControlBlock.h 15 May 2008 10:57:09 -0000 1.6 *************** *** 39,63 **** } - DWORD WriteHeaders(LPCTSTR szStatus, LPCTSTR szHeader, const bool bKeepAlive=true) - { - // NOTE we must send Content-Length header with correct byte count - // in order for keep-alive to work, the bKeepAlive flag is not enough - // by itself.. - - HSE_SEND_HEADER_EX_INFO SendHeaderExInfo; - DWORD cchStatus = lstrlen(szStatus); - DWORD cchHeader = lstrlen(szHeader); - - // Populate SendHeaderExInfo struct - SendHeaderExInfo.pszStatus = szStatus; - SendHeaderExInfo.pszHeader = szHeader; - SendHeaderExInfo.cchStatus = cchStatus; - SendHeaderExInfo.cchHeader = cchHeader; - SendHeaderExInfo.fKeepConn = (bKeepAlive) ? TRUE:FALSE; - - // Send header - return m_pECB->ServerSupportFunction(m_pECB->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &SendHeaderExInfo, NULL,NULL); - } - DWORD WriteStream(LPCTSTR buffer, const int buffLen, const int reserved=0) { --- 39,42 ---- Index: PyExtensionObjects.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyExtensionObjects.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyExtensionObjects.h 7 Mar 2007 01:54:13 -0000 1.4 --- PyExtensionObjects.h 15 May 2008 10:57:09 -0000 1.5 *************** *** 100,103 **** --- 100,104 ---- static PyObject * MapURLToPath(PyObject *self, PyObject * args); // HSE_REQ_MAP_URL_TO_PATH static PyObject * IsKeepConn(PyObject *self, PyObject * args); // HSE_REQ_IS_KEEP_CONN + static PyObject * SetFlushFlag(PyObject *self, PyObject * args); // HSE_REQ_SET_FLUSH_FLAG static PyObject * IsSessionActive(PyObject *self, PyObject * args); Index: PyExtensionObjects.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyExtensionObjects.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyExtensionObjects.cpp 7 Mar 2007 01:54:13 -0000 1.7 --- PyExtensionObjects.cpp 15 May 2008 10:57:09 -0000 1.8 *************** *** 148,151 **** --- 148,152 ---- {"ReadClient", PyECB::ReadClient, 1}, // @pymeth ReadClient| {"SendResponseHeaders", PyECB::SendResponseHeaders, 1}, // @pymeth SendResponseHeaders| + {"SetFlushFlag", PyECB::SetFlushFlag, 1}, // @pymeth SetFlushFlag| {"TransmitFile", PyECB::TransmitFile, 1}, // @pymeth TransmitFile| {"MapURLToPath", PyECB::MapURLToPath, 1}, // @pymeth MapURLToPath| *************** *** 452,467 **** if (!pecb || !pecb->Check()) return NULL; // @pyparm string|reply|| // @pyparm string|headers|| // @pyparm bool|keepAlive|False| ! if (!PyArg_ParseTuple(args, "ss|i:SendResponseHeaders", &reply, &headers, &bKeepAlive)) return NULL; if (pecb->m_pcb){ Py_BEGIN_ALLOW_THREADS ! bRes = pecb->m_pcb->WriteHeaders(reply,headers,(bKeepAlive!=0)?true:false); Py_END_ALLOW_THREADS if (!bRes) ! return SetPyECBError("SendResponseHeaders"); } --- 453,478 ---- if (!pecb || !pecb->Check()) return NULL; + HSE_SEND_HEADER_EX_INFO SendHeaderExInfo; // @pyparm string|reply|| // @pyparm string|headers|| // @pyparm bool|keepAlive|False| ! if (!PyArg_ParseTuple(args, "s#s#|i:SendResponseHeaders", ! &SendHeaderExInfo.pszStatus, &SendHeaderExInfo.cchStatus, ! &SendHeaderExInfo.pszHeader, &SendHeaderExInfo.cchHeader, ! &bKeepAlive)) return NULL; + SendHeaderExInfo.fKeepConn = (bKeepAlive) ? TRUE:FALSE; if (pecb->m_pcb){ Py_BEGIN_ALLOW_THREADS ! // NOTE we must send Content-Length header with correct byte count ! // in order for keep-alive to work, the bKeepAlive flag is not enough ! // by itself.. ! // Send header ! EXTENSION_CONTROL_BLOCK * ecb = pecb->m_pcb->GetECB(); ! bRes = ecb->ServerSupportFunction(ecb->ConnID, HSE_REQ_SEND_RESPONSE_HEADER_EX, &SendHeaderExInfo, NULL,NULL); Py_END_ALLOW_THREADS if (!bRes) ! return SetPyECBError("ServerSupportFunction(HSE_REQ_SEND_RESPONSE_HEADER_EX)"); } *************** *** 470,473 **** --- 481,515 ---- } + #ifndef HSE_REQ_SET_FLUSH_FLAG + // *sigh* - need a better strategy here - maybe just insist on later SDK and + // #error with a helpful message? + #pragma message("You don't appear to have a late platform SDK that supports IIS7") + #define HSE_REQ_SET_FLUSH_FLAG (HSE_REQ_END_RESERVED+43) + #endif + + // @pymethod |EXTENSION_CONTROL_BLOCK|SetFlushFlag|Calls ServerSupportFunction with HSE_REQ_SET_FLUSH_FLAG. + PyObject * PyECB::SetFlushFlag(PyObject *self, PyObject * args) + { + int f; + PyECB * pecb = (PyECB *) self; + if (!pecb || !pecb->Check()) return NULL; + + // @pyparm bool|flag|| + if (!PyArg_ParseTuple(args, "i:SetFlushFlag", &f)) + return NULL; + + if (pecb->m_pcb){ + BOOL bRes; + Py_BEGIN_ALLOW_THREADS + EXTENSION_CONTROL_BLOCK * ecb = pecb->m_pcb->GetECB(); + bRes = ecb->ServerSupportFunction(ecb->ConnID, HSE_REQ_SET_FLUSH_FLAG, (LPVOID)f, NULL,NULL); + Py_END_ALLOW_THREADS + if (!bRes) + return SetPyECBError("ServerSupportFunction(HSE_REQ_SET_FLUSH_FLAG)"); + } + Py_INCREF(Py_None); + return Py_None; + } + // @pymethod |EXTENSION_CONTROL_BLOCK|Redirect|Calls ServerSupportFunction with HSE_REQ_SEND_URL_REDIRECT_RESP PyObject * PyECB::Redirect(PyObject *self, PyObject * args) *************** *** 488,492 **** Py_END_ALLOW_THREADS if (!bRes) ! return SetPyECBError("Redirect"); } --- 530,534 ---- Py_END_ALLOW_THREADS if (!bRes) ! return SetPyECBError("ServerSupportFunction(HSE_REQ_SEND_URL_REDIRECT_RESP)"); } *************** *** 509,513 **** Py_END_ALLOW_THREADS if (!bRes) ! return SetPyECBError("GetImpersonationToken"); return PyLong_FromVoidPtr(handle); } --- 551,555 ---- Py_END_ALLOW_THREADS if (!bRes) ! return SetPyECBError("ServerSupportFunction(HSE_REQ_GET_IMPERSONATION_TOKEN)"); return PyLong_FromVoidPtr(handle); } *************** *** 526,530 **** Py_END_ALLOW_THREADS if (!bRes) ! return SetPyECBError("IsKeepCon"); return PyBool_FromLong(bIs); } --- 568,572 ---- Py_END_ALLOW_THREADS if (!bRes) ! return SetPyECBError("ServerSupportFunction(HSE_REQ_IS_KEEP_CONN)"); return PyBool_FromLong(bIs); } *************** *** 620,624 **** // ack - the completion routine will not be called - clean up! context->Cleanup(); ! return SetPyECBError("TransmitFile"); } Py_INCREF(Py_None); --- 662,666 ---- // ack - the completion routine will not be called - clean up! context->Cleanup(); ! return SetPyECBError("ServerSupportFunction(HSE_REQ_TRANSMIT_FILE)"); } Py_INCREF(Py_None); *************** *** 648,652 **** } ! // @pymethod |EXTENSION_CONTROL_BLOCK|MapURLToPath| PyObject * PyECB::MapURLToPath(PyObject *self, PyObject * args) { --- 690,694 ---- } ! // @pymethod |EXTENSION_CONTROL_BLOCK|MapURLToPath|Calls ServerSupportFunction with HSE_REQ_MAP_URL_TO_PATH PyObject * PyECB::MapURLToPath(PyObject *self, PyObject * args) { *************** *** 668,672 **** Py_END_ALLOW_THREADS if (!ok) ! return SetPyECBError("MapURLToPath"); return PyString_FromString(buffer); } --- 710,714 ---- Py_END_ALLOW_THREADS if (!ok) ! return SetPyECBError("ServerSupportFunction(HSE_REQ_MAP_URL_TO_PATH)"); return PyString_FromString(buffer); } |
From: Roger U. <ru...@us...> - 2008-05-04 13:02:03
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/taskscheduler/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9690 Modified Files: PyITask.cpp Log Message: Add base tag for PyITask Index: PyITask.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/taskscheduler/src/PyITask.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyITask.cpp 28 Apr 2004 05:21:44 -0000 1.2 --- PyITask.cpp 4 May 2008 13:02:08 -0000 1.3 *************** *** 326,330 **** PyComTypeObject PyITask::type("PyITask", ! &PyIScheduledWorkItem::type, sizeof(PyITask), PyITask_methods, --- 326,330 ---- PyComTypeObject PyITask::type("PyITask", ! &PyIScheduledWorkItem::type, // @base PyITask|PyIScheduledWorkItem sizeof(PyITask), PyITask_methods, |
From: Roger U. <ru...@us...> - 2008-05-04 12:59:51
|
Update of /cvsroot/pywin32/pywin32/AutoDuck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8586 Modified Files: pyhtml.fmt Log Message: Fix output for "@base" tag Index: pyhtml.fmt =================================================================== RCS file: /cvsroot/pywin32/pywin32/AutoDuck/pyhtml.fmt,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** pyhtml.fmt 15 Mar 2006 04:28:25 -0000 1.11 --- pyhtml.fmt 4 May 2008 12:59:57 -0000 1.12 *************** *** 365,375 **** .if=exists($2_int), tagexists(interface) .tag=base, html, 2, 1 .pre=$(rmh)Based On$(rmhe) ! .format=$(cb)$2$(cbe)$(par) ! .if=tagexists(interface) - .tag=base, html, 2, 1 - .format= ; Return value .tag=rvalue, html, 2, 1 --- 365,376 ---- .if=exists($2_int), tagexists(interface) + + ; Bases for COM interfaces and objects .tag=base, html, 2, 1 .pre=$(rmh)Based On$(rmhe) ! .format=<A HREF="#2.html">$2</A> ! .if=tagexists(object) ! ; Return value .tag=rvalue, html, 2, 1 |
From: Mark H. <mha...@us...> - 2008-05-04 10:50:59
|
Update of /cvsroot/pywin32/pywin32/AutoDuck In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30466 Modified Files: README pywin32-document.xml pywin32.mak Log Message: Add a reference to Tim Golden's Python pages (and a note to make it easier to work out how to do something similar next time :) Index: README =================================================================== RCS file: /cvsroot/pywin32/pywin32/AutoDuck/README,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** README 11 Feb 2008 00:35:55 -0000 1.4 --- README 4 May 2008 10:51:02 -0000 1.5 *************** *** 4,5 **** --- 4,7 ---- provides the best documentation solution. We don't even build a .hlp file anymore. + + pywin32-document.xml provides the front-page for the docs. Index: pywin32-document.xml =================================================================== RCS file: /cvsroot/pywin32/pywin32/AutoDuck/pywin32-document.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pywin32-document.xml 31 May 2005 12:40:05 -0000 1.5 --- pywin32-document.xml 4 May 2008 10:51:02 -0000 1.6 *************** *** 1,5 **** <document> <important> ! <item name="Important notes about COM currency support changes" href="html/com/win32com/readme.htm#currency"/> </important> <links> --- 1,5 ---- <document> <important> ! <item name="View the change log" href="CHANGES.txt"/> </important> <links> *************** *** 7,10 **** --- 7,11 ---- <item name="Python for Win32 Extensions Site" href="http://starship.python.net/crew/mhammond"/> <item name="Python for Win32 mailing list" href="http://mail.python.org/mailman/listinfo/python-win32"/> + <item name="Tim Golden's Python pages" href="http://timgolden.me.uk/python/"/> <item name="Paul Boddie's Python COM tutorial" href="http://thor.prohosting.com/~pboddie/Python/COM.html"/> </links> *************** *** 22,25 **** --- 23,27 ---- <item name="ADSI Python" href="com/help/adsi.html"/> <item name="Active Directory" href="com/help/active_directory.html"/> + <item name="Important notes about COM currency support changes" href="html/com/win32com/readme.htm#currency"/> </overviews> </category> Index: pywin32.mak =================================================================== RCS file: /cvsroot/pywin32/pywin32/AutoDuck/pywin32.mak,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** pywin32.mak 11 Feb 2008 00:35:55 -0000 1.18 --- pywin32.mak 4 May 2008 10:51:02 -0000 1.19 *************** *** 31,34 **** --- 31,35 ---- $(ISAPI_DIR)/doc/*.html \ $(PYTHONWIN_DIR)/readme.html $(PYTHONWIN_DIR)/doc/* $(PYTHONWIN_DIR)/doc/debugger/* \ + CHANGES.txt \ |
From: Mark H. <mha...@us...> - 2008-05-04 10:45:52
|
Update of /cvsroot/pywin32/pywin32/win32/Demos In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28146/win32/Demos Added Files: win32gui_devicenotify.py Log Message: Support for RegisterDeviceNotification and related structures, including a new demo and updates to serviceEvents demo. --- NEW FILE: win32gui_devicenotify.py --- # Demo RegisterDeviceNotification etc. Creates a hidden window to receive # notifications. See serviceEvents.py for an example of a service doing # that. import sys, time import win32gui, win32con, win32api, win32file import win32gui_struct, winnt # These device GUIDs are from Ioevent.h in the Windows SDK. Ideally they # could be collected somewhere for pywin32... GUID_DEVINTERFACE_USB_DEVICE = "{A5DCBF10-6530-11D2-901F-00C04FB951ED}" # WM_DEVICECHANGE message handler. def OnDeviceChange(hwnd, msg, wp, lp): # Unpack the 'lp' into the appropriate DEV_BROADCAST_* structure, # using the self-identifying data inside the DEV_BROADCAST_HDR. info = win32gui_struct.UnpackDEV_BROADCAST(lp) print "Device change notification:", wp, info if wp==win32con.DBT_DEVICEQUERYREMOVE and info.devicetype==win32con.DBT_DEVTYP_HANDLE: # Our handle is stored away in the structure - just close it print "Device being removed - closing handle" win32file.CloseHandle(info.handle) # and cancel our notifications - if it gets plugged back in we get # the same notification and try and close the same handle... win32gui.UnregisterDeviceNotification(info.hdevnotify) return True def TestDeviceNotifications(dir_names): wc = win32gui.WNDCLASS() wc.lpszClassName = 'test_devicenotify' wc.style = win32con.CS_GLOBALCLASS|win32con.CS_VREDRAW | win32con.CS_HREDRAW wc.hbrBackground = win32con.COLOR_WINDOW+1 wc.lpfnWndProc={win32con.WM_DEVICECHANGE:OnDeviceChange} class_atom=win32gui.RegisterClass(wc) hwnd = win32gui.CreateWindow(wc.lpszClassName, 'Testing some devices', # no need for it to be visible. win32con.WS_CAPTION, 100,100,900,900, 0, 0, 0, None) hdevs = [] # Watch for all USB device notifications filter = win32gui_struct.PackDEV_BROADCAST_DEVICEINTERFACE( GUID_DEVINTERFACE_USB_DEVICE) hdev = win32gui.RegisterDeviceNotification(hwnd, filter, win32con.DEVICE_NOTIFY_WINDOW_HANDLE) hdevs.append(hdev) # and create handles for all specified directories for d in dir_names: hdir = win32file.CreateFile(d, winnt.FILE_LIST_DIRECTORY, winnt.FILE_SHARE_READ | winnt.FILE_SHARE_WRITE | winnt.FILE_SHARE_DELETE, None, # security attributes win32con.OPEN_EXISTING, win32con.FILE_FLAG_BACKUP_SEMANTICS | # required privileges: SE_BACKUP_NAME and SE_RESTORE_NAME. win32con.FILE_FLAG_OVERLAPPED, None) filter = win32gui_struct.PackDEV_BROADCAST_HANDLE(hdir) hdev = win32gui.RegisterDeviceNotification(hwnd, filter, win32con.DEVICE_NOTIFY_WINDOW_HANDLE) hdevs.append(hdev) # now start a message pump and wait for messages to be delivered. print "Watching", len(hdevs), "handles - press Ctrl+C to terminate, or" print "add and remove some USB devices..." if not dir_names: print "(Note you can also pass paths to watch on the command-line - eg," print "pass the root of an inserted USB stick to see events specific to" print "that volume)" while 1: win32gui.PumpWaitingMessages() time.sleep(0.01) win32gui.DestroyWindow(hwnd) win32gui.UnregisterClass(wc.lpszClassName, None) if __name__=='__main__': # optionally pass device/directory names to watch for notifications. # Eg, plug in a USB device - assume it connects as E: - then execute: # % win32gui_devicenotify.py E: # Then remove and insert the device. TestDeviceNotifications(sys.argv[1:]) |
From: Mark H. <mha...@us...> - 2008-05-04 10:45:52
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28146/win32/src Modified Files: win32gui.i Log Message: Support for RegisterDeviceNotification and related structures, including a new demo and updates to serviceEvents demo. Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.116 retrieving revision 1.117 diff -C2 -d -r1.116 -r1.117 *** win32gui.i 12 Feb 2008 17:39:43 -0000 1.116 --- win32gui.i 4 May 2008 10:45:54 -0000 1.117 *************** *** 32,35 **** --- 32,36 ---- #include "commctrl.h" #include "windowsx.h" // For edit control hacks. + #include "Dbt.h" // device notification #include "malloc.h" *************** *** 173,178 **** { PyObject *ret=new PyGdiHANDLE(h); ! if (ret==NULL) ! PyErr_NoMemory(); return ret; } --- 174,181 ---- { PyObject *ret=new PyGdiHANDLE(h); ! if (ret==NULL) { ! DeleteObject(h); ! PyErr_NoMemory(); ! } return ret; } *************** *** 216,219 **** --- 219,255 ---- } + %{ + // @object PyHDEVNOTIFY|A handle returned by RegisterDeviceNotifications which + // automatically calls UnregisterDeviceNotification on destruction. + // Inherits the methods and properties of <o PyHANDLE>. + class PyHDEVNOTIFY: public PyHANDLE + { + public: + PyHDEVNOTIFY(HANDLE hInit) : PyHANDLE(hInit) {} + virtual BOOL Close(void){ + BOOL ret=UnregisterDeviceNotification(m_handle); + if (!ret) + PyWin_SetAPIError("UnregisterDeviceNotification"); + m_handle = 0; + return ret; + } + virtual const char *GetTypeName(){ + return "PyHDEVNOTIFY"; + } + }; + + PyObject *PyWinObject_FromHDEVNOTIFY(HGDIOBJ h) + { + PyObject *ret=new PyHDEVNOTIFY(h); + if (ret==NULL) { + UnregisterDeviceNotification(h); + PyErr_NoMemory(); + } + return ret; + } + %} + // TODO: SWIG support for PyHDEVNOTIFY - but SWIG currently doesn't use it. + + // Written to the module init function. %init %{ *************** *** 1447,1451 **** #endif // @pyparm int|len||length of the buffer object ! // @pyparm int|addr||Address of the memory to reference if (!PyArg_ParseTuple(args, input_fmt, &len,&addr)) return NULL; --- 1483,1491 ---- #endif // @pyparm int|len||length of the buffer object ! // @pyparm int|addr||Address of the memory to reference. If zero or not ! // specified, a new buffer object is created with the specified size. ! // @todo We should consider deprecating and dropping the behaviour when ! // the address is zero - it leads to unexpected bugs, as passing NULL ! // appears to return a reference to what was valid memory. if (!PyArg_ParseTuple(args, input_fmt, &len,&addr)) return NULL; *************** *** 1453,1458 **** if(NULL == addr) return PyBuffer_New(len); ! else return PyBuffer_FromMemory(addr, len); } %} --- 1493,1504 ---- if(NULL == addr) return PyBuffer_New(len); ! else { ! if (IsBadReadPtr(addr, len)) { ! PyErr_SetString(PyExc_ValueError, ! "The value is not a valid address for reading"); ! return NULL; ! } return PyBuffer_FromMemory(addr, len); + } } %} *************** *** 1477,1483 **** if (len==-1) ! len = _tcslen(addr); ! if (len == 0) return PyUnicodeObject_FromString(""); if (IsBadReadPtr(addr, len)) { PyErr_SetString(PyExc_ValueError, --- 1523,1529 ---- if (len==-1) ! len = strlen(addr); ! if (len == 0) return PyString_FromString(""); if (IsBadReadPtr(addr, len)) { PyErr_SetString(PyExc_ValueError, *************** *** 1485,1489 **** return NULL; } ! return PyWinObject_FromTCHAR(addr, len); } %} --- 1531,1535 ---- return NULL; } ! return PyString_FromStringAndSize(addr, len); } %} *************** *** 7332,7333 **** --- 7378,7418 ---- HWND GetConsoleWindow(); #endif + + %{ + // @pyswig <o PyHDEVNOTIFY>|RegisterDeviceNotification|Registers the device or type of device for which a window will receive notifications. + PyObject *PyRegisterDeviceNotification(PyObject *self, PyObject *args) + { + unsigned int flags; + PyObject *obh, *obFilter; + if (!PyArg_ParseTuple(args, "OOk:RegisterDeviceNotification", + &obh, // @pyparm <o PyHANDLE>|handle||The handle to a window or a service + &obFilter, // @pyparm buffer|filter||A buffer laid out like one of the DEV_BROADCAST_* structures, generally built by one of the win32gui_struct helpers. + &flags)) // @pyparm int|flags|| + return NULL; + HANDLE handle; + if (!PyWinObject_AsHANDLE(obh, &handle)) + return NULL; + const void *filter; + Py_ssize_t nbytes; + if (PyObject_AsReadBuffer(obFilter, &filter, &nbytes)==-1) + return NULL; + // basic sanity check. + Py_ssize_t struct_bytes = ((DEV_BROADCAST_HDR *)filter)->dbch_size; + if (nbytes != struct_bytes) + return PyErr_Format(PyExc_ValueError, + "buffer isn't a DEV_BROADCAST_* structure: " + "structure says it has %d bytes, but %d was provided", + (int)struct_bytes, (int)nbytes); + // @pyseeapi RegisterDeviceNotification + HDEVNOTIFY not = RegisterDeviceNotification(handle, (void *)filter, flags); + if (not == NULL) + return PyWin_SetAPIError("RegisterDeviceNotification"); + return PyWinObject_FromHDEVNOTIFY(not); + } + %} + %native(RegisterDeviceNotification) PyRegisterDeviceNotification; + + // @pyswig |UnregisterDeviceNotification|Unregisters a Device Notification handle. + // It is generally not necessary to call this function manually, but in some cases, + // handle values may be extracted via the struct module and need to be closed explicitly. + BOOLAPI UnregisterDeviceNotification(HANDLE); |
From: Mark H. <mha...@us...> - 2008-05-04 10:45:51
|
Update of /cvsroot/pywin32/pywin32/win32/Demos/service In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28146/win32/Demos/service Modified Files: serviceEvents.py Log Message: Support for RegisterDeviceNotification and related structures, including a new demo and updates to serviceEvents demo. Index: serviceEvents.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Demos/service/serviceEvents.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** serviceEvents.py 12 Feb 2008 12:53:07 -0000 1.2 --- serviceEvents.py 4 May 2008 10:45:54 -0000 1.3 *************** *** 1,8 **** --- 1,21 ---- # A Demo of a service that takes advantage of the additional notifications # available in later Windows versions. + + # Note that all output is written as event log entries - so you must install + # and start the service, then look at the event log for messages as events + # are generated. + + # Events are generated for USB device insertion and removal, power state + # changes and hardware profile events - so try putting your computer to + # sleep and waking it, inserting a memory stick, etc then check the event log + import win32serviceutil, win32service import win32event import servicemanager + # Most event notification support lives around win32gui + import win32gui, win32gui_struct, win32con + GUID_DEVINTERFACE_USB_DEVICE = "{A5DCBF10-6530-11D2-901F-00C04FB951ED}" + class EventDemoService(win32serviceutil.ServiceFramework): _svc_name_ = "PyServiceEventDemo" *************** *** 13,16 **** --- 26,35 ---- win32serviceutil.ServiceFramework.__init__(self, args) self.hWaitStop = win32event.CreateEvent(None, 0, 0, None) + # register for a device notification - we pass our service handle + # instead of a window handle. + filter = win32gui_struct.PackDEV_BROADCAST_DEVICEINTERFACE( + GUID_DEVINTERFACE_USB_DEVICE) + self.hdn = win32gui.RegisterDeviceNotification(self.ssh, filter, + win32con.DEVICE_NOTIFY_SERVICE_HANDLE) # Override the base class so we can accept additional events. *************** *** 20,23 **** --- 39,43 ---- rc |= win32service.SERVICE_ACCEPT_PARAMCHANGE \ | win32service.SERVICE_ACCEPT_NETBINDCHANGE \ + | win32service.SERVICE_CONTROL_DEVICEEVENT \ | win32service.SERVICE_ACCEPT_HARDWAREPROFILECHANGE \ | win32service.SERVICE_ACCEPT_POWEREVENT \ *************** *** 30,35 **** # This is only showing a few of the extra events - see the MSDN # docs for "HandlerEx callback" for more info. ! # XXX can't do SERVICE_CONTROL_DEVICEEVENT until we wrap RegisterDeviceNotification. ! if control == win32service.SERVICE_CONTROL_HARDWAREPROFILECHANGE: msg = "A hardware profile changed: type=%s, data=%s" % (event_type, data) elif control == win32service.SERVICE_CONTROL_POWEREVENT: --- 50,57 ---- # This is only showing a few of the extra events - see the MSDN # docs for "HandlerEx callback" for more info. ! if control == win32service.SERVICE_CONTROL_DEVICEEVENT: ! info = win32gui_struct.UnpackDEV_BROADCAST(data) ! msg = "A device event occurred: %x - %s" % (event_type, info) ! elif control == win32service.SERVICE_CONTROL_HARDWAREPROFILECHANGE: msg = "A hardware profile changed: type=%s, data=%s" % (event_type, data) elif control == win32service.SERVICE_CONTROL_POWEREVENT: |
From: Mark H. <mha...@us...> - 2008-05-04 10:45:50
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28146/win32/Lib Modified Files: win32gui_struct.py Log Message: Support for RegisterDeviceNotification and related structures, including a new demo and updates to serviceEvents demo. Index: win32gui_struct.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32gui_struct.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** win32gui_struct.py 6 Sep 2007 06:44:05 -0000 1.10 --- win32gui_struct.py 4 May 2008 10:45:54 -0000 1.11 *************** *** 24,27 **** --- 24,30 ---- # mechanism - I think it makes more sense to support ctype structures # at the win32gui level, then there will be no need for this module at all. + # XXX - the above makes sense in terms of what is built and passed to + # win32gui (ie, the Pack* functions) - but doesn't make as much sense for + # the Unpack* functions, where the aim is user convenience. import win32gui *************** *** 30,33 **** --- 33,37 ---- import array import commctrl + import pywintypes # Generic WM_NOTIFY unpacking *************** *** 556,557 **** --- 560,625 ---- fmt, param, image, order, 0, 0) return array.array("c", buf), extra + + # Device notification stuff + + # Generic function for packing a DEV_BROADCAST_* structure - generally used + # by the other PackDEV_BROADCAST_* functions in this module. + def PackDEV_BROADCAST(devicetype, rest_fmt, rest_data, extra_data=''): + # It seems a requirement is 4 byte alignment, even for the 'BYTE data[1]' + # field (eg, that would make DEV_BROADCAST_HANDLE 41 bytes, but we must + # be 44. + extra_data += '\0' * (4-len(extra_data)%4) + format = "iii" + rest_fmt + full_size = struct.calcsize(format) + len(extra_data) + data = (full_size, devicetype, 0) + rest_data + return struct.pack(format, *data) + extra_data + + def PackDEV_BROADCAST_HANDLE(handle, hdevnotify=0, guid="\0"*16, name_offset=0, data="\0"): + return PackDEV_BROADCAST(win32con.DBT_DEVTYP_HANDLE, "PP16sl", + (long(handle), long(hdevnotify), str(buffer(guid)), name_offset), + data) + + def PackDEV_BROADCAST_DEVICEINTERFACE(classguid, name=""): + rest_fmt = "16s%ds" % len(name) + # str(buffer(iid)) hoops necessary to get the raw IID bytes. + rest_data = (str(buffer(pywintypes.IID(classguid))), name) + return PackDEV_BROADCAST(win32con.DBT_DEVTYP_DEVICEINTERFACE, rest_fmt, rest_data) + + # An object returned by UnpackDEV_BROADCAST. + class DEV_BROADCAST_INFO: + def __init__(self, devicetype, **kw): + self.devicetype = devicetype + self.__dict__.update(kw) + def __str__(self): + return "DEV_BROADCAST_INFO:" + str(self.__dict__) + + # Support for unpacking the 'lparam' + def UnpackDEV_BROADCAST(lparam): + # guard for 0 here, otherwise PyMakeBuffer will create a new buffer. + if lparam == 0: + return None + hdr_size = struct.calcsize("iii") + hdr_buf = win32gui.PyMakeBuffer(hdr_size, lparam) + size, devtype, reserved = struct.unpack("iii", hdr_buf) + rest = win32gui.PyMakeBuffer(size-hdr_size, lparam+hdr_size) + + extra = x = {} + if devtype == win32con.DBT_DEVTYP_HANDLE: + # 2 handles, a GUID, a LONG and possibly an array following... + fmt = "PP16sl" + x['handle'], x['hdevnotify'], guid_bytes, x['nameoffset'] = \ + struct.unpack(fmt, rest[:struct.calcsize(fmt)]) + x['eventguid'] = pywintypes.IID(guid_bytes, True) + elif devtype == win32con.DBT_DEVTYP_DEVICEINTERFACE: + # guid, null-terminated name + x['classguid'] = pywintypes.IID(rest[:16], 1) + name = rest[16:] + if '\0' in name: + name = name.split('\0', 1)[0] + x['name'] = name + elif devtype == win32con.DBT_DEVTYP_VOLUME: + # int mask and flags + x['unitmask'], x['flags'] = struct.unpack("II", rest[:struct.calcsize("II")]) + else: + raise NotImplementedError("unknown device type %d" % (devtype,)) + return DEV_BROADCAST_INFO(devtype, **extra) |
From: Mark H. <mha...@us...> - 2008-05-04 10:45:50
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28146 Modified Files: CHANGES.txt Log Message: Support for RegisterDeviceNotification and related structures, including a new demo and updates to serviceEvents demo. Index: CHANGES.txt =================================================================== RCS file: /cvsroot/pywin32/pywin32/CHANGES.txt,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** CHANGES.txt 12 Feb 2008 00:10:57 -0000 1.18 --- CHANGES.txt 4 May 2008 10:45:51 -0000 1.19 *************** *** 8,11 **** --- 8,15 ---- Since build 210: ---------------- + * Support for RegisterDeviceNotification in win32gui and for packing and + unpacking the various structures in win32gui_struct. Demos in + win32\Demos\win32gui_devicenotify.py and service\serviceEvents.py + * adodbapi added to pywin32 package CVS tree: - this pure python package is a fully dbapi 2.0 compliant database access |
From: Mark H. <mha...@us...> - 2008-05-04 10:44:10
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28112/win32/src Modified Files: win32file.i Log Message: autoduck Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.89 retrieving revision 1.90 diff -C2 -d -r1.89 -r1.90 *** win32file.i 9 Apr 2008 23:53:32 -0000 1.89 --- win32file.i 4 May 2008 10:44:14 -0000 1.90 *************** *** 436,440 **** //FileIOCompletionRoutine ! // @pyswig |FindClose|Closes a handle opened with <om win32file.FindOpen> BOOLAPI FindClose(HANDLE hFindFile); // @pyparm int|hFindFile||file search handle --- 436,440 ---- //FileIOCompletionRoutine ! // @pyswig |FindClose|Closes a find handle. BOOLAPI FindClose(HANDLE hFindFile); // @pyparm int|hFindFile||file search handle |
From: Mark H. <mha...@us...> - 2008-05-04 10:43:36
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27736/win32/Lib Modified Files: win32con.py Log Message: device notification constants from dbt.h Index: win32con.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32con.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** win32con.py 10 Apr 2008 02:09:43 -0000 1.22 --- win32con.py 4 May 2008 10:43:37 -0000 1.23 *************** *** 4947,4948 **** --- 4947,5017 ---- FILE_NAME_NORMALIZED = 0 FILE_NAME_OPENED = 8 + + DEVICE_NOTIFY_WINDOW_HANDLE = 0x00000000 + DEVICE_NOTIFY_SERVICE_HANDLE = 0x00000001 + + # From Dbt.h + # Generated by h2py from Dbt.h + WM_DEVICECHANGE = 0x0219 + BSF_QUERY = 0x00000001 + BSF_IGNORECURRENTTASK = 0x00000002 + BSF_FLUSHDISK = 0x00000004 + BSF_NOHANG = 0x00000008 + BSF_POSTMESSAGE = 0x00000010 + BSF_FORCEIFHUNG = 0x00000020 + BSF_NOTIMEOUTIFNOTHUNG = 0x00000040 + BSF_MSGSRV32ISOK = (-2147483648) + BSF_MSGSRV32ISOK_BIT = 31 + BSM_ALLCOMPONENTS = 0x00000000 + BSM_VXDS = 0x00000001 + BSM_NETDRIVER = 0x00000002 + BSM_INSTALLABLEDRIVERS = 0x00000004 + BSM_APPLICATIONS = 0x00000008 + DBT_APPYBEGIN = 0x0000 + DBT_APPYEND = 0x0001 + DBT_DEVNODES_CHANGED = 0x0007 + DBT_QUERYCHANGECONFIG = 0x0017 + DBT_CONFIGCHANGED = 0x0018 + DBT_CONFIGCHANGECANCELED = 0x0019 + DBT_MONITORCHANGE = 0x001B + DBT_SHELLLOGGEDON = 0x0020 + DBT_CONFIGMGAPI32 = 0x0022 + DBT_VXDINITCOMPLETE = 0x0023 + DBT_VOLLOCKQUERYLOCK = 0x8041 + DBT_VOLLOCKLOCKTAKEN = 0x8042 + DBT_VOLLOCKLOCKFAILED = 0x8043 + DBT_VOLLOCKQUERYUNLOCK = 0x8044 + DBT_VOLLOCKLOCKRELEASED = 0x8045 + DBT_VOLLOCKUNLOCKFAILED = 0x8046 + LOCKP_ALLOW_WRITES = 0x01 + LOCKP_FAIL_WRITES = 0x00 + LOCKP_FAIL_MEM_MAPPING = 0x02 + LOCKP_ALLOW_MEM_MAPPING = 0x00 + LOCKP_USER_MASK = 0x03 + LOCKP_LOCK_FOR_FORMAT = 0x04 + LOCKF_LOGICAL_LOCK = 0x00 + LOCKF_PHYSICAL_LOCK = 0x01 + DBT_NO_DISK_SPACE = 0x0047 + DBT_LOW_DISK_SPACE = 0x0048 + DBT_CONFIGMGPRIVATE = 0x7FFF + DBT_DEVICEARRIVAL = 0x8000 + DBT_DEVICEQUERYREMOVE = 0x8001 + DBT_DEVICEQUERYREMOVEFAILED = 0x8002 + DBT_DEVICEREMOVEPENDING = 0x8003 + DBT_DEVICEREMOVECOMPLETE = 0x8004 + DBT_DEVICETYPESPECIFIC = 0x8005 + DBT_CUSTOMEVENT = 0x8006 + DBT_DEVTYP_OEM = 0x00000000 + DBT_DEVTYP_DEVNODE = 0x00000001 + DBT_DEVTYP_VOLUME = 0x00000002 + DBT_DEVTYP_PORT = 0x00000003 + DBT_DEVTYP_NET = 0x00000004 + DBT_DEVTYP_DEVICEINTERFACE = 0x00000005 + DBT_DEVTYP_HANDLE = 0x00000006 + DBTF_MEDIA = 0x0001 + DBTF_NET = 0x0002 + DBTF_RESOURCE = 0x00000001 + DBTF_XPORT = 0x00000002 + DBTF_SLOWNET = 0x00000004 + DBT_VPOWERDAPI = 0x8100 + DBT_USERDEFINED = 0xFFFF |
From: Roger U. <ru...@us...> - 2008-04-26 22:17:44
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14292 Modified Files: PyIDataObject.cpp Log Message: Autoduck improvements Index: PyIDataObject.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIDataObject.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyIDataObject.cpp 20 May 2005 23:25:49 -0000 1.6 --- PyIDataObject.cpp 26 Apr 2008 22:17:49 -0000 1.7 *************** *** 1,4 **** --- 1,5 ---- // This file implements the IDataObject Interface and Gateway for Python. // Generated by makegw.py + // @doc - This file contains autoduck documentation #include "stdafx.h" *************** *** 8,15 **** #include "PyComTypeObjects.h" BOOL PyObject_AsFORMATETC(PyObject *ob, FORMATETC *petc) { PyObject *obtd; ! if (!PyArg_ParseTuple(ob, "iOiii", &petc->cfFormat, &obtd, --- 9,22 ---- #include "PyComTypeObjects.h" + // @object PyFORMATETC|Tuple representing a FORMATETC struct describing an OLE data format + // @tupleitem 0|int|Format|CLIPFORMAT value (CF_*) identifying the type of data + // @tupleitem 1|None|td|DVTARGETDEVICE (currently not supported, use only None) + // @tupleitem 2|int|Aspect|One of pythoncom.DVASPECT_* values specifying level of detail + // @tupleitem 3|int|index|Usually -1, used only when data spans multiple pages + // @tupleitem 4|int|tymed|One of pythoncom.TYMED_* values indicating how the data is stored BOOL PyObject_AsFORMATETC(PyObject *ob, FORMATETC *petc) { PyObject *obtd; ! if (!PyArg_ParseTuple(ob, "iOiii:FORMATETC", &petc->cfFormat, &obtd, *************** *** 46,50 **** } - // @doc - This file contains autoduck documentation // --------------------------------------------------- // --- 53,56 ---- *************** *** 66,70 **** } ! // @pymethod <o PySTGMEDIUM>|PyIDataObject|GetData|Description of GetData. PyObject *PyIDataObject::GetData(PyObject *self, PyObject *args) { --- 72,76 ---- } ! // @pymethod <o PySTGMEDIUM>|PyIDataObject|GetData|Retrieves data from the object in specified format PyObject *PyIDataObject::GetData(PyObject *self, PyObject *args) { *************** *** 74,78 **** FORMATETC formatetcIn; PyObject *obpformatetcIn; ! // @pyparm <o PyFORMATETC>|pformatetcIn||Description for pformatetcIn if ( !PyArg_ParseTuple(args, "O:GetData", &obpformatetcIn) ) return NULL; --- 80,84 ---- FORMATETC formatetcIn; PyObject *obpformatetcIn; ! // @pyparm <o PyFORMATETC>|pformatetcIn||Tuple representing a FORMATETC struct describing how the data should be returned if ( !PyArg_ParseTuple(args, "O:GetData", &obpformatetcIn) ) return NULL; *************** *** 93,97 **** } ! // @pymethod <o PySTGMEDIUM>|PyIDataObject|GetDataHere|Description of GetDataHere. PyObject *PyIDataObject::GetDataHere(PyObject *self, PyObject *args) { --- 99,103 ---- } ! // @pymethod <o PySTGMEDIUM>|PyIDataObject|GetDataHere|Retunrs a copy of the object's data in specified format PyObject *PyIDataObject::GetDataHere(PyObject *self, PyObject *args) { *************** *** 101,105 **** FORMATETC formatetc; PyObject *obpformatetc; ! // @pyparm <o PyFORMATETC>|pformatetcIn||Description for pformatetcIn if ( !PyArg_ParseTuple(args, "O:GetDataHere", &obpformatetc) ) return NULL; --- 107,111 ---- FORMATETC formatetc; PyObject *obpformatetc; ! // @pyparm <o PyFORMATETC>|pformatetcIn||Tuple representing a FORMATETC struct describing how the data should be returned if ( !PyArg_ParseTuple(args, "O:GetDataHere", &obpformatetc) ) return NULL; *************** *** 119,123 **** } ! // @pymethod |PyIDataObject|QueryGetData|Description of QueryGetData. PyObject *PyIDataObject::QueryGetData(PyObject *self, PyObject *args) { --- 125,130 ---- } ! // @pymethod |PyIDataObject|QueryGetData|Checks if the objects supports returning data in a particular format. ! // @rdesc Returns None if the object supports the specified format, otherwise an error is raised. PyObject *PyIDataObject::QueryGetData(PyObject *self, PyObject *args) { *************** *** 127,131 **** FORMATETC formatetc; PyObject *obpformatetc; ! // @pyparm <o PyFORMATETC>|pformatetc||Description for pformatetc if ( !PyArg_ParseTuple(args, "O:QueryGetData", &obpformatetc) ) return NULL; --- 134,138 ---- FORMATETC formatetc; PyObject *obpformatetc; ! // @pyparm <o PyFORMATETC>|pformatetc||Tuple representing a FORMATETC struct describing how the data should be returned if ( !PyArg_ParseTuple(args, "O:QueryGetData", &obpformatetc) ) return NULL; *************** *** 145,149 **** } ! // @pymethod |PyIDataObject|GetCanonicalFormatEtc|Description of GetCanonicalFormatEtc. PyObject *PyIDataObject::GetCanonicalFormatEtc(PyObject *self, PyObject *args) { --- 152,156 ---- } ! // @pymethod <o PyFORMATETC>|PyIDataObject|GetCanonicalFormatEtc|Transforms a FORMATECT data description into a general format that the object supports PyObject *PyIDataObject::GetCanonicalFormatEtc(PyObject *self, PyObject *args) { *************** *** 153,157 **** FORMATETC formatectIn; PyObject *obpformatectIn; ! // @pyparm <o PyFORMATETC *>|pformatectIn||Description for pformatectIn if ( !PyArg_ParseTuple(args, "O:GetCanonicalFormatEtc", &obpformatectIn) ) return NULL; --- 160,164 ---- FORMATETC formatectIn; PyObject *obpformatectIn; ! // @pyparm <o PyFORMATETC>|pformatectIn||Tuple representing a FORMATETC struct describing how the data should be returned if ( !PyArg_ParseTuple(args, "O:GetCanonicalFormatEtc", &obpformatectIn) ) return NULL; *************** *** 167,176 **** return PyCom_BuildPyException(hr, pIDO, IID_IDataObject ); return PyObject_FromFORMATETC(&formatetcOut); - Py_INCREF(Py_None); - return Py_None; - } ! // @pymethod |PyIDataObject|SetData|Description of SetData. PyObject *PyIDataObject::SetData(PyObject *self, PyObject *args) { --- 174,180 ---- return PyCom_BuildPyException(hr, pIDO, IID_IDataObject ); return PyObject_FromFORMATETC(&formatetcOut); } ! // @pymethod |PyIDataObject|SetData|Sets the data that the object will return. PyObject *PyIDataObject::SetData(PyObject *self, PyObject *args) { *************** *** 180,188 **** FORMATETC formatetc; PyObject *obpformatetc; ! // @pyparm <o PyFORMATETC>|pformatetc||Description for pformatetc PyObject *obmedium; PySTGMEDIUM *pymedium; ! // @pyparm <o PySTGMEDIUM *>|pmedium||Description for pmedium ! // @pyparm int|fRelease||Description for fRelease BOOL fRelease; if ( !PyArg_ParseTuple(args, "OOi:SetData", &obpformatetc, &obmedium, &fRelease) ) --- 184,192 ---- FORMATETC formatetc; PyObject *obpformatetc; ! // @pyparm <o PyFORMATETC>|pformatetc||Tuple representing a FORMATETC struct describing the type of data to be set PyObject *obmedium; PySTGMEDIUM *pymedium; ! // @pyparm <o PySTGMEDIUM>|pmedium||The data to be placed in the object ! // @pyparm boolean|fRelease||If True, transfers ownership of the data to the object. If False, caller is responsible for releasing the STGMEDIUM. BOOL fRelease; if ( !PyArg_ParseTuple(args, "OOi:SetData", &obpformatetc, &obmedium, &fRelease) ) *************** *** 204,208 **** } ! // @pymethod <o PyIEnumFORMATETC>|PyIDataObject|EnumFormatEtc|Description of EnumFormatEtc. PyObject *PyIDataObject::EnumFormatEtc(PyObject *self, PyObject *args) { --- 208,212 ---- } ! // @pymethod <o PyIEnumFORMATETC>|PyIDataObject|EnumFormatEtc|Returns an enumerator to list the data formats that the object supports. PyObject *PyIDataObject::EnumFormatEtc(PyObject *self, PyObject *args) { *************** *** 210,214 **** if ( pIDO == NULL ) return NULL; ! // @pyparm int|dwDirection|DATADIR_GET|Description for dwDirection DWORD dwDirection = DATADIR_GET; IEnumFORMATETC * ppenumFormatEtc; --- 214,218 ---- if ( pIDO == NULL ) return NULL; ! // @pyparm int|dwDirection|DATADIR_GET|Indicates whether to return formats that can be queried or set (pythoncom.DATADIR_GET or DATADIR_SET) DWORD dwDirection = DATADIR_GET; IEnumFORMATETC * ppenumFormatEtc; *************** *** 225,229 **** } ! // @pymethod int|PyIDataObject|DAdvise|Description of DAdvise. PyObject *PyIDataObject::DAdvise(PyObject *self, PyObject *args) { --- 229,234 ---- } ! // @pymethod int|PyIDataObject|DAdvise|Connects the object to an interface that will receive notifications when its data changes ! // @rdesc Returns a unique number that is used to identify the connection PyObject *PyIDataObject::DAdvise(PyObject *self, PyObject *args) { *************** *** 233,239 **** FORMATETC formatetc; PyObject *obpformatetc; ! // @pyparm <o PyFORMATETC>|pformatetc||Description for pformatetc ! // @pyparm int|advf||Description for advf ! // @pyparm <o PyIAdviseSink *>|pAdvSink||Description for pAdvSink PyObject *obpAdvSink; DWORD advf; --- 238,244 ---- FORMATETC formatetc; PyObject *obpformatetc; ! // @pyparm <o PyFORMATETC>|pformatetc||Defines the type of data for which the sink will receive notifications. ! // @pyparm int|advf||Combination of values from ADVF enum. (which currently do not appear in any of the constants modules!) ! // @pyparm <o PyIAdviseSink>|pAdvSink||Currently this interface is not wrapped. PyObject *obpAdvSink; DWORD advf; *************** *** 257,261 **** } ! // @pymethod |PyIDataObject|DUnadvise|Description of DUnadvise. PyObject *PyIDataObject::DUnadvise(PyObject *self, PyObject *args) { --- 262,266 ---- } ! // @pymethod |PyIDataObject|DUnadvise|Disconnects a notification sink. PyObject *PyIDataObject::DUnadvise(PyObject *self, PyObject *args) { *************** *** 263,267 **** if ( pIDO == NULL ) return NULL; ! // @pyparm int|dwConnection||Description for dwConnection DWORD dwConnection; if ( !PyArg_ParseTuple(args, "l:DUnadvise", &dwConnection) ) --- 268,272 ---- if ( pIDO == NULL ) return NULL; ! // @pyparm int|dwConnection||Identifier of the connection as returned by DAdvise. DWORD dwConnection; if ( !PyArg_ParseTuple(args, "l:DUnadvise", &dwConnection) ) *************** *** 277,281 **** } ! // @pymethod <o PyIEnumSTATDATA>|PyIDataObject|EnumDAdvise|Description of EnumDAdvise. PyObject *PyIDataObject::EnumDAdvise(PyObject *self, PyObject *args) { --- 282,286 ---- } ! // @pymethod <o PyIEnumSTATDATA>|PyIDataObject|EnumDAdvise|Creates an enumerator to list connected notification sinks. PyObject *PyIDataObject::EnumDAdvise(PyObject *self, PyObject *args) { *************** *** 298,310 **** static struct PyMethodDef PyIDataObject_methods[] = { ! { "GetData", PyIDataObject::GetData, 1 }, // @pymeth GetData|Description of GetData ! { "GetDataHere", PyIDataObject::GetDataHere, 1 }, // @pymeth GetDataHere|Description of GetDataHere ! { "QueryGetData", PyIDataObject::QueryGetData, 1 }, // @pymeth QueryGetData|Description of QueryGetData ! { "GetCanonicalFormatEtc", PyIDataObject::GetCanonicalFormatEtc, 1 }, // @pymeth GetCanonicalFormatEtc|Description of GetCanonicalFormatEtc ! { "SetData", PyIDataObject::SetData, 1 }, // @pymeth SetData|Description of SetData ! { "EnumFormatEtc", PyIDataObject::EnumFormatEtc, 1 }, // @pymeth EnumFormatEtc|Description of EnumFormatEtc ! { "DAdvise", PyIDataObject::DAdvise, 1 }, // @pymeth DAdvise|Description of DAdvise ! { "DUnadvise", PyIDataObject::DUnadvise, 1 }, // @pymeth DUnadvise|Description of DUnadvise ! { "EnumDAdvise", PyIDataObject::EnumDAdvise, 1 }, // @pymeth EnumDAdvise|Description of EnumDAdvise { NULL } }; --- 303,315 ---- static struct PyMethodDef PyIDataObject_methods[] = { ! { "GetData", PyIDataObject::GetData, 1 }, // @pymeth GetData|Retrieves data from the object in specified format ! { "GetDataHere", PyIDataObject::GetDataHere, 1 }, // @pymeth GetDataHere|Retunrs a copy of the object's data in specified format ! { "QueryGetData", PyIDataObject::QueryGetData, 1 }, // @pymeth QueryGetData|Checks if the object supports returning data in a particular format ! { "GetCanonicalFormatEtc", PyIDataObject::GetCanonicalFormatEtc, 1 }, // @pymeth GetCanonicalFormatEtc|Transforms a FORMATECT data description into a general format that the object supports ! { "SetData", PyIDataObject::SetData, 1 }, // @pymeth SetData|Sets the data that the object will return. ! { "EnumFormatEtc", PyIDataObject::EnumFormatEtc, 1 }, // @pymeth EnumFormatEtc|Returns an enumerator to list the data formats that the object supports. ! { "DAdvise", PyIDataObject::DAdvise, 1 }, // @pymeth DAdvise|Connects the object to an interface that will receive notifications when its data changes ! { "DUnadvise", PyIDataObject::DUnadvise, 1 }, // @pymeth DUnadvise|Disconnects a notification sink. ! { "EnumDAdvise", PyIDataObject::EnumDAdvise, 1 }, // @pymeth EnumDAdvise|Creates an enumerator to list connected notification sinks. { NULL } }; |
From: Roger U. <ru...@us...> - 2008-04-25 09:54:36
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11513 Modified Files: PyIDropTarget.cpp Log Message: Autoduck improvements Index: PyIDropTarget.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIDropTarget.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIDropTarget.cpp 19 Mar 2004 04:31:01 -0000 1.1 --- PyIDropTarget.cpp 25 Apr 2008 09:54:39 -0000 1.2 *************** *** 37,41 **** } ! // @pymethod |PyIDropTarget|DragEnter|Description of DragEnter. PyObject *PyIDropTarget::DragEnter(PyObject *self, PyObject *args) { --- 37,42 ---- } ! // @pymethod int|PyIDropTarget|DragEnter|Called when an object is initially dragged into a window ! // @rdesc Your implementation of this function should return a shellcon.DROPEFFECT_* value indicating if the object can be accepted PyObject *PyIDropTarget::DragEnter(PyObject *self, PyObject *args) { *************** *** 43,56 **** if ( pIDT == NULL ) return NULL; ! // @pyparm <o PyIDataObject *>|pDataObj||Description for pDataObj ! // @pyparm int|grfKeyState||Description for grfKeyState POINTL pt; PyObject *obpt; ! // @pyparm (int, int)|pt||Description for pt PyObject *obpDataObj; IDataObject *pDataObj; DWORD grfKeyState; DWORD dwEffect; ! // @pyparm int|pdwEffect||Description for pdwEffect if ( !PyArg_ParseTuple(args, "OlOl:DragEnter", &obpDataObj, &grfKeyState, &obpt, &dwEffect) ) return NULL; --- 44,57 ---- if ( pIDT == NULL ) return NULL; ! // @pyparm <o PyIDataObject>|pDataObj||IDataObject interface that contains the object being dragged ! // @pyparm int|grfKeyState||Combination of win32con.MK_* flags containing keyboard modifier state POINTL pt; PyObject *obpt; ! // @pyparm (int, int)|pt||(x,y) Screen coordinates of cursor PyObject *obpDataObj; IDataObject *pDataObj; DWORD grfKeyState; DWORD dwEffect; ! // @pyparm int|pdwEffect||shellcon.DROPEFFECT_* value if ( !PyArg_ParseTuple(args, "OlOl:DragEnter", &obpDataObj, &grfKeyState, &obpt, &dwEffect) ) return NULL; *************** *** 71,75 **** } ! // @pymethod |PyIDropTarget|DragOver|Description of DragOver. PyObject *PyIDropTarget::DragOver(PyObject *self, PyObject *args) { --- 72,78 ---- } ! // @pymethod int|PyIDropTarget|DragOver|Called as the dragged object moves over the window ! // @rdesc Your implementation of this function should return a shellcon.DROPEFFECT_* value indicating if the ! // object can be accepted at the current position PyObject *PyIDropTarget::DragOver(PyObject *self, PyObject *args) { *************** *** 77,86 **** if ( pIDT == NULL ) return NULL; ! // @pyparm int|grfKeyState||Description for grfKeyState POINTL pt; PyObject *obpt; ! // @pyparm (int, int)|pt||Description for pt DWORD dwEffect; ! // @pyparm int|pdwEffect||Description for pdwEffect DWORD grfKeyState; if ( !PyArg_ParseTuple(args, "lOl:DragOver", &grfKeyState, &obpt, &dwEffect) ) --- 80,89 ---- if ( pIDT == NULL ) return NULL; ! // @pyparm int|grfKeyState||Combination of win32con.MK_* flags containing keyboard modifier state POINTL pt; PyObject *obpt; ! // @pyparm (int, int)|pt||(x,y) Screen coordinates of cursor DWORD dwEffect; ! // @pyparm int|pdwEffect||shellcon.DROPEFFECT_* value DWORD grfKeyState; if ( !PyArg_ParseTuple(args, "lOl:DragOver", &grfKeyState, &obpt, &dwEffect) ) *************** *** 99,103 **** } ! // @pymethod |PyIDropTarget|DragLeave|Description of DragLeave. PyObject *PyIDropTarget::DragLeave(PyObject *self, PyObject *args) { --- 102,106 ---- } ! // @pymethod |PyIDropTarget|DragLeave|Called as the object is dragged back out of the window PyObject *PyIDropTarget::DragLeave(PyObject *self, PyObject *args) { *************** *** 120,124 **** } ! // @pymethod |PyIDropTarget|Drop|Description of Drop. PyObject *PyIDropTarget::Drop(PyObject *self, PyObject *args) { --- 123,128 ---- } ! // @pymethod int|PyIDropTarget|Drop|Called when the object is dropped onto the window ! // @rdesc Your implementation of this function should return one of the shellcon.DROPEFFECT_* values PyObject *PyIDropTarget::Drop(PyObject *self, PyObject *args) { *************** *** 126,136 **** if ( pIDT == NULL ) return NULL; ! // @pyparm <o PyIDataObject *>|pDataObj||Description for pDataObj ! // @pyparm int|grfKeyState||Description for grfKeyState POINTL pt; PyObject *obpt; ! // @pyparm (int, int)|pt||Description for pt DWORD dwEffect; ! // @pyparm int|dwEffect||Description for dwEffect PyObject *obpDataObj; IDataObject * pDataObj; --- 130,140 ---- if ( pIDT == NULL ) return NULL; ! // @pyparm <o PyIDataObject>|pDataObj||IDataObject interface containing the dropped object ! // @pyparm int|grfKeyState||Combination of win32con.MK_* flags containing keyboard modifier state POINTL pt; PyObject *obpt; ! // @pyparm (int, int)|pt||(x,y) Screen coordinates of cursor DWORD dwEffect; ! // @pyparm int|dwEffect||shellcon.DROPEFFECT_* value PyObject *obpDataObj; IDataObject * pDataObj; *************** *** 155,165 **** } ! // @object PyIDropTarget|Description of the interface static struct PyMethodDef PyIDropTarget_methods[] = { ! { "DragEnter", PyIDropTarget::DragEnter, 1 }, // @pymeth DragEnter|Description of DragEnter ! { "DragOver", PyIDropTarget::DragOver, 1 }, // @pymeth DragOver|Description of DragOver ! { "DragLeave", PyIDropTarget::DragLeave, 1 }, // @pymeth DragLeave|Description of DragLeave ! { "Drop", PyIDropTarget::Drop, 1 }, // @pymeth Drop|Description of Drop { NULL } }; --- 159,169 ---- } ! // @object PyIDropTarget|Interface that acts as a target of OLE drag and drop operations static struct PyMethodDef PyIDropTarget_methods[] = { ! { "DragEnter", PyIDropTarget::DragEnter, 1 }, // @pymeth DragEnter|Called when an object is initially dragged into a window ! { "DragOver", PyIDropTarget::DragOver, 1 }, // @pymeth DragOver|Called as the dragged object moves over the window ! { "DragLeave", PyIDropTarget::DragLeave, 1 }, // @pymeth DragLeave|Called as the object is dragged back out of the window ! { "Drop", PyIDropTarget::Drop, 1 }, // @pymeth Drop|Called when the object is dropped onto the window { NULL } }; |
From: Roger U. <ru...@us...> - 2008-04-25 09:51:13
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10397 Modified Files: PyIShellIconOverlayIdentifier.cpp Log Message: Autoduck improvements Index: PyIShellIconOverlayIdentifier.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellIconOverlayIdentifier.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIShellIconOverlayIdentifier.cpp 25 Jan 2005 09:42:32 -0000 1.1 --- PyIShellIconOverlayIdentifier.cpp 25 Apr 2008 09:51:17 -0000 1.2 *************** *** 25,29 **** } ! // @pymethod |PyIShellIconOverlayIdentifier|IsMemberOf|Description of IsMemberOf. PyObject *PyIShellIconOverlayIdentifier::IsMemberOf(PyObject *self, PyObject *args) { --- 25,30 ---- } ! // @pymethod int|PyIShellIconOverlayIdentifier|IsMemberOf|Determines if a shell object should have an icon overlay ! // @rdesc Implementation of this function should return winerror.S_OK to display the overlay, S_FALSE if not, or E_FAIL on error PyObject *PyIShellIconOverlayIdentifier::IsMemberOf(PyObject *self, PyObject *args) { *************** *** 31,36 **** if ( pISIOI == NULL ) return NULL; ! // @pyparm string/<o unicode>|path||Description for path ! // @pyparm int|attrib||Description for attrib PyObject *obpath; LPWSTR path; --- 32,37 ---- if ( pISIOI == NULL ) return NULL; ! // @pyparm <o PyUnicode>|path||Fully qualified path of the shell object ! // @pyparm int|attrib||Shell attributes, combination of shellcon.SFGAO_* flags PyObject *obpath; LPWSTR path; *************** *** 55,59 **** } ! // @pymethod |PyIShellIconOverlayIdentifier|GetOverlayInfo|Description of GetOverlayInfo. PyObject *PyIShellIconOverlayIdentifier::GetOverlayInfo(PyObject *self, PyObject *args) { --- 56,62 ---- } ! // @pymethod (<o PyUnicode>, int, int)|PyIShellIconOverlayIdentifier|GetOverlayInfo|Retrieves the path to the overlay icon ! // @rdesc Returns the path to the icon file, the index of icon within the file, and Flags containing ! // combination of shellcon.ISIOI_ICON* flags PyObject *PyIShellIconOverlayIdentifier::GetOverlayInfo(PyObject *self, PyObject *args) { *************** *** 79,83 **** } ! // @pymethod |PyIShellIconOverlayIdentifier|GetPriority|Description of GetPriority. PyObject *PyIShellIconOverlayIdentifier::GetPriority(PyObject *self, PyObject *args) { --- 82,87 ---- } ! // @pymethod int|PyIShellIconOverlayIdentifier|GetPriority|Retrieves the relative priority of the overlay ! // @rdesc Implementation of this function should return a number in the range 0-100 (0 is highest priority) PyObject *PyIShellIconOverlayIdentifier::GetPriority(PyObject *self, PyObject *args) { *************** *** 100,109 **** } ! // @object PyIShellIconOverlayIdentifier|Description of the interface static struct PyMethodDef PyIShellIconOverlayIdentifier_methods[] = { ! { "IsMemberOf", PyIShellIconOverlayIdentifier::IsMemberOf, 1 }, // @pymeth IsMemberOf|Description of IsMemberOf ! { "GetOverlayInfo", PyIShellIconOverlayIdentifier::GetOverlayInfo, 1 }, // @pymeth GetOverlayInfo|Description of GetOverlayInfo ! { "GetPriority", PyIShellIconOverlayIdentifier::GetPriority, 1 }, // @pymeth GetPriority|Description of GetPriority { NULL } }; --- 104,113 ---- } ! // @object PyIShellIconOverlayIdentifier|Interface that supplies icon overlay information to the shell static struct PyMethodDef PyIShellIconOverlayIdentifier_methods[] = { ! { "IsMemberOf", PyIShellIconOverlayIdentifier::IsMemberOf, 1 }, // @pymeth IsMemberOf|Determines if a shell object should have an icon overlay ! { "GetOverlayInfo", PyIShellIconOverlayIdentifier::GetOverlayInfo, 1 }, // @pymeth GetOverlayInfo|Retrieves the path to the overlay icon ! { "GetPriority", PyIShellIconOverlayIdentifier::GetPriority, 1 }, // @pymeth GetPriority|Retrieves the relative priority of the overlay { NULL } }; |
From: Roger U. <ru...@us...> - 2008-04-22 06:57:48
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6665 Modified Files: win32apimodule.cpp Log Message: Release thread lock while calling GetFileVersionInfo Index: win32apimodule.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32apimodule.cpp,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** win32apimodule.cpp 27 Feb 2008 10:48:08 -0000 1.84 --- win32apimodule.cpp 22 Apr 2008 06:57:52 -0000 1.85 *************** *** 5543,5547 **** --- 5543,5549 ---- if (!PyWinObject_AsWCHAR(obinfo, &info, FALSE)) goto done; + Py_BEGIN_ALLOW_THREADS buf_len=GetFileVersionInfoSizeW(file_name, &dwHandle); //handle is ignored + Py_END_ALLOW_THREADS if (buf_len==0){ PyWin_SetAPIError("GetFileVersionInfo:GetFileVersionInfoSize",GetLastError()); *************** *** 5553,5558 **** goto done; } ! if (!GetFileVersionInfoW(file_name, dwHandle, buf_len, buf)){ ! PyWin_SetAPIError("GetFileVersionInfo",GetLastError()); goto done; } --- 5555,5563 ---- goto done; } ! Py_BEGIN_ALLOW_THREADS ! success=GetFileVersionInfoW(file_name, dwHandle, buf_len, buf); ! Py_END_ALLOW_THREADS ! if (!success){ ! PyWin_SetAPIError("GetFileVersionInfo"); goto done; } |
From: Roger U. <ru...@us...> - 2008-04-15 21:51:39
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv584 Modified Files: winerror.py Log Message: Remove L from S_OK and S_FALSE values Index: winerror.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/winerror.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** winerror.py 20 Jul 2007 02:00:49 -0000 1.5 --- winerror.py 15 Apr 2008 21:51:40 -0000 1.6 *************** *** 57,62 **** ERROR_SUCCESS = 0 NO_ERROR = 0 ! S_OK = (0L) ! S_FALSE = (1L) ERROR_INVALID_FUNCTION = 1 ERROR_FILE_NOT_FOUND = 2 --- 57,62 ---- ERROR_SUCCESS = 0 NO_ERROR = 0 ! S_OK = 0 ! S_FALSE = 1 ERROR_INVALID_FUNCTION = 1 ERROR_FILE_NOT_FOUND = 2 |
From: Mark H. <mha...@us...> - 2008-04-11 03:15:12
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18563 Modified Files: win32timezone.py Log Message: py2.6 datetime timetuple methods no longer return a true tuple, so update the doctests accordingly. Index: win32timezone.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32timezone.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** win32timezone.py 14 Jan 2008 07:41:15 -0000 1.8 --- win32timezone.py 11 Apr 2008 03:15:15 -0000 1.9 *************** *** 41,48 **** >>> aug2 = datetime.datetime( 2003, 8, 2, tzinfo = tzi ) ! >>> aug2.utctimetuple() (2003, 8, 2, 6, 0, 0, 5, 214, 0) >>> nov2 = datetime.datetime( 2003, 11, 25, tzinfo = tzi ) ! >>> nov2.utctimetuple() (2003, 11, 25, 7, 0, 0, 1, 329, 0) --- 41,48 ---- >>> aug2 = datetime.datetime( 2003, 8, 2, tzinfo = tzi ) ! >>> tuple(aug2.utctimetuple()) (2003, 8, 2, 6, 0, 0, 5, 214, 0) >>> nov2 = datetime.datetime( 2003, 11, 25, tzinfo = tzi ) ! >>> tuple(nov2.utctimetuple()) (2003, 11, 25, 7, 0, 0, 1, 329, 0) |
From: Mark H. <mha...@us...> - 2008-04-11 00:32:05
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24049 Modified Files: setup.py Removed Files: pywin32_preinstall.py Log Message: Make 64bit builds sane for py2.6, remove attempts to support x64 builds in py2.5 and earlier. Remove pywin32_preinstall.py as it is old and for some reason caused bdist_wininst on Vista to crash! Index: setup.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/setup.py,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** setup.py 12 Feb 2008 12:54:19 -0000 1.69 --- setup.py 11 Apr 2008 00:32:08 -0000 1.70 *************** *** 13,35 **** require you to install special SDKs or toolkits. This script will attempt to build as many as it can, and at the end of the build will report any ! extension modules that could not be built and why. Early versions of ! certain Windows headers will also cause certain modules to be skipped (in ! general, the latest "Platform SDK" from: ! http://www.microsoft.com/msdownload/platformsdk/sdkupdate ! should be used. ! If you don't use the extensions that fail to build, you can ignore these ! warnings; if you do use them, you must install the correct libraries. ! The 'mapi' and 'exchange' extensions require the Exchange 2000 SDK from: ! http://www.microsoft.com/downloads/details.aspx?FamilyID={guid} ! where guid is 4afe3504-c209-4a73-ac5d-ff2a4a3b48b7 ! Just install it - this setup script will automatically locate it. ! (updated for build 205: mapi just seems to require the platform SDK, whereas ! the exchange SDK appears missing in action, so these extensions don't build) ! Note: 'axdebug' appears to work with recent Platform SDKs, with no ! additional software needed. It is probably necessary to select an appropriate ! "sub" SDK, but its not clear exactly which one yet (I just grabbed them all!) To install the pywin32 extensions, execute: --- 13,35 ---- require you to install special SDKs or toolkits. This script will attempt to build as many as it can, and at the end of the build will report any ! extension modules that could not be built and why. ! Currently, the Vista SDK and DirectX SDK are required to successfully build ! all extension modules - note that using the Vista SDK doesn't force you to ! use Vista as your build environment. Please use google to find the SDK - ! links to microsoft.com seem to only stay current for a short time. ! Early versions of certain Windows headers/SDK versions will also cause ! certain modules to be skipped. If you don't use the extensions that fail to ! build, you can ignore these warnings; if you do use them, you must install ! the correct libraries. ! The 'exchange' extensions require headers that are no longer in any current ! SDKs, so these fail to build, but the 'mapi' extension should still build. ! Also, 'axdebug' once worked with recent Platform SDKs, with no ! additional software was needed - but currently this extension is known to not ! build. ! Building: ! --------- To install the pywin32 extensions, execute: *************** *** 49,95 **** To build 64bit versions of this: ! * py2.5 and earlier, using VS2003 and earlier: ! These instructions are for cross-compiling on a 32bit environment. ! You must install the platform SDK with 64bit versions of the tools, then ! setup your environment with a command similar to: ! ! {sdk_dir}\bin\SetEnv.Cmd /X64 /Release ! ! then: ! ! set DISTUTILS_USE_SDK=1 ! ! Next, point at the directx SDK - eg: ! ! set INCLUDE=%INCLUDE%;C:\Program Files\Microsoft DirectX SDK (December 2006)\Include ! set LIB=%LIB%;C:\Program Files\Microsoft DirectX SDK (December 2006)\Lib\x64 ! ! Now it starts getting wierd - we need to execute python.exe (32bit) to ! do the distutils build, but this build needs to find 64bit version of ! python.lib etc. The work-around for this (on a 32 bit machine) is: ! ! * Extract a new Python source tree into a new directory ! * Build this tree using the 64bit instructions. ! * set PYTHONHOME=c:\path_to_64bit_python ! * Execute: c:\path_to_32bit_python\python.exe c:\path_to\pywin32\setup.py build ! * un-set PYTHONHOME (set PYTHONHOME=) ! * Execute: c:\path_to_32bit_python_6\python.exe setup.py bdist_msi --skip-build ! [Note that python 6.0 or later *must* be used for this final step. If ! python 6 has not been released, you must use Python as built from the ! svn trunk] ! [XXX - the above is a little wrong, as python 2.6 has moved to vs2008 and ! the trunk currently builds to a different structure. This is still under ! discussion on python-dev] ! (Note that these instructions will have clobbered your 32bit build of ! Python - not the install, just the copy in the 'build' directory. Its ! probably a good idea to clobber the build directory when switching ! platforms so things don't get confused) ! * py2.6 and later - tdb ! * Using VS2005 is not supported; either use the official py25 and earlier ! instructions for cross-compiling, or the new official py26+ instructions ! (using VS2008+) """ # Originally by Thomas Heller, started in 2000 or so. --- 49,66 ---- To build 64bit versions of this: ! * py2.5 and earlier - sorry, I've given up in disgust. Using VS2003 with ! the Vista SDK is just too painful to make work, and VS2005 is not used for ! any released versions of Python. See revision 1.69 of this file for the ! last version that attempted to support and document this process. ! * 2.6 and later: On a 64bit OS, just build as you would on a 32bit platform. ! On a 32bit platform (ie, to cross-compile), you must use VS2008 to ! cross-compile Python itself. Note that by default, the 64bit tools are not ! installed with VS2008, so you may need to adjust your VS2008 setup. Then ! use: ! setup.py build --plat-name=win-amd64 ! see the distutils cross-compilation documentation for more details. """ # Originally by Thomas Heller, started in 2000 or so. *************** *** 106,158 **** False=1==0 - # when cross-compiling on a 32bit platform, the variable CPU reflects - # the *target*. Distutil's get_build_architecture() still reports 'Intel' - # in this environment - so we trust the CPU variable (or in Vista+ SDKs, - # the TARGET_CPU variable) - def get_build_architecture(): - # *sob* - Vista's SDK sets TARGET_CPU to 'x64' and doesn't set CPU at all - # presumably will need something similar for itanium - if os.environ.get("TARGET_CPU") == 'x64': - return "AMD64" - elif os.environ.get("TARGET_CPU") == 'x86': - return "Intel" - try: - return os.environ["CPU"] - except KeyError: - # not set - trust distutils - try: - from distutils.msvccompiler import get_build_architecture as gba - except ImportError: - # ack - early Python - return "Intel" - return gba() - - ARCHITECTURES_64 = ("Itanium", "AMD64") - - is_64bit = get_build_architecture() in ARCHITECTURES_64 - is_32bit = not is_64bit - - # More x64 hacks - all 64bit windows builds have sys.platform=='win32', and - # this is used for the "platform" part of the file and directory names. - # (eg, pywin32-210.1.win32-py2.5.msi) - but this is bad for us - we do - # want a distinction. - # so we monkey-patch distutils :( We must do this before the main distutils - # imports, which does 'from distutils.util import get_platform' - # NOTE: Python 2.6 has the base get_platform() fixed - but there still - # remains the cross-compile issue (ie, get_platform() needs to know the - # *target* platform). The values returned from this function must however - # be in the set of values Python 2.6's get_platform() returns... - def hacked_get_platform(): - """getplaform monkey-patched by pywin32 setup""" - ba = get_build_architecture() - if ba == "AMD64": - return "win-x86_64" - if ba == "Itanium": - return "win-ia64" - return sys.platform - - import distutils.util - distutils.util.get_platform = hacked_get_platform - # The rest of our imports. from distutils.core import setup, Extension, Command --- 77,80 ---- *************** *** 173,176 **** --- 95,110 ---- def get_build_version(): return 6.0 + # nor distutils.log + try: + from distutils import log + except ImportError: + class Log: + def debug(self, msg, *args): + print msg % args + def info(self, msg, *args): + print msg % args + log = Log() + + from distutils.dep_util import newer_group, newer from distutils import dir_util, file_util *************** *** 187,201 **** print "Building pywin32", pywin32_version - # nor distutils.log - try: - from distutils import log - except ImportError: - class Log: - def debug(self, msg, *args): - print msg % args - def info(self, msg, *args): - print msg % args - log = Log() - try: this_file = __file__ --- 121,124 ---- *************** *** 324,327 **** --- 247,251 ---- base_address = None, depends=None, + platforms=None, # none means 'all platforms' ): assert dsp_file or sources, "Either dsp_file or sources must be specified" *************** *** 330,339 **** 'win32/src'] + include_dirs libraries=libraries.split() - # VC2003 on x64 requires this library be explicitly linked... - # (well - apparently it used to :) Vista SDK fails if we do this... - #if is_64bit and msvccompiler.get_build_version() < 8.0: - # libraries.append('bufferoverflowU') - - extra_compile_args = (extra_compile_args or [])[:] # take copy if export_symbol_file: --- 254,257 ---- *************** *** 344,355 **** sources = sources or [] sources.extend(self.get_source_files(dsp_file)) - extra_link_args = extra_link_args or [] - if is_64bit: - extra_link_args.append("/MACHINE:%s" % get_build_architecture()) - # pyconfig.h checks for _M_X64, but it seems the SDK cross-compiler - # doesn't define it (no such problems with VS2005) - extra_compile_args.append('/D_M_X64') - else: - extra_link_args.append("/MACHINE:ix86") # Some of our swigged files behave differently in distutils vs # MSVC based builds. Always define DISTUTILS_BUILD so they can tell. --- 262,265 ---- *************** *** 362,365 **** --- 272,276 ---- self.is_regular_dll = is_regular_dll self.base_address = base_address + self.platforms = platforms Extension.__init__ (self, name, sources, include_dirs, *************** *** 416,430 **** if self.pch_header: self.extra_compile_args = self.extra_compile_args or [] ! # /YX doesn't work in vs2008 ! if is_32bit and get_build_version() < 9.0: self.extra_compile_args.append("/YX"+self.pch_header) pch_name = os.path.join(build_ext.build_temp, self.name) + ".pch" self.extra_compile_args.append("/Fp"+pch_name) ! # Put our DLL base address in. ! base = self.base_address ! if not base: ! base = dll_base_addresses[self.name] ! self.extra_link_args.append("/BASE:0x%x" % (base,)) # like Python, always use debug info, even in release builds --- 327,351 ---- if self.pch_header: self.extra_compile_args = self.extra_compile_args or [] ! # /YX doesn't work in vs2008 or vs2003/64 ! if build_ext.plat_name == 'win32' and get_build_version() < 9.0: self.extra_compile_args.append("/YX"+self.pch_header) pch_name = os.path.join(build_ext.build_temp, self.name) + ".pch" self.extra_compile_args.append("/Fp"+pch_name) ! # bugger - add this to python! ! if build_ext.plat_name=="win32": ! self.extra_link_args.append("/MACHINE:x86") ! else: ! self.extra_link_args.append("/MACHINE:%s" % build_ext.plat_name[4:]) ! # Old vs2003 needs this defined (Python itself uses it) ! if get_build_version() < 9.0 and build_ext.plat_name=="win-amd64": ! self.extra_compile_args.append('/D_M_X64') ! ! # Put our DLL base address in (but not for our executables!) ! if self not in W32_exe_files: ! base = self.base_address ! if not base: ! base = dll_base_addresses[self.name] ! self.extra_link_args.append("/BASE:0x%x" % (base,)) # like Python, always use debug info, even in release builds *************** *** 572,575 **** --- 493,499 ---- self.excluded_extensions = [] # list of (ext, why) self.swig_cpp = True # hrm - deprecated - should use swig_opts=-c++?? + if not hasattr(self, 'plat_name'): + # Old Python version that doesn't support cross-compile + self.plat_name = distutils.util.get_platform() def _fixup_sdk_dirs(self): *************** *** 612,655 **** assert self.compiler.initialized # if not, our env changes will be lost! ! if 'DISTUTILS_USE_SDK' in os.environ: ! # theoretically, this means the environment is already setup ! # appropriately - so there is no need to go sniffing! ! pass ! elif sdk_dir: ! extra = os.path.join(sdk_dir, 'include') ! # should not be possible for the SDK dirs to already be in our ! # include_dirs - they may be in the registry etc from MSVC, but ! # those aren't reflected here... ! assert extra not in self.include_dirs ! # and we will not work as expected if the dirs don't exist assert os.path.isdir(extra), "%s doesn't exist!" % (extra,) self.compiler.add_include_dir(extra) - # and again for lib dirs. - extra = os.path.join(sdk_dir, 'lib') if is_64bit: ! extra = os.path.join(extra, 'x64') ! assert os.path.isdir(extra), extra ! assert extra not in self.library_dirs # see above assert os.path.isdir(extra), "%s doesn't exist!" % (extra,) self.compiler.add_library_dir(extra) - log.debug("After SDK processing, includes are %s", self.compiler.include_dirs) - log.debug("After SDK processing, libs are %s", self.compiler.library_dirs) ! # Vista SDKs have a 'VC' directory with headers and libs for older ! # compilers. We need to hack the support in here so that the ! # directories are after the compiler's own. As noted above, the ! # only way to ensure they are after the compiler's is to put them ! # in the environment, which has the nice side-effect of working ! # for the rc executable. ! # We know its not needed on vs9... ! if get_build_version() < 9.0: ! if os.path.isdir(os.path.join(sdk_dir, 'VC', 'INCLUDE')): ! os.environ["INCLUDE"] += ";" + os.path.join(sdk_dir, 'VC', 'INCLUDE') ! log.debug("Vista SDK found: %%INCLUDE%% now %s", os.environ["INCLUDE"]) ! if os.path.isdir(os.path.join(sdk_dir, 'VC', 'LIB')): ! os.environ["LIB"] += ";" + os.path.join(sdk_dir, 'VC', 'LIB') ! log.debug("Vista SDK found: %%LIB%% now %s", os.environ["LIB"]) ! else: ! print "Warning - can't find an installed platform SDK" if sys.hexversion < 0x02030000: # Python 2.2 distutils doesn't handle the 'PC'/PCBuild directory for --- 536,589 ---- assert self.compiler.initialized # if not, our env changes will be lost! ! is_64bit = self.plat_name == 'win-amd64' ! extra = os.path.join(sdk_dir, 'include') ! # should not be possible for the SDK dirs to already be in our ! # include_dirs - they may be in the registry etc from MSVC, but ! # those aren't reflected here... ! assert extra not in self.include_dirs ! # and we will not work as expected if the dirs don't exist ! assert os.path.isdir(extra), "%s doesn't exist!" % (extra,) ! self.compiler.add_include_dir(extra) ! # and again for lib dirs. ! extra = os.path.join(sdk_dir, 'lib') ! if is_64bit: ! extra = os.path.join(extra, 'x64') ! assert os.path.isdir(extra), extra ! assert extra not in self.library_dirs # see above ! assert os.path.isdir(extra), "%s doesn't exist!" % (extra,) ! self.compiler.add_library_dir(extra) ! # directx sdk sucks - how to locate it automatically? ! # Must manually set DIRECTX_SDK_DIR for now. ! dxsdk_dir = os.environ.get("DIRECTX_SDK_DIR") ! if dxsdk_dir: ! extra = os.path.join(dxsdk_dir, 'include') assert os.path.isdir(extra), "%s doesn't exist!" % (extra,) self.compiler.add_include_dir(extra) if is_64bit: ! tail = 'x64' ! else: ! tail = 'x86' ! extra = os.path.join(dxsdk_dir, 'lib', tail) assert os.path.isdir(extra), "%s doesn't exist!" % (extra,) self.compiler.add_library_dir(extra) ! log.debug("After SDK processing, includes are %s", self.compiler.include_dirs) ! log.debug("After SDK processing, libs are %s", self.compiler.library_dirs) ! ! # Vista SDKs have a 'VC' directory with headers and libs for older ! # compilers. We need to hack the support in here so that the ! # directories are after the compiler's own. As noted above, the ! # only way to ensure they are after the compiler's is to put them ! # in the environment, which has the nice side-effect of working ! # for the rc executable. ! # We know its not needed on vs9... ! if get_build_version() < 9.0: ! if os.path.isdir(os.path.join(sdk_dir, 'VC', 'INCLUDE')): ! os.environ["INCLUDE"] += ";" + os.path.join(sdk_dir, 'VC', 'INCLUDE') ! log.debug("Vista SDK found: %%INCLUDE%% now %s", os.environ["INCLUDE"]) ! if os.path.isdir(os.path.join(sdk_dir, 'VC', 'LIB')): ! os.environ["LIB"] += ";" + os.path.join(sdk_dir, 'VC', 'LIB') ! log.debug("Vista SDK found: %%LIB%% now %s", os.environ["LIB"]) ! if sys.hexversion < 0x02030000: # Python 2.2 distutils doesn't handle the 'PC'/PCBuild directory for *************** *** 664,670 **** def _why_cant_build_extension(self, ext): # Return None, or a reason it can't be built. if self.windows_h_version is None: - include_dirs = self.compiler.include_dirs + \ - os.environ.get("INCLUDE", "").split(os.pathsep) for d in include_dirs: # We look for _WIN32_WINNT instead of WINVER as the Vista --- 598,604 ---- def _why_cant_build_extension(self, ext): # Return None, or a reason it can't be built. + include_dirs = self.compiler.include_dirs + \ + os.environ.get("INCLUDE", "").split(os.pathsep) if self.windows_h_version is None: for d in include_dirs: # We look for _WIN32_WINNT instead of WINVER as the Vista *************** *** 695,706 **** break else: ! # XXX - the below can probably go now - the problem was the ! # sdkddkver.h issue already solved above. ! if is_64bit: ! # *sob* ! print "x64 build - assuming winver == 0x600" ! self.windows_h_version = 0x600 ! else: ! raise RuntimeError, "Can't find a version in Windows.h" if ext.windows_h_version > self.windows_h_version: return "WINDOWS.H with version 0x%x is required, but only " \ --- 629,633 ---- break else: ! raise RuntimeError, "Can't find a version in Windows.h" if ext.windows_h_version > self.windows_h_version: return "WINDOWS.H with version 0x%x is required, but only " \ *************** *** 708,712 **** % (ext.windows_h_version, self.windows_h_version) ! look_dirs = self.include_dirs for h in ext.optional_headers: for d in look_dirs: --- 635,639 ---- % (ext.windows_h_version, self.windows_h_version) ! look_dirs = include_dirs for h in ext.optional_headers: for d in look_dirs: *************** *** 735,738 **** --- 662,668 ---- return "axdebug doesn't build in VC6 debug builds (irony!)" + if ext.platforms and self.plat_name not in ext.platforms: + return "Only available on platforms %s" % (ext.platforms,) + # We update the .libraries list with the resolved library name. # This is really only so "_d" works. *************** *** 743,751 **** path = 'pythonwin\\Scintilla' makefile = 'makefile_pythonwin' ! makeargs = ["QUIET=1"] if self.debug: makeargs.append("DEBUG=1") if not self.verbose: makeargs.append("/C") # nmake: /C Suppress output messages # We build the DLL into our own temp directory, then copy it to the # real directory - this avoids the generated .lib/.exp --- 673,683 ---- path = 'pythonwin\\Scintilla' makefile = 'makefile_pythonwin' ! makeargs = [] ! if self.debug: makeargs.append("DEBUG=1") if not self.verbose: makeargs.append("/C") # nmake: /C Suppress output messages + makeargs.append("QUIET=1") # We build the DLL into our own temp directory, then copy it to the # real directory - this avoids the generated .lib/.exp *************** *** 765,770 **** makeargs.append("SUB_DIR_BIN=%s" % build_temp) makeargs.append("DIR_PYTHON=%s" % sys.prefix) - if is_64bit and get_build_version() < 8.0: - makeargs.append("LINK=bufferoverflowU.lib") cwd = os.getcwd() --- 697,700 ---- *************** *** 795,800 **** self.compiler.initialized = True else: ! assert not self.compiler.initialized ! self.compiler.initialize() self._fixup_sdk_dirs() --- 725,730 ---- self.compiler.initialized = True else: ! if not self.compiler.initialized: ! self.compiler.initialize() self._fixup_sdk_dirs() *************** *** 812,815 **** --- 742,753 ---- for ext in W32_exe_files: + ext.finalize_options(self) + why = self._why_cant_build_extension(ext) + if why is not None: + self.excluded_extensions.append((ext, why)) + assert why, "please give a reason, or None" + print "Skipping %s: %s" % (ext.name, why) + continue + try: self.package = ext.get_pywin32_dir() *************** *** 959,963 **** self.excluded_extensions.append((ext, why)) assert why, "please give a reason, or None" ! print "Skipping", ext.name, why return self.current_extension = ext --- 897,901 ---- self.excluded_extensions.append((ext, why)) assert why, "please give a reason, or None" ! print "Skipping %s: %s" % (ext.name, why) return self.current_extension = ext *************** *** 1006,1030 **** def get_ext_filename(self, name): # The pywintypes and pythoncom extensions have special names if name == "pywin32_system32.pywintypes": ! extra = self.debug and "_d.dll" or ".dll" ! return r"pywin32_system32\pywintypes%d%d%s" % (sys.version_info[0], sys.version_info[1], extra) elif name == "pywin32_system32.pythoncom": ! extra = self.debug and "_d.dll" or ".dll" ! return r"pywin32_system32\pythoncom%d%d%s" % (sys.version_info[0], sys.version_info[1], extra) elif name.endswith("win32.perfmondata"): ! extra = self.debug and "_d.dll" or ".dll" ! return r"win32\perfmondata" + extra elif name.endswith("win32.win32popenWin9x"): ! extra = self.debug and "_d.exe" or ".exe" ! return r"win32\win32popenWin9x" + extra elif name.endswith("win32.pythonservice"): ! extra = self.debug and "_d.exe" or ".exe" ! return r"win32\pythonservice" + extra elif name.endswith("pythonwin.Pythonwin"): ! extra = self.debug and "_d.exe" or ".exe" ! return r"pythonwin\Pythonwin" + extra elif name.endswith("isapi.PyISAPI_loader"): ! extra = self.debug and "_d.dll" or ".dll" ! return r"isapi\PyISAPI_loader" + extra return build_ext.get_ext_filename(self, name) --- 944,963 ---- def get_ext_filename(self, name): # The pywintypes and pythoncom extensions have special names + extra_dll = self.debug and "_d.dll" or ".dll" + extra_exe = self.debug and "_d.exe" or ".exe" if name == "pywin32_system32.pywintypes": ! return r"pywin32_system32\pywintypes%d%d%s" % (sys.version_info[0], sys.version_info[1], extra_dll) elif name == "pywin32_system32.pythoncom": ! return r"pywin32_system32\pythoncom%d%d%s" % (sys.version_info[0], sys.version_info[1], extra_dll) elif name.endswith("win32.perfmondata"): ! return r"win32\perfmondata" + extra_dll elif name.endswith("win32.win32popenWin9x"): ! return r"win32\win32popenWin9x" + extra_exe elif name.endswith("win32.pythonservice"): ! return r"win32\pythonservice" + extra_exe elif name.endswith("pythonwin.Pythonwin"): ! return r"pythonwin\Pythonwin" + extra_exe elif name.endswith("isapi.PyISAPI_loader"): ! return r"isapi\PyISAPI_loader" + extra_dll return build_ext.get_ext_filename(self, name) *************** *** 1337,1341 **** win32/src/win32security_sspi.cpp win32/src/win32security_ds.cpp """), ! ("win32service", "advapi32 oleaut32 user32", True, 0x0500), ("win32trace", "advapi32", False), ("win32wnet", "netapi32 mpr", False), --- 1270,1274 ---- win32/src/win32security_sspi.cpp win32/src/win32security_ds.cpp """), ! ("win32service", "advapi32 oleaut32 user32", True, 0x0501), ("win32trace", "advapi32", False), ("win32wnet", "netapi32 mpr", False), *************** *** 1516,1519 **** --- 1449,1453 ---- """ % dirs).split()), WinExt_win32com('shell', libraries='shell32', pch_header="shell_pch.h", + windows_h_version = 0x600, sources=(""" %(shell)s/PyIActiveDesktop.cpp *************** *** 1610,1622 **** WinExt_pythonwin("win32uiole", pch_header="stdafxole.h", windows_h_version = 0x500), ! ] ! if is_32bit: ! pythonwin_extensions += [ ! WinExt_pythonwin("dde", pch_header="stdafxdde.h"), ] # win32ui is large, so we reserve more bytes than normal dll_base_address += 0x100000 - other_extensions = [] if sys.hexversion >= 0x2030000: --- 1544,1552 ---- WinExt_pythonwin("win32uiole", pch_header="stdafxole.h", windows_h_version = 0x500), ! WinExt_pythonwin("dde", pch_header="stdafxdde.h", platforms=['win32']), ] # win32ui is large, so we reserve more bytes than normal dll_base_address += 0x100000 other_extensions = [] if sys.hexversion >= 0x2030000: *************** *** 1629,1632 **** --- 1559,1567 ---- 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()], pch_header = "StdAfx.h", is_regular_dll = 1, *************** *** 1642,1646 **** W32_exe_files = [ WinExt_win32("win32popenWin9x", ! libraries = "user32"), WinExt_win32("pythonservice", dsp_file = "win32/PythonService EXE.dsp", --- 1577,1582 ---- W32_exe_files = [ WinExt_win32("win32popenWin9x", ! libraries = "user32", ! platforms = ["win32"]), WinExt_win32("pythonservice", dsp_file = "win32/PythonService EXE.dsp", *************** *** 1837,1846 **** author_email = "mha...@us...", url="http://sourceforge.net/projects/pywin32/", ! license="PSA", cmdclass = cmdclass, options = {"bdist_wininst": {"install_script": "pywin32_postinstall.py", - "pre_install_script": "pywin32_preinstall.py", "title": "pywin32-%s" % (build_id,), }, "bdist_msi": --- 1773,1782 ---- author_email = "mha...@us...", url="http://sourceforge.net/projects/pywin32/", ! license="PSF", cmdclass = cmdclass, options = {"bdist_wininst": {"install_script": "pywin32_postinstall.py", "title": "pywin32-%s" % (build_id,), + # "user_access_control": "auto", }, "bdist_msi": --- pywin32_preinstall.py DELETED --- |
From: Mark H. <mha...@us...> - 2008-04-11 00:27:41
|
Update of /cvsroot/pywin32/pywin32/isapi/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18459/isapi/src Modified Files: PyFilterObjects.cpp Log Message: Correct method name in PyArg_ParseTuple format string Index: PyFilterObjects.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/isapi/src/PyFilterObjects.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** PyFilterObjects.cpp 22 Feb 2008 23:03:06 -0000 1.9 --- PyFilterObjects.cpp 11 Apr 2008 00:27:45 -0000 1.10 *************** *** 222,226 **** // @pyparm string|data|| // @pyparm int|reserverd|0| ! if (!PyArg_ParseTuple(args, "s|l:WriteClient", &buffer, &reserved)) return NULL; --- 222,226 ---- // @pyparm string|data|| // @pyparm int|reserverd|0| ! if (!PyArg_ParseTuple(args, "s|l:AddResponseHeaders", &buffer, &reserved)) return NULL; |
From: Mark H. <mha...@us...> - 2008-04-11 00:15:25
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/Scintilla In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18060/Pythonwin/Scintilla Modified Files: makefile_pythonwin Log Message: Pass QUIET=1 to the scintilla build process. Index: makefile_pythonwin =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/Scintilla/makefile_pythonwin,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** makefile_pythonwin 29 Nov 2003 06:56:15 -0000 1.4 --- makefile_pythonwin 11 Apr 2008 00:15:30 -0000 1.5 *************** *** 41,45 **** @set CL=$(CL) /nologo @set LINK=$(LINK) /nologo ! @cd win32 && $(MAKE) /$(MAKEFLAGS) /f scintilla_vc6.mak QUIET=1 DIR_BIN=$(SUB_DIR_BIN) DIR_O=$(SUB_DIR_O) LEXCOMPONENT=$(SCINTILLA_DLL) COMPONENT=dummy $(SCINTILLA_DLL) & cd.. ..\pywin\scintilla\scintillacon.py: Include\Scintilla.h Include\SciLexer.h --- 41,45 ---- @set CL=$(CL) /nologo @set LINK=$(LINK) /nologo ! @cd win32 && $(MAKE) /$(MAKEFLAGS) /f scintilla_vc6.mak DIR_BIN=$(SUB_DIR_BIN) DIR_O=$(SUB_DIR_O) LEXCOMPONENT=$(SCINTILLA_DLL) COMPONENT=dummy $(SCINTILLA_DLL) & cd.. ..\pywin\scintilla\scintillacon.py: Include\Scintilla.h Include\SciLexer.h |
From: Mark H. <mha...@us...> - 2008-04-11 00:12:21
|
Update of /cvsroot/pywin32/pywin32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16626 Modified Files: pywin32_postinstall.py Log Message: Print a message if we don't install shortcuts due not existing folder Index: pywin32_postinstall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/pywin32_postinstall.py,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** pywin32_postinstall.py 18 Jul 2007 08:50:25 -0000 1.20 --- pywin32_postinstall.py 11 Apr 2008 00:12:12 -0000 1.21 *************** *** 391,394 **** --- 391,397 ---- if verbose: print "Shortcut to documentation created" + else: + if verbose: + print "Can't install shortcuts - %r is not a folder" % (fldr,) except Exception, details: print details |
From: Mark H. <mha...@us...> - 2008-04-10 02:09:38
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19929/src Modified Files: win32process.i Log Message: Add THREAD_MODE_BACKGROUND_BEGIN and THREAD_MODE_BACKGROUND_END consts Index: win32process.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32process.i,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** win32process.i 19 Aug 2007 04:28:20 -0000 1.31 --- win32process.i 10 Apr 2008 02:09:43 -0000 1.32 *************** *** 1591,1594 **** --- 1591,1596 ---- #define THREAD_PRIORITY_NORMAL THREAD_PRIORITY_NORMAL // Indicates normal priority for the priority class. #define THREAD_PRIORITY_TIME_CRITICAL THREAD_PRIORITY_TIME_CRITICAL // Indicates a base priority level of 15 for IDLE_PRIORITY_CLASS, NORMAL_PRIORITY_CLASS, or HIGH_PRIORITY_CLASS processes, and a base priority level of 31 for REALTIME_PRIORITY_CLASS processes. + #define THREAD_MODE_BACKGROUND_BEGIN THREAD_MODE_BACKGROUND_BEGIN + #define THREAD_MODE_BACKGROUND_END THREAD_MODE_BACKGROUND_END #ifndef MS_WINCE |
From: Mark H. <mha...@us...> - 2008-04-10 02:09:38
|
Update of /cvsroot/pywin32/pywin32/win32/Lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19929/lib Modified Files: win32con.py Log Message: Add THREAD_MODE_BACKGROUND_BEGIN and THREAD_MODE_BACKGROUND_END consts Index: win32con.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32con.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** win32con.py 25 Aug 2007 05:14:55 -0000 1.21 --- win32con.py 10 Apr 2008 02:09:43 -0000 1.22 *************** *** 4544,4547 **** --- 4544,4550 ---- THREAD_PRIORITY_IDLE = THREAD_BASE_PRIORITY_IDLE THREAD_PRIORITY_NORMAL = 0 + THREAD_MODE_BACKGROUND_BEGIN = 0x00010000 + THREAD_MODE_BACKGROUND_END = 0x00020000 + EXCEPTION_DEBUG_EVENT = 1 CREATE_THREAD_DEBUG_EVENT = 2 |
From: Roger U. <ru...@us...> - 2008-04-09 23:53:27
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1634 Modified Files: win32file.i Log Message: Allow DeviceIoControl to accept a preallocated buffer for overlapped operation, and convert to keyword args Index: win32file.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32file.i,v retrieving revision 1.88 retrieving revision 1.89 diff -C2 -d -r1.88 -r1.89 *** win32file.i 26 Dec 2007 18:09:16 -0000 1.88 --- win32file.i 9 Apr 2008 23:53:32 -0000 1.89 *************** *** 320,385 **** %{ ! // @pyswig string|DeviceIoControl|Call DeviceIoControl ! PyObject *MyDeviceIoControl(PyObject *self, PyObject *args) { ! OVERLAPPED *pOverlapped; ! PyObject *obhFile, *obwriteData; ! HANDLE hDevice; ! DWORD readSize; ! PyObject *obOverlapped = NULL; ! DWORD dwIoControlCode; ! void *writeData; ! DWORD writeSize; ! if (!PyArg_ParseTuple(args, "OlOl|O:DeviceIoControl", ! &obhFile, // @pyparm int|hFile||Handle to the file ! &dwIoControlCode, // @pyparm int|dwIoControlCode||IOControl Code to use. ! &obwriteData, // @pyparm string|data||The data to write. ! &readSize, // @pyparm int|readSize||Size of the buffer to create for the read. ! &obOverlapped)) // @pyparm <o PyOVERLAPPED>|ol|None|An overlapped structure ! return NULL; ! if (obOverlapped==NULL) ! pOverlapped = NULL; ! else { ! if (!PyWinObject_AsOVERLAPPED(obOverlapped, &pOverlapped)) ! return NULL; ! } ! if (!PyWinObject_AsHANDLE(obhFile, &hDevice)) ! return NULL; ! // Some control codes call for NULL input buffer ! if (!PyWinObject_AsReadBuffer(obwriteData, &writeData, &writeSize, TRUE)) return NULL; - void *readData = malloc(readSize); - if (readData==NULL) - return PyErr_Format(PyExc_MemoryError, "Unable to allocate %d bytes", readSize); ! DWORD numRead; ! BOOL ok; ! Py_BEGIN_ALLOW_THREADS ! ok = DeviceIoControl(hDevice, dwIoControlCode, ! writeData, ! writeSize, ! readData, ! readSize, &numRead, pOverlapped); ! Py_END_ALLOW_THREADS ! if (!ok) { ! free(readData); ! return PyWin_SetAPIError("DeviceIoControl"); ! } ! ! PyObject *result = PyString_FromStringAndSize((char *)readData, numRead); ! free(readData); ! return result; } %} %native (OVERLAPPED) PyWinMethod_NewOVERLAPPED; ! %native(DeviceIoControl) MyDeviceIoControl; --- 320,435 ---- %{ ! // @pyswig str/buffer|DeviceIoControl|Sends a control code to a device or file system driver ! // @comm Accepts keyword args ! // @rdesc If a preallocated output buffer is passed in, the returned object ! // may be the original buffer, or a view of the buffer with only the actual ! // size of the retrieved data. ! // <nl>If OutBuffer is a buffer size and the operation is synchronous (ie no ! // Overlapped is passed in), returns a plain string containing the retrieved ! // data. For an async operation, a new writeable buffer is returned. ! PyObject *py_DeviceIoControl(PyObject *self, PyObject *args, PyObject *kwargs) { ! OVERLAPPED *pOverlapped; ! PyObject *obhFile, *obInBuffer, *obOutBuffer, *ret=NULL; ! HANDLE hDevice; ! PyObject *obOverlapped = Py_None; ! DWORD dwIoControlCode; ! void *InBuffer=NULL, *OutBuffer=NULL; ! DWORD InBufferSize=0, OutBufferSize=0; ! BOOL bBuffer=FALSE; ! ! static char *keywords[]={"Device","IoControlCode","InBuffer","OutBuffer","Overlapped", NULL}; ! if (!PyArg_ParseTupleAndKeywords(args, kwargs, "OkOO|O:DeviceIoControl", keywords, ! &obhFile, // @pyparm <o PyHANDLE>|Device||Handle to a file, device, or volume ! &dwIoControlCode, // @pyparm int|IoControlCode||IOControl Code to use, from winioctlcon ! &obInBuffer, // @pyparm str/buffer|InBuffer||The input data for the operation, can be None for some operations. ! &obOutBuffer, // @pyparm int/buffer|OutBuffer||Size of the buffer to allocate for output, or a writeable buffer ! // as returned by <om win32file.AllocateReadBuffer>. ! &obOverlapped)) // @pyparm <o PyOVERLAPPED>|Overlapped|None|An overlapped object for async operations. Device ! // handle must have been opened with FILE_FLAG_OVERLAPPED. ! return NULL; ! if (!PyWinObject_AsHANDLE(obhFile, &hDevice)) ! return NULL; ! if (!PyWinObject_AsReadBuffer(obInBuffer, &InBuffer, &InBufferSize, TRUE)) ! return NULL; ! if (!PyWinObject_AsOVERLAPPED(obOverlapped, &pOverlapped, TRUE)) return NULL; ! OutBufferSize=PyLong_AsLong(obOutBuffer); ! if (OutBufferSize!=(DWORD)-1 || !PyErr_Occurred()){ ! // Return a writable buffer in asynch mode, otherwise a plain string ! // for backward compatibility ! if (pOverlapped != NULL){ ! ret=PyBuffer_New(OutBufferSize); ! if (ret==NULL) ! return NULL; ! (*ret->ob_type->tp_as_buffer->bf_getwritebuffer)(ret, 0, &OutBuffer); ! bBuffer=TRUE; ! } ! else{ ! ret = PyString_FromStringAndSize(NULL, OutBufferSize); ! if (ret==NULL) ! return NULL; ! OutBuffer=PyString_AS_STRING(ret); ! } ! } ! else{ ! PyErr_Clear(); ! if (PyWinObject_AsWriteBuffer(obOutBuffer, &OutBuffer, &OutBufferSize, TRUE)){ ! Py_INCREF(obOutBuffer); ! ret=obOutBuffer; ! bBuffer=TRUE; ! } ! else{ ! PyErr_Clear(); ! return PyErr_Format(PyExc_TypeError, ! "OutBuffer must be either a buffer size or writeable buffer object, not %s", ! obOutBuffer->ob_type->tp_name); ! } ! } ! DWORD numRead; ! BOOL ok; ! Py_BEGIN_ALLOW_THREADS ! ! ok = DeviceIoControl(hDevice, dwIoControlCode, ! InBuffer, ! InBufferSize, ! OutBuffer, ! OutBufferSize, &numRead, pOverlapped); + Py_END_ALLOW_THREADS ! if (!ok){ ! DWORD err=GetLastError(); ! // This error code is returned for a pending overlapped operation. ! if (err==ERROR_IO_PENDING) ! return ret; ! Py_DECREF(ret); ! return PyWin_SetAPIError("DeviceIoControl", err); ! } ! ! // If returned size less than requested buffer size, return only length of valid data ! if (numRead < OutBufferSize){ ! if (bBuffer){ ! // Create a view of existing buffer with actual output size ! PyObject *resized=PyBuffer_FromReadWriteObject(ret, 0, numRead); ! Py_DECREF(ret); ! ret=resized; ! } ! else ! _PyString_Resize(&ret, numRead); ! } ! return ret; } + PyCFunction pfnpy_DeviceIoControl=(PyCFunction)py_DeviceIoControl; %} %native (OVERLAPPED) PyWinMethod_NewOVERLAPPED; ! %native(DeviceIoControl) pfnpy_DeviceIoControl; *************** *** 5031,5034 **** --- 5081,5085 ---- ||(strcmp(pmd->ml_name, "GetFullPathName")==0) ||(strcmp(pmd->ml_name, "GetFileInformationByHandleEx")==0) // not impl yet + ||(strcmp(pmd->ml_name, "DeviceIoControl")==0) ) pmd->ml_flags = METH_VARARGS | METH_KEYWORDS; |
From: Mark H. <mha...@us...> - 2008-04-09 10:03:20
|
Update of /cvsroot/pywin32/pywin32/com/win32com/makegw In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8857/com/win32com/makegw Modified Files: makegwparse.py Log Message: [ 1894593 ] Convert regex to re in makegwparse.py Thanks to Alexandr Zamaraev Index: makegwparse.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/makegw/makegwparse.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** makegwparse.py 8 Oct 2003 23:47:07 -0000 1.11 --- makegwparse.py 9 Apr 2008 10:03:21 -0000 1.12 *************** *** 12,21 **** interface """ ! import regex import traceback import string ! error_not_found = "The requested item could not be found" ! error_not_supported = "The required functionality is not supported" VERBOSE=0 --- 12,26 ---- interface """ ! import re import traceback import string ! class error_not_found(Exception): ! def __init__(self, msg="The requested item could not be found"): ! super(error_not_found, self).__init__(msg) ! ! class error_not_supported(Exception): ! def __init__(self, msg="The required functionality is not supported"): ! super(error_not_supported, self).__init__(msg) VERBOSE=0 *************** *** 475,479 **** "PARSEACTION": ("int", "int", "i"), } ! class ArgFormatterSimple(ArgFormatter): """An arg formatter for simple integer etc types""" --- 480,484 ---- "PARSEACTION": ("int", "int", "i"), } ! class ArgFormatterSimple(ArgFormatter): """An arg formatter for simple integer etc types""" *************** *** 556,560 **** raise error_not_supported, "The type '%s' (%s) is unknown." % (arg.type, arg.name) ! ############################################################# # --- 561,565 ---- raise error_not_supported, "The type '%s' (%s) is unknown." % (arg.type, arg.name) ! ############################################################# # *************** *** 569,573 **** # in,out type name [ ] # -------------- -------- ------------ ------ ! regex = regex.compile('/\\* \\[\\([^\\]]*.*\\)] \\*/[ \t]\\(.*[\\* ]\\)\\([a-zA-Z0-9]+\\)\\(\\[ *]\\)?[),]') def __init__(self, good_interface_names): self.good_interface_names = good_interface_names --- 574,578 ---- # in,out type name [ ] # -------------- -------- ------------ ------ ! regex = re.compile(r'/\* \[([^\]]*.*?)] \*/[ \t](.*[* ]+)(\w+)(\[ *])?[\),]') def __init__(self, good_interface_names): self.good_interface_names = good_interface_names *************** *** 583,607 **** """ line = file.readline() ! if self.regex.search(line)<0: raise error_not_found ! self.name = self.regex.group(3) ! self.inout = string.split(self.regex.group(1),'][') ! typ = string.strip(self.regex.group(2)) self.raw_type = typ self.indirectionLevel = 0 ! if self.regex.group(4): # Has "[ ]" decl self.arrayDecl = 1 try: ! pos = string.rindex(typ, "__RPC_FAR") self.indirectionLevel = self.indirectionLevel + 1 ! typ = string.strip(typ[:pos]) except ValueError: pass ! while 1: try: ! pos = string.rindex(typ, "__RPC_FAR *") self.indirectionLevel = self.indirectionLevel + 1 ! typ = string.strip(typ[:pos]) except ValueError: break --- 588,614 ---- """ line = file.readline() ! mo = self.regex.search(line) ! if not mo: raise error_not_found ! self.name = mo.group(3) ! self.inout = mo.group(1).split('][') ! typ = mo.group(2).strip() self.raw_type = typ self.indirectionLevel = 0 ! if mo.group(4): # Has "[ ]" decl self.arrayDecl = 1 try: ! pos = typ.rindex("__RPC_FAR") self.indirectionLevel = self.indirectionLevel + 1 ! typ = typ[:pos].strip() except ValueError: pass ! ! typ = typ.replace("__RPC_FAR", "") while 1: try: ! pos = typ.rindex("*") self.indirectionLevel = self.indirectionLevel + 1 ! typ = typ[:pos].strip() except ValueError: break *************** *** 638,643 **** # options ret type callconv name # ----------------- -------- -------- -------- ! regex = regex.compile('virtual \\(/\\*.*\\*/ \\)?\\(.*\\) \\(.*\\) \\(.*\\)(\w?') ! def __init__(self, good_interface_names ): self.good_interface_names = good_interface_names self.name = self.result = self.callconv = None --- 645,650 ---- # options ret type callconv name # ----------------- -------- -------- -------- ! regex = re.compile(r'virtual (/\*.*?\*/ )?(.*?) (.*?) (.*?)\(\w?') ! def __init__(self, good_interface_names): self.good_interface_names = good_interface_names self.name = self.result = self.callconv = None *************** *** 650,658 **** is raised. """ ! str = file.readline() ! if self.regex.search(str, 0) == -1: raise error_not_found ! self.name = self.regex.group(4) ! self.result = self.regex.group(2) if self.result != "HRESULT": if self.result=="DWORD": # DWORD is for old old stuff? --- 657,666 ---- is raised. """ ! line = file.readline() ! mo = self.regex.search(line) ! if not mo: raise error_not_found ! self.name = mo.group(4) ! self.result = mo.group(2) if self.result != "HRESULT": if self.result=="DWORD": # DWORD is for old old stuff? *************** *** 678,686 **** # name base # -------- -------- ! regex = regex.compile("\\(interface\\|\\) \\([^ ]*\\) : public \\(.*\\)$") ! def __init__(self): self.methods = [] ! self.name = self.regex.group(2) ! self.base = self.regex.group(3) if VERBOSE: print "Interface %s : public %s" % (self.name, self.base) --- 686,694 ---- # name base # -------- -------- ! regex = re.compile("(interface|) ([^ ]*) : public (.*)$") ! def __init__(self, mo): self.methods = [] ! self.name = mo.group(2) ! self.base = mo.group(3) if VERBOSE: print "Interface %s : public %s" % (self.name, self.base) *************** *** 697,701 **** except error_not_found: break ! def find_interface(interfaceName, file): """Find and return an interface in a file --- 705,709 ---- except error_not_found: break ! def find_interface(interfaceName, file): """Find and return an interface in a file *************** *** 706,721 **** but not the methods. """ ! line = file.readline() while line: ! if Interface.regex.search(line, 0) >=0: ! name = Interface.regex.group(2) print name if name==interfaceName: ! return Interface() line = file.readline() raise error_not_found ! def parse_interface_info(interfaceName, file): """Find, parse and return an interface in a file --- 714,734 ---- but not the methods. """ ! interface = None line = file.readline() while line: ! mo = Interface.regex.search(line) ! if mo: ! name = mo.group(2) print name + AllConverters[name] = (ArgFormatterInterface, 0, 1) if name==interfaceName: ! interface = Interface(mo) ! interface.BuildMethods(file) line = file.readline() + if interface: + return interface raise error_not_found ! def parse_interface_info(interfaceName, file): """Find, parse and return an interface in a file *************** *** 726,733 **** """ try: ! interface = find_interface(interfaceName, file) ! interface.BuildMethods(file) ! return interface ! except regex.error: traceback.print_exc() print "The interface could not be built, as the regular expression failed!" --- 739,744 ---- """ try: ! return find_interface(interfaceName, file) ! except re.error: traceback.print_exc() print "The interface could not be built, as the regular expression failed!" *************** *** 745,747 **** else: print "%d\n%s\n%s\n%s\n%s" % (res, r.group(1), r.group(2), r.group(3), r.group(4)) - --- 756,757 ---- |