ctypes-commit Mailing List for ctypes (Page 66)
Brought to you by:
theller
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
(8) |
May
(90) |
Jun
(143) |
Jul
(106) |
Aug
(94) |
Sep
(84) |
Oct
(163) |
Nov
(60) |
Dec
(58) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(128) |
Feb
(79) |
Mar
(227) |
Apr
(192) |
May
(179) |
Jun
(41) |
Jul
(53) |
Aug
(103) |
Sep
(28) |
Oct
(38) |
Nov
(81) |
Dec
(17) |
2006 |
Jan
(184) |
Feb
(111) |
Mar
(188) |
Apr
(67) |
May
(58) |
Jun
(123) |
Jul
(73) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Thomas H. <th...@us...> - 2005-03-22 12:51:34
|
Update of /cvsroot/ctypes/ctypes/ctypes/wrap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1629 Modified Files: .cvsignore Log Message: Ignore xml files. Index: .cvsignore =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/wrap/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 4 Feb 2005 17:01:24 -0000 1.1 --- .cvsignore 22 Mar 2005 12:51:08 -0000 1.2 *************** *** 1,2 **** --- 1,3 ---- *.pyc *.pyo + *.xml |
From: Thomas H. <th...@us...> - 2005-03-22 12:50:55
|
Update of /cvsroot/ctypes/ctypes/comtypes/samples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1137 Modified Files: mstask.py Log Message: Work in progress. Index: mstask.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/comtypes/samples/mstask.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mstask.py 11 Mar 2005 17:35:39 -0000 1.2 --- mstask.py 22 Mar 2005 12:50:29 -0000 1.3 *************** *** 25,30 **** # _from_outarg_ slot? # - # refcount leaks! - # from ctypes import * --- 25,28 ---- *************** *** 43,46 **** --- 41,64 ---- WORD = c_ushort + S_OK = 0 + + ################################################################ + class _SYSTEMTIME(Structure): + # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/winbase.h 270 + _fields_ = [ + ('wYear', WORD), + ('wMonth', WORD), + ('wDayOfWeek', WORD), + ('wDay', WORD), + ('wHour', WORD), + ('wMinute', WORD), + ('wSecond', WORD), + ('wMilliseconds', WORD), + ] + LPSYSTEMTIME = POINTER(_SYSTEMTIME) + SYSTEMTIME = _SYSTEMTIME + assert sizeof(_SYSTEMTIME) == 16, sizeof(_SYSTEMTIME) + assert alignment(_SYSTEMTIME) == 2, alignment(_SYSTEMTIME) + ################################################################ *************** *** 53,59 **** --- 71,90 ---- def NewWorkItem(self, name): + # _NewWorkItem returns IUnknown pointer, but we want a ITask pointer. task = self._NewWorkItem(name, byref(CLSID_CTask), byref(ITask._iid_)) return task.QueryInterface(ITask) + def GetTargetComputer(self): + # Need to free the result with CoTaskMemFree + temp = LPWSTR() + self.__com_GetTargetComputer(byref(temp)) + result = temp.value + windll.ole32.CoTaskMemFree(temp) + return result + + def IsOfType(self, name, interface): + # Need to convert HRESULT into Python boolean + return S_OK == self._IsOfType(name, byref(interface._iid_)) + class IScheduledWorkItem(IUnknown): _iid_ = GUID('{a6b952f0-a4b1-11d0-997d-00aa006887ec}') *************** *** 70,79 **** def next(self): ! arr, fetched = self.Next(1) ! if fetched == 0: raise StopIteration ! result = arr[0] ! ## windll.ole32.CoTaskMemFree(arr) ! return result CLSID_CTask = GUID("{148BD520-A2AB-11CE-B11F-00AA00530503}") --- 101,122 ---- def next(self): ! results = self.Next(1) ! if not results: raise StopIteration ! return results[0] ! ! def Next(self, celt): ! # Need to free the results with CoTaskMemFree ! temp = POINTER(LPWSTR)() ! fetched = DWORD() ! self.__com_Next(celt, byref(temp), byref(fetched)) ! if fetched.value == 0: ! return [] ! result = [] ! for i in range(fetched.value): ! result.append(temp[i]) ! windll.ole32.CoTaskMemFree(temp[i]) ! windll.ole32.CoTaskMemFree(temp) ! return result CLSID_CTask = GUID("{148BD520-A2AB-11CE-B11F-00AA00530503}") *************** *** 81,118 **** _iid_ = GUID('{148BD524-A2AB-11CE-B11F-00AA00530503}') ################################################################ ITaskScheduler._methods_ = [ COMMETHOD([], HRESULT, 'SetTargetComputer', ! ( ["in"], LPCWSTR ) ! ), COMMETHOD([], HRESULT, 'GetTargetComputer', ! ( ["out"], POINTER(LPWSTR) ), ! ), COMMETHOD([], HRESULT, 'Enum', ! ( ["out"], POINTER(POINTER(IEnumWorkItems)), "ppEnumWorkItems" ), ! ), COMMETHOD([], HRESULT, 'Activate', ( ["in"], LPCWSTR, "pwszName" ), ( ["in"], POINTER(IID), "riid" ), ! ( ["out"], POINTER(POINTER(IUnknown)), "ppUnk" ), ! ), COMMETHOD([], HRESULT, 'Delete', ! ( ["in"], LPCWSTR, "pwszName" ), ! ), COMMETHOD([], HRESULT, 'NewWorkItem', ( ["in"], LPCWSTR, "pwszTaskName" ), ( ["in"], POINTER(IID), "rclsid"), ( ["in"], POINTER(IID), "riid"), ! ( ["out"], POINTER(POINTER(IUnknown)), "ppUnk"), ! ), COMMETHOD([], HRESULT, 'AddWorkItem', ( ["in"], LPCWSTR, "pwszTaskName" ), ! ( ["in"], POINTER(IScheduledWorkItem), "pWorkItem" ), ! ), COMMETHOD([], HRESULT, 'IsOfType', ( ["in"], LPCWSTR, "pwszName" ), ! ( ["in"], POINTER(IID), "riid"), ! ), ] --- 124,179 ---- _iid_ = GUID('{148BD524-A2AB-11CE-B11F-00AA00530503}') + # These methods must call CoTaskMemFree on the returned LPWSTR: + # GetApplicationName + # GetParameters + # GetWorkingDirectory + + def GetApplicationName(self): + temp = LPWSTR() + self.__com_GetApplicationName(byref(temp)) + result = temp.value + windll.ole32.CoTaskMemFree(temp) + return result + + def GetWorkingDirectory(self): + temp = LPWSTR() + self.__com_GetWorkingDirectory(byref(temp)) + result = temp.value + windll.ole32.CoTaskMemFree(temp) + return result + + def GetParameters(self): + temp = LPWSTR() + self.__com_GetParameters(byref(temp)) + result = temp.value + windll.ole32.CoTaskMemFree(temp) + return result + ################################################################ ITaskScheduler._methods_ = [ COMMETHOD([], HRESULT, 'SetTargetComputer', ! ( ["in"], LPCWSTR )), COMMETHOD([], HRESULT, 'GetTargetComputer', ! ( ["out"], POINTER(LPWSTR) )), COMMETHOD([], HRESULT, 'Enum', ! ( ["out"], POINTER(POINTER(IEnumWorkItems)), "ppEnumWorkItems" )), COMMETHOD([], HRESULT, 'Activate', ( ["in"], LPCWSTR, "pwszName" ), ( ["in"], POINTER(IID), "riid" ), ! ( ["out"], POINTER(POINTER(IUnknown)), "ppUnk" )), COMMETHOD([], HRESULT, 'Delete', ! ( ["in"], LPCWSTR, "pwszName" )), COMMETHOD([], HRESULT, 'NewWorkItem', ( ["in"], LPCWSTR, "pwszTaskName" ), ( ["in"], POINTER(IID), "rclsid"), ( ["in"], POINTER(IID), "riid"), ! ( ["out"], POINTER(POINTER(IUnknown)), "ppUnk")), COMMETHOD([], HRESULT, 'AddWorkItem', ( ["in"], LPCWSTR, "pwszTaskName" ), ! ( ["in"], POINTER(IScheduledWorkItem), "pWorkItem" )), COMMETHOD([], HRESULT, 'IsOfType', ( ["in"], LPCWSTR, "pwszName" ), ! ( ["in"], POINTER(IID), "riid")), ] *************** *** 121,138 **** pass PTASK_TRIGGER = POINTER(_TASK_TRIGGER) ITaskTrigger._methods_ = [ - # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 228 - # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 231 COMMETHOD([], HRESULT, 'SetTrigger', ! ( [], PTASK_TRIGGER ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 234 COMMETHOD([], HRESULT, 'GetTrigger', ! ( [], PTASK_TRIGGER ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 237 COMMETHOD([], HRESULT, 'GetTriggerString', ! ( [], POINTER(LPWSTR) ), ! ), ] --- 182,193 ---- pass PTASK_TRIGGER = POINTER(_TASK_TRIGGER) + ITaskTrigger._methods_ = [ COMMETHOD([], HRESULT, 'SetTrigger', ! ( ["in"], PTASK_TRIGGER, "pTrigger") ), COMMETHOD([], HRESULT, 'GetTrigger', ! ( ["out"], PTASK_TRIGGER, "pTrigger") ), COMMETHOD([], HRESULT, 'GetTriggerString', ! ( ["out"], POINTER(LPWSTR), "ppwszTrigger") ), ] *************** *** 239,388 **** ( ["out"], POINTER(POINTER(IEnumWorkItems)) )) ] - class _SYSTEMTIME(Structure): - # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/winbase.h 270 - _fields_ = [ - ('wYear', WORD), - ('wMonth', WORD), - ('wDayOfWeek', WORD), - ('wDay', WORD), - ('wHour', WORD), - ('wMinute', WORD), - ('wSecond', WORD), - ('wMilliseconds', WORD), - ] - LPSYSTEMTIME = POINTER(_SYSTEMTIME) - SYSTEMTIME = _SYSTEMTIME - assert sizeof(_SYSTEMTIME) == 16, sizeof(_SYSTEMTIME) - assert alignment(_SYSTEMTIME) == 2, alignment(_SYSTEMTIME) IScheduledWorkItem._methods_ = [ # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 373 - # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 377 COMMETHOD([], HRESULT, 'CreateTrigger', ! ( [], POINTER(WORD) ), ! ( [], POINTER(POINTER(ITaskTrigger)) ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 380 COMMETHOD([], HRESULT, 'DeleteTrigger', ! ( [], WORD ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 383 COMMETHOD([], HRESULT, 'GetTriggerCount', ( ["out"], POINTER(WORD), "pwCount")), - # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 387 COMMETHOD([], HRESULT, 'GetTrigger', ! ( [], WORD ), ! ( [], POINTER(POINTER(ITaskTrigger)) ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 391 COMMETHOD([], HRESULT, 'GetTriggerString', ! ( [], WORD ), ! ( [], POINTER(LPWSTR) ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 397 COMMETHOD([], HRESULT, 'GetRunTimes', ! ( [], LPSYSTEMTIME ), ! ( [], LPSYSTEMTIME ), ! ( [], POINTER(WORD) ), ! ( [], POINTER(LPSYSTEMTIME) ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 400 COMMETHOD([], HRESULT, 'GetNextRunTime', ! ( [], POINTER(SYSTEMTIME) ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 404 COMMETHOD([], HRESULT, 'SetIdleWait', ! ( [], WORD ), ! ( [], WORD ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 408 COMMETHOD([], HRESULT, 'GetIdleWait', ! ( [], POINTER(WORD) ), ! ( [], POINTER(WORD) ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 410 ! COMMETHOD([], HRESULT, 'Run', ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 412 ! COMMETHOD([], HRESULT, 'Terminate', ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 416 COMMETHOD([], HRESULT, 'EditWorkItem', ! ( [], HWND ), ! ( [], DWORD ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 419 COMMETHOD([], HRESULT, 'GetMostRecentRunTime', ! ( [], POINTER(SYSTEMTIME) ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 422 COMMETHOD([], HRESULT, 'GetStatus', ! ( [], POINTER(HRESULT) ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 425 COMMETHOD([], HRESULT, 'GetExitCode', ! ( [], POINTER(DWORD) ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 428 COMMETHOD([], HRESULT, 'SetComment', ! ( [], LPCWSTR ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 431 COMMETHOD([], HRESULT, 'GetComment', ! ( [], POINTER(LPWSTR) ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 434 COMMETHOD([], HRESULT, 'SetCreator', ! ( [], LPCWSTR ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 437 COMMETHOD([], HRESULT, 'GetCreator', ! ( [], POINTER(LPWSTR) ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 441 COMMETHOD([], HRESULT, 'SetWorkItemData', ! ( [], WORD ), ! ( [], POINTER(BYTE) ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 445 COMMETHOD([], HRESULT, 'GetWorkItemData', ! ( [], POINTER(WORD) ), ! ( [], POINTER(POINTER(BYTE)) ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 448 COMMETHOD([], HRESULT, 'SetErrorRetryCount', ! ( [], WORD ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 451 COMMETHOD([], HRESULT, 'GetErrorRetryCount', ! ( [], POINTER(WORD) ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 454 COMMETHOD([], HRESULT, 'SetErrorRetryInterval', ! ( [], WORD ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 457 COMMETHOD([], HRESULT, 'GetErrorRetryInterval', ! ( [], POINTER(WORD) ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 460 COMMETHOD([], HRESULT, 'SetFlags', ! ( [], DWORD ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 463 COMMETHOD([], HRESULT, 'GetFlags', ! ( [], POINTER(DWORD) ), ! ), ! # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 467 COMMETHOD([], HRESULT, 'SetAccountInformation', ! ( [], LPCWSTR ), ! ( [], LPCWSTR ), ! ), ! COMMETHOD([], HRESULT, 'GetAccountInformation', ( ["out"], POINTER(LPWSTR), "ppwszAccountName" )), ] - # THIS CODE MUST BE EXECUTED AFTER IScheduledWorkItem._methods_ = ... !!! ITask._methods_ = [ COMMETHOD([], HRESULT, 'SetApplicationName', --- 294,370 ---- ( ["out"], POINTER(POINTER(IEnumWorkItems)) )) ] IScheduledWorkItem._methods_ = [ # C:/PROGRA~1/MICROS~3.NET/Vc7/PLATFO~1/Include/mstask.h 373 COMMETHOD([], HRESULT, 'CreateTrigger', ! ( ["out"], POINTER(WORD), 'piNewTrigger' ), ! ( ["out"], POINTER(POINTER(ITaskTrigger)), 'ppNewTrigger' )), COMMETHOD([], HRESULT, 'DeleteTrigger', ! ( ["in"], WORD, 'iTrigger' )), COMMETHOD([], HRESULT, 'GetTriggerCount', ( ["out"], POINTER(WORD), "pwCount")), COMMETHOD([], HRESULT, 'GetTrigger', ! ( ["in"], WORD, 'iTrigger'), ! ( ["out"], POINTER(POINTER(ITaskTrigger)), 'ppTrigger' )), COMMETHOD([], HRESULT, 'GetTriggerString', ! ( ["in"], WORD, 'iTrigger' ), ! ( ["out"], POINTER(LPWSTR), 'ppwszTrigger')), COMMETHOD([], HRESULT, 'GetRunTimes', ! ( ["in"], LPSYSTEMTIME, 'pstBegin' ), ! ( ["in"], LPSYSTEMTIME, 'pstEnd' ), ! ( ["out", "in"], POINTER(WORD), 'pCount' ), ! ( ["out"], POINTER(LPSYSTEMTIME), 'rgstTaskTimes' )), COMMETHOD([], HRESULT, 'GetNextRunTime', ! ( ["out"], POINTER(SYSTEMTIME), 'pstNextRun' )), COMMETHOD([], HRESULT, 'SetIdleWait', ! ( ["in"], WORD, 'wIdleMinutes' ), ! ( ["in"], WORD, 'wDeadlineMinutes' )), COMMETHOD([], HRESULT, 'GetIdleWait', ! ( ["out"], POINTER(WORD), 'pwIdleMinutes' ), ! ( ["out"], POINTER(WORD), 'pwDeadlineMinutes' )), ! COMMETHOD([], HRESULT, 'Run'), ! COMMETHOD([], HRESULT, 'Terminate'), COMMETHOD([], HRESULT, 'EditWorkItem', ! ( ["in"], HWND, 'hParent' ), ! ( ["in"], DWORD, 'dwReserved')), COMMETHOD([], HRESULT, 'GetMostRecentRunTime', ! ( ["out"], POINTER(SYSTEMTIME), 'pstLastRun')), COMMETHOD([], HRESULT, 'GetStatus', ! ( ["out"], POINTER(HRESULT), 'phrStatus')), COMMETHOD([], HRESULT, 'GetExitCode', ! ( ["out"], POINTER(DWORD), 'pdwExitCode')), COMMETHOD([], HRESULT, 'SetComment', ! ( ["in"], LPCWSTR, 'pwszComment')), COMMETHOD([], HRESULT, 'GetComment', ! ( ["out"], POINTER(LPWSTR), 'ppwszComment')), COMMETHOD([], HRESULT, 'SetCreator', ! ( ["in"], LPCWSTR, 'pwszCreator' )), COMMETHOD([], HRESULT, 'GetCreator', ! ( ["out"], POINTER(LPWSTR), 'ppwszCreator' )), COMMETHOD([], HRESULT, 'SetWorkItemData', ! ( ["in"], WORD, 'cbData' ), ! ( ["in"], POINTER(BYTE), 'rgbData')), COMMETHOD([], HRESULT, 'GetWorkItemData', ! ( ["out"], POINTER(WORD), 'pcbData' ), ! ( ["out"], POINTER(POINTER(BYTE)), 'prgbData' )), COMMETHOD([], HRESULT, 'SetErrorRetryCount', ! ( ["in"], WORD, 'wRetryCount' )), COMMETHOD([], HRESULT, 'GetErrorRetryCount', ! ( ["out"], POINTER(WORD), 'pwRetryCount')), COMMETHOD([], HRESULT, 'SetErrorRetryInterval', ! ( ["in"], WORD, 'wRetryInterval')), COMMETHOD([], HRESULT, 'GetErrorRetryInterval', ! ( ["out"], POINTER(WORD), 'pwRetryInterval')), COMMETHOD([], HRESULT, 'SetFlags', ! ( ["in"], DWORD, 'dwFlags')), COMMETHOD([], HRESULT, 'GetFlags', ! ( ["out"], POINTER(DWORD), 'pdwFlags' )), COMMETHOD([], HRESULT, 'SetAccountInformation', ! ( ["in"], LPCWSTR, 'pwszAccountName' ), ! ( ["in"], LPCWSTR, 'pwszPassword' )), COMMETHOD([], HRESULT, 'GetAccountInformation', ( ["out"], POINTER(LPWSTR), "ppwszAccountName" )), ] ITask._methods_ = [ COMMETHOD([], HRESULT, 'SetApplicationName', *************** *** 412,415 **** --- 394,399 ---- ] + ################################################################ + if __name__ == "__main__": from comtypes import CoCreateInstance *************** *** 417,431 **** for taskname in scheduler.Enum(): ! print "%s:" % taskname, task = scheduler.Activate(taskname, byref(ITask._iid_)) task = task.QueryInterface(ITask) ! print task.GetTriggerCount(), task.GetMaxRunTime(), task.GetApplicationName() print scheduler.Enum() print scheduler.Enum().Clone() - for i in range (50): - for item in scheduler: - pass # leaks 10 refs per loop - print scheduler.AddRef(), scheduler.Release() --- 401,436 ---- for taskname in scheduler.Enum(): ! print " * %s:" % taskname, task = scheduler.Activate(taskname, byref(ITask._iid_)) task = task.QueryInterface(ITask) ! print (task.GetTriggerCount(), task.GetMaxRunTime(), task.GetApplicationName()) ! print (task.GetWorkingDirectory(), task.GetParameters()) ! ! from comtypes.automation import IDispatch ! print "IsA", scheduler.IsOfType(taskname, ITask) ! ! from comtypes.persist import IPersist, IPersistFile ! pi = task.QueryInterface(IPersistFile) ! print "CLSID", pi.GetClassID() ! print "FNM", pi.GetCurFile() ! print "ISDIRTY", pi.IsDirty() ! task.SetComment("blah blah") ! print "ISDIRTY", pi.IsDirty() ! cnt, data = task.GetWorkItemData() ! ! import sys ! sys.exit() print scheduler.Enum() print scheduler.Enum().Clone() print scheduler.AddRef(), scheduler.Release() + + try: + ## while 1: + for i in range(100000): + scheduler.GetTargetComputer() + for item in scheduler: + print item + except KeyboardInterrupt: + pass |
From: Thomas H. <th...@us...> - 2005-03-22 12:30:52
|
Update of /cvsroot/ctypes/ctypes/win32/com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20853 Modified Files: ChangeLog Log Message: Index: ChangeLog =================================================================== RCS file: /cvsroot/ctypes/ctypes/win32/com/ChangeLog,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** ChangeLog 7 Sep 2004 06:39:52 -0000 1.8 --- ChangeLog 22 Mar 2005 12:30:42 -0000 1.9 *************** *** 1,2 **** --- 1,7 ---- + 2005-03-22 Thomas Heller <th...@py...> + + * (Message): Remove the wrong definition of OLESTR. This fixes + some interfaces in ctypes.com.ole. Reported by Jürgen Urner. + 2004-09-06 Thomas Heller <th...@py...> |
From: Thomas H. <th...@us...> - 2005-03-22 12:30:40
|
Update of /cvsroot/ctypes/ctypes/comtypes/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20689 Modified Files: tlbparser.py Log Message: Don't use a relative import for comtypes.tools.typedesc (now that it's a package). The 'noncreatable' IDL flags wasn't emitted. Index: tlbparser.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/comtypes/tools/tlbparser.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tlbparser.py 16 Mar 2005 14:25:12 -0000 1.4 --- tlbparser.py 22 Mar 2005 12:30:14 -0000 1.5 *************** *** 2,6 **** import comtypes.automation as automation import comtypes.typeinfo as typeinfo ! import typedesc ################################ --- 2,6 ---- import comtypes.automation as automation import comtypes.typeinfo as typeinfo ! import comtypes.tools.typedesc as typedesc ################################ *************** *** 65,69 **** automation.VT_HRESULT: HRESULT_type, # 25 # This is wrong. We must create separate SAFEARRAY(type) things. ! # automation.VT_SAFEARRAY: SAFEARRAY_type, # 27 automation.VT_LPSTR: PTR(char_type), # 30 automation.VT_LPWSTR: PTR(wchar_t_type), # 31 --- 65,69 ---- automation.VT_HRESULT: HRESULT_type, # 25 # This is wrong. We must create separate SAFEARRAY(type) things. ! automation.VT_SAFEARRAY: SAFEARRAY_type, # 27 automation.VT_LPSTR: PTR(char_type), # 30 automation.VT_LPWSTR: PTR(wchar_t_type), # 31 *************** *** 115,119 **** # SAFEARRAY(long), see Don Box pp.331f print "SAFEARRAY", tdesc._.lptdesc[0].vt ! raise "HALT" return SAFEARRAY_type --- 115,119 ---- # SAFEARRAY(long), see Don Box pp.331f print "SAFEARRAY", tdesc._.lptdesc[0].vt ! ##XXX## raise "HALT" return SAFEARRAY_type *************** *** 353,357 **** # map TYPEFLAGS values to idl attributes NAMES = {typeinfo.TYPEFLAG_FAPPOBJECT: "appobject", - # typeinfo.TYPEFLAG_FCANCREATE: typeinfo.TYPEFLAG_FLICENSED: "licensed", # typeinfo.TYPEFLAG_FPREDECLID: --- 353,356 ---- *************** *** 368,372 **** typeinfo.TYPEFLAG_FPROXY: "proxy", } ! return [NAMES[bit] for bit in NAMES if bit & flags] def var_flags(self, flags): --- 367,374 ---- typeinfo.TYPEFLAG_FPROXY: "proxy", } ! NEGATIVE_NAMES = {typeinfo.TYPEFLAG_FCANCREATE: "noncreatable"} ! ! return [NAMES[bit] for bit in NAMES if bit & flags] + \ ! [NEGATIVE_NAMES[bit] for bit in NEGATIVE_NAMES if (bit & flags == 0)] def var_flags(self, flags): *************** *** 484,489 **** ################################################################ ! def main(): import sys ## these do NOT work: --- 486,492 ---- ################################################################ + # XXX ONLY FOR TESTING! ! if __name__ == "__main__": import sys ## these do NOT work: *************** *** 507,511 **** ## path = r"simpdata.tlb" ## path = r"nscompat.tlb" ! ## path = r"stdole32.tlb" ## path = r"shdocvw.dll" --- 510,514 ---- ## path = r"simpdata.tlb" ## path = r"nscompat.tlb" ! ## path = r"stdole32.tlb" # IEnumVARIANT ## path = r"shdocvw.dll" *************** *** 515,518 **** --- 518,523 ---- ## path = r"MSHFLXGD.OCX" # DispProperty, propputref ## path = r"scrrun.dll" # propput AND propputref on IDictionary::Item + + # This is interesting: It contains some functions with idl flags! ## path = r"C:\Dokumente und Einstellungen\thomas\Desktop\tlb\threadapi.tlb" *************** *** 528,540 **** items = p.parse() - from codegenerator import Generator gen = Generator(sys.stdout, use_decorators=True, known_symbols=known_symbols, - ## searched_dlls=None, ) gen.generate_code(items.values()) - - if __name__ == "__main__": - main() --- 533,541 ---- items = p.parse() + from comtypes.tools.codegenerator import Generator gen = Generator(sys.stdout, use_decorators=True, known_symbols=known_symbols, ) gen.generate_code(items.values()) |
From: Thomas H. <th...@us...> - 2005-03-22 12:11:50
|
Update of /cvsroot/ctypes/ctypes/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10482 Modified Files: wintypes.py Log Message: Fix wrong definition of OLESTR - found by Jürgen Urner. Index: wintypes.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/win32/wintypes.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** wintypes.py 23 Apr 2004 18:13:51 -0000 1.8 --- wintypes.py 22 Mar 2005 12:11:19 -0000 1.9 *************** *** 33,37 **** VARIANT_BOOL = c_short ! LPCOLESTR = LPOLESTR = OLESTR = c_wchar_p LPCWSTR = LPWSTR = c_wchar_p --- 33,37 ---- VARIANT_BOOL = c_short ! LPCOLESTR = LPOLESTR = c_wchar_p LPCWSTR = LPWSTR = c_wchar_p |
From: Thomas H. <th...@us...> - 2005-03-22 12:11:37
|
Update of /cvsroot/ctypes/ctypes/win32/com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10591 Modified Files: ole.py Log Message: Fix wrong definition of OLESTR - found by Jürgen Urner. Index: ole.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/win32/com/ole.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ole.py 16 Jul 2004 15:53:48 -0000 1.7 --- ole.py 22 Mar 2005 12:11:28 -0000 1.8 *************** *** 2,6 **** from ctypes.com import IUnknown, STDMETHOD, HRESULT, GUID from ctypes.com.storage import IStream, IStorage ! from ctypes.wintypes import BYTE, WORD, DWORD, MSG, SIZE, SIZEL, RECTL, RECT, OLESTR, HANDLE, \ LPWSTR, BOOL, HWND, HMENU, HDC --- 2,6 ---- from ctypes.com import IUnknown, STDMETHOD, HRESULT, GUID from ctypes.com.storage import IStream, IStorage ! from ctypes.wintypes import BYTE, WORD, DWORD, MSG, SIZE, SIZEL, RECTL, RECT, LPOLESTR, HANDLE, \ LPWSTR, BOOL, HWND, HMENU, HDC *************** *** 88,92 **** STDMETHOD(HRESULT, "RequestBorderSpace", POINTER(BORDERWIDTHS)), STDMETHOD(HRESULT, "SetBorderSpace", POINTER(BORDERWIDTHS)), ! STDMETHOD(HRESULT, "SetActiveObject", POINTER(IOleInPlaceActiveObject), POINTER(OLESTR))] IOleInPlaceActiveObject._methods_ = IOleWindow._methods_ + [ --- 88,92 ---- STDMETHOD(HRESULT, "RequestBorderSpace", POINTER(BORDERWIDTHS)), STDMETHOD(HRESULT, "SetBorderSpace", POINTER(BORDERWIDTHS)), ! STDMETHOD(HRESULT, "SetActiveObject", POINTER(IOleInPlaceActiveObject), LPOLESTR)] IOleInPlaceActiveObject._methods_ = IOleWindow._methods_ + [ *************** *** 108,112 **** STDMETHOD(HRESULT, "SetMenu", HMENU, HOLEMENU, HWND), STDMETHOD(HRESULT, "RemoveMenus", HMENU), ! STDMETHOD(HRESULT, "SetStatusText", POINTER(OLESTR)), STDMETHOD(HRESULT, "EnableModeless", BOOL), STDMETHOD(HRESULT, "TranslateAccelerator", POINTER(MSG), WORD), --- 108,112 ---- STDMETHOD(HRESULT, "SetMenu", HMENU, HOLEMENU, HWND), STDMETHOD(HRESULT, "RemoveMenus", HMENU), ! STDMETHOD(HRESULT, "SetStatusText", LPOLESTR), STDMETHOD(HRESULT, "EnableModeless", BOOL), STDMETHOD(HRESULT, "TranslateAccelerator", POINTER(MSG), WORD), |
From: Thomas H. <th...@us...> - 2005-03-22 12:09:48
|
Update of /cvsroot/ctypes/ctypes/ctypes/wrap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9152 Modified Files: xml2py.py Log Message: Some general cleanup, and make generate_code (which does all the filtering) a method of Generator. Index: xml2py.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/wrap/xml2py.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** xml2py.py 4 Feb 2005 17:01:24 -0000 1.1 --- xml2py.py 22 Mar 2005 12:09:23 -0000 1.2 *************** *** 1,5 **** import sys, re from optparse import OptionParser - from codegenerator import generate_code import typedesc --- 1,4 ---- *************** *** 102,120 **** help="add all standard windows dlls to the searched dlls list") - ## try: - ## import comtypes - ## except ImportError: - ## default_modules = ["ctypes", "ctypes.com"] - ## else: - ## default_modules = ["ctypes", "comtypes"] - default_modules = ["ctypes"] - parser.add_option("-m", dest="modules", metavar="module", help="Python module(s) containing symbols which will " ! "be imported instead of generated", action="append", ! default=default_modules) options, files = parser.parse_args(args[1:]) --- 101,111 ---- help="add all standard windows dlls to the searched dlls list") parser.add_option("-m", dest="modules", metavar="module", help="Python module(s) containing symbols which will " ! "be imported instead of generated (ctypes is always used)", action="append", ! default=["ctypes"]) options, files = parser.parse_args(args[1:]) *************** *** 131,142 **** options.expressions = map(re.compile, options.expressions) ! stream.write("# generated by 'xml2py'\n") ! stream.write("# flags '%s'\n" % " ".join(sys.argv[1:])) ! ! known_symbols = {} from ctypes import CDLL dlls = [CDLL(name) for name in options.dlls] for name in options.modules: mod = __import__(name) --- 122,131 ---- options.expressions = map(re.compile, options.expressions) ! ################################################################ from ctypes import CDLL dlls = [CDLL(name) for name in options.dlls] + known_symbols = {} for name in options.modules: mod = __import__(name) *************** *** 160,173 **** options.kind = tuple(types) ! generate_code(files[0], stream, ! symbols=options.symbols, ! expressions=options.expressions, ! verbose=options.verbose, ! use_decorators=options.use_decorators, ! known_symbols=known_symbols, ! searched_dlls=dlls, ! types=options.kind) if __name__ == "__main__": sys.exit(main()) --- 149,170 ---- options.kind = tuple(types) ! from gccxmlparser import parse ! items = parse(files[0]) + stream.write("# generated by 'xml2py'\n") + stream.write("# flags '%s'\n" % " ".join(sys.argv[1:])) + from codegenerator import Generator + gen = Generator(stream, + use_decorators=options.use_decorators, + known_symbols=known_symbols, + searched_dlls=dlls) + + gen.generate_code(items, + verbose=options.verbose, + symbols=options.symbols, + expressions=options.expressions, + types=options.kind) + if __name__ == "__main__": sys.exit(main()) |
From: Thomas H. <th...@us...> - 2005-03-22 12:08:48
|
Update of /cvsroot/ctypes/ctypes/ctypes/wrap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8628 Modified Files: codegenerator.py Log Message: Some general cleanup, and make generate_code (which does all the filtering) a method. Index: codegenerator.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/wrap/codegenerator.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** codegenerator.py 16 Mar 2005 07:51:19 -0000 1.6 --- codegenerator.py 22 Mar 2005 12:08:09 -0000 1.7 *************** *** 3,6 **** --- 3,10 ---- # $Log$ + # Revision 1.7 2005/03/22 12:08:09 theller + # Some general cleanup, and make generate_code (which does all the + # filtering) a method. + # # Revision 1.6 2005/03/16 07:51:19 theller # _COMMETHOD_defined was never set to True. *************** *** 490,494 **** # ctypes.com needs baseclass methods listed as well if body.struct.bases: - basename = body.struct.bases[0].name print >> self.stream, "%s._methods_ = %s._methods + [" % \ (body.struct.name, body.struct.bases[0].name) --- 494,497 ---- *************** *** 639,643 **** self.generate(item) ! def generate_code(self, items): print >> self.imports, "from ctypes import *" items = set(items) --- 642,646 ---- self.generate(item) ! def generate_module(self, items): print >> self.imports, "from ctypes import *" items = set(items) *************** *** 676,733 **** print >> stream, "###########################" - ################################################################ - - def generate_code(xmlfile, - outfile, - expressions=None, - symbols=None, - verbose=False, - use_decorators=False, - known_symbols=None, - searched_dlls=None, - types=None): - # expressions is a sequence of compiled regular expressions, - # symbols is a sequence of names - from gccxmlparser import parse - items = parse(xmlfile) ! # filter symbols to generate ! todo = [] ! if types: ! items = [i for i in items if isinstance(i, types)] ! ! if symbols: ! syms = set(symbols) ! for i in items: ! if i.name in syms: ! todo.append(i) ! syms.remove(i.name) ! if syms: ! print "symbols not found", list(syms) ! if expressions: ! for i in items: ! for s in expressions: ! if i.name is None: ! continue ! match = s.match(i.name) ! # we only want complete matches ! if match and match.group() == i.name: todo.append(i) ! break ! if symbols or expressions: ! items = todo ! ################ ! gen = Generator(outfile, ! use_decorators=use_decorators, ! known_symbols=known_symbols, ! searched_dlls=searched_dlls) ! loops = gen.generate_code(items) ! if verbose: ! gen.print_stats(sys.stderr) ! print >> sys.stderr, "needed %d loop(s)" % loops --- 679,726 ---- print >> stream, "###########################" ! def generate_code(self, ! items, ! expressions=None, ! symbols=None, ! verbose=False, ! types=None, ! ): ! # filter symbols to generate ! todo = [] ! if types: ! items = [i for i in items if isinstance(i, types)] ! if symbols: ! syms = set(symbols) ! for i in items: ! if i.name in syms: todo.append(i) ! syms.remove(i.name) ! if syms: ! print "symbols not found", list(syms) ! if expressions: ! for i in items: ! for s in expressions: ! if i.name is None: ! continue ! match = s.match(i.name) ! # we only want complete matches ! if match and match.group() == i.name: ! todo.append(i) ! break ! if symbols or expressions: ! items = todo + ################ + + loops = self.generate_module(items) + if verbose: + self.print_stats(sys.stderr) + print >> sys.stderr, "needed %d loop(s)" % loops + + ### EOF ### |
From: Thomas H. <th...@us...> - 2005-03-22 10:56:05
|
Update of /cvsroot/ctypes/ctypes/comtypes/tools In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2065 Added Files: __init__.py Log Message: Make comtypes.tools a package. --- NEW FILE: __init__.py --- # comtypes.tools package |
From: Thomas H. <th...@us...> - 2005-03-21 12:49:33
|
Update of /cvsroot/ctypes/ctypes/comtypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13788 Modified Files: __init__.py Log Message: Remove unneeded Warning subclass. Index: __init__.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/comtypes/__init__.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** __init__.py 17 Mar 2005 10:34:33 -0000 1.25 --- __init__.py 21 Mar 2005 12:49:23 -0000 1.26 *************** *** 224,230 **** return bound_named_property(self.getter, self.setter, im_inst) - class NotYetImplemented(Warning): - pass - # metaclass for COM interface pointer classes class _compointer_meta(type(c_void_p), _cominterface_meta): --- 224,227 ---- |
From: Thomas H. <th...@us...> - 2005-03-18 19:24:11
|
Update of /cvsroot/ctypes/ctypes/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29240 Modified Files: index.stx Log Message: typo. Index: index.stx =================================================================== RCS file: /cvsroot/ctypes/ctypes/docs/index.stx,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** index.stx 18 Mar 2005 19:21:46 -0000 1.12 --- index.stx 18 Mar 2005 19:23:52 -0000 1.13 *************** *** 44,48 **** tried out the codegenerator toolchain. ! **The code generator if brand new and still experimental, although hopefully better than in the 0.9.5 release.** --- 44,48 ---- tried out the codegenerator toolchain. ! **The code generator is brand new and still experimental, although hopefully better than in the 0.9.5 release.** |
From: Thomas H. <th...@us...> - 2005-03-18 19:21:55
|
Update of /cvsroot/ctypes/ctypes/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28284 Modified Files: index.stx Log Message: Last minute changes, again. Index: index.stx =================================================================== RCS file: /cvsroot/ctypes/ctypes/docs/index.stx,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** index.stx 18 Mar 2005 18:29:48 -0000 1.11 --- index.stx 18 Mar 2005 19:21:46 -0000 1.12 *************** *** 17,20 **** --- 17,24 ---- callback functions in pure Python. + ctypes now includes a code generator toolchain which allows + automatic creation of library wrappers from C header files. + This feature is still experimental and beta quality. + ctypes works on Windows, Mac OS X, Linux, Solaris, FreeBSD, OpenBSD. It may also run on other systems, provided that libffi supports *************** *** 27,31 **** them): ! "ANNOUNCE":http://cvs.sourceforge.net/viewcvs.py/ctypes/ctypes/ANNOUNCE?rev=release_0_9_5 "ChangeLog":http://cvs.sourceforge.net/viewcvs.py/ctypes/ctypes/ChangeLog?rev=HEAD --- 31,35 ---- them): ! "ANNOUNCE":http://cvs.sourceforge.net/viewcvs.py/ctypes/ctypes/ANNOUNCE?rev=release_0_9_6 "ChangeLog":http://cvs.sourceforge.net/viewcvs.py/ctypes/ctypes/ChangeLog?rev=HEAD *************** *** 40,43 **** --- 44,50 ---- tried out the codegenerator toolchain. + **The code generator if brand new and still experimental, although + hopefully better than in the 0.9.5 release.** + Bug fixes: |
From: Thomas H. <th...@us...> - 2005-03-18 19:21:46
|
Update of /cvsroot/ctypes/ctypes/ctypes/wrap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28184 Modified Files: codegen.txt Log Message: Last minute changes, again. Index: codegen.txt =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/wrap/codegen.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** codegen.txt 18 Mar 2005 19:01:50 -0000 1.4 --- codegen.txt 18 Mar 2005 19:21:34 -0000 1.5 *************** *** 10,13 **** --- 10,16 ---- preprocessor definitions. + **The code generator is brand new and still experimental, although + hopefully better than in the 0.9.5 release.** + .. contents:: |
From: Thomas H. <th...@us...> - 2005-03-18 19:21:34
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28035 Modified Files: ANNOUNCE Log Message: Last minute changes, again. Index: ANNOUNCE =================================================================== RCS file: /cvsroot/ctypes/ctypes/ANNOUNCE,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** ANNOUNCE 18 Mar 2005 18:19:54 -0000 1.20 --- ANNOUNCE 18 Mar 2005 19:21:23 -0000 1.21 *************** *** 13,16 **** --- 13,20 ---- callback functions in pure Python. + ctypes now includes a code generator toolchain which allows + automatic creation of library wrappers from C header files. + This feature is still experimental and beta quality. + ctypes runs on Windows, MacOS X, Linux, Solaris, FreeBSD, OpenBSD. It may also run on other systems, provided that libffi supports |
From: Thomas H. <th...@us...> - 2005-03-18 19:02:08
|
Update of /cvsroot/ctypes/ctypes/ctypes/wrap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18747 Modified Files: codegen.txt Log Message: Release notes for 0.9.6. Last minute changes. Index: codegen.txt =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/wrap/codegen.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** codegen.txt 17 Mar 2005 18:59:46 -0000 1.3 --- codegen.txt 18 Mar 2005 19:01:50 -0000 1.4 *************** *** 50,55 **** .. _the ctypes download page: http://sourceforge.net/project/showfiles.php?group_id=71702 ! XXX UPDATE LINK! ! .. _GCC-XML windows installer: http://sourceforge.net/project/showfiles.php?group_id=71702&package_id=71318&release_id=312072 .. _GCC-XML: http://www.gccxml.org/ --- 50,54 ---- .. _the ctypes download page: http://sourceforge.net/project/showfiles.php?group_id=71702 ! .. _GCC-XML windows installer: http://sourceforge.net/project/showfiles.php?group_id=71702&package_id=71318&release_id=313813 .. _GCC-XML: http://www.gccxml.org/ *************** *** 74,77 **** --- 73,79 ---- current directory + - several bugs in the gccxml installer plus one bug in gccxml has been fixed, + and the gccxml installer snapshot has been rebuilt. + Usage examples ============== |
From: Thomas H. <th...@us...> - 2005-03-18 18:29:57
|
Update of /cvsroot/ctypes/ctypes/docs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2836 Modified Files: index.stx Log Message: Release notes for 0.9.6. Index: index.stx =================================================================== RCS file: /cvsroot/ctypes/ctypes/docs/index.stx,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** index.stx 11 Mar 2005 20:32:38 -0000 1.10 --- index.stx 18 Mar 2005 18:29:48 -0000 1.11 *************** *** 35,39 **** News ! **'ctypes' version 0.9.5 has been released (Mar 1, 2005).** New package 'ctypes.wrap'. It contains decorators for easier --- 35,64 ---- News ! **'ctypes' version 0.9.6 has been released (Mar 18, 2005).** ! ! Thanks to all of you who reported bugs so quickly, and those who ! tried out the codegenerator toolchain. ! ! Bug fixes: ! ! - keyword arguments in Structure/Union initializers had no effect. ! ! - it was impossible to override the from_parm class method ! in subclasses of c_void_p, c_char_p, and c_wchar_p. ! ! - removed the __del__ method of _CDLL. It caused uncollectable ! garbage in Python's gc. ! ! - ctypes.com.register: enclose the Python script to run a com ! server in quotes, otherwise it won't run correctly when the ! directory name contains spaces. ! ! Enhancements: ! ! - Several changes have been made to the h2xml script from the ! codegenerator toolchain. See the documentation (linked below) for ! details. ! ! **'ctypes' version 0.9.5 has been released (Mar 11, 2005).** New package 'ctypes.wrap'. It contains decorators for easier |
From: Thomas H. <th...@us...> - 2005-03-18 18:20:08
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30154 Modified Files: ANNOUNCE Log Message: Release notes for 0.9.6. Index: ANNOUNCE =================================================================== RCS file: /cvsroot/ctypes/ctypes/ANNOUNCE,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** ANNOUNCE 11 Mar 2005 20:10:26 -0000 1.19 --- ANNOUNCE 18 Mar 2005 18:19:54 -0000 1.20 *************** *** 1,3 **** ! ctypes 0.9.5 released - Mar 11, 2005 ==================================== --- 1,3 ---- ! ctypes 0.9.6 released - Mar 18, 2005 ==================================== *************** *** 30,34 **** and report problems on the ctypes-users mailing list. ! Additions New package ctypes.wrap. This contains decorators usable for --- 30,61 ---- and report problems on the ctypes-users mailing list. ! Changes in 0.9.6 ! ! Thanks to all of you who reported bugs so quickly, and those who ! tried out the codegenerator toolchain. ! ! Bug fixes: ! ! - keyword arguments in Structure/Union initializers had no effect. ! ! - it was impossible to override the from_parm class method ! in subclasses of c_void_p, c_char_p, and c_wchar_p. ! ! - removed the __del__ method of _CDLL. It caused uncollectable ! garbage in Python's gc. ! ! - ctypes.com.register: enclose the Python script to run a com ! server in quotes, otherwise it won't run correctly when the ! directory name contains spaces. ! ! Enhancements: ! ! - Several changes have been made to the h2xml script from the ! codegenerator toolchain. See the documentation (linked below) for ! details. ! ! ----------------------- ! ! Additions in 0.9.5 New package ctypes.wrap. This contains decorators usable for |
From: Thomas H. <th...@us...> - 2005-03-18 18:09:50
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24499 Modified Files: ChangeLog Log Message: Release pending. Index: ChangeLog =================================================================== RCS file: /cvsroot/ctypes/ctypes/ChangeLog,v retrieving revision 1.85 retrieving revision 1.86 diff -C2 -d -r1.85 -r1.86 *** ChangeLog 18 Mar 2005 18:08:33 -0000 1.85 --- ChangeLog 18 Mar 2005 18:09:41 -0000 1.86 *************** *** 1,4 **** --- 1,6 ---- 2005-03-18 Thomas Heller <th...@py...> + * ctypes-0.9.6 released. + * Back out the '.so' magic again. |
From: Thomas H. <th...@us...> - 2005-03-18 18:08:43
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23916 Modified Files: ChangeLog Log Message: Record changes. Index: ChangeLog =================================================================== RCS file: /cvsroot/ctypes/ctypes/ChangeLog,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** ChangeLog 18 Mar 2005 11:34:08 -0000 1.84 --- ChangeLog 18 Mar 2005 18:08:33 -0000 1.85 *************** *** 1,2 **** --- 1,6 ---- + 2005-03-18 Thomas Heller <th...@py...> + + * Back out the '.so' magic again. + 2005-03-17 Thomas Heller <th...@py...> |
From: Thomas H. <th...@us...> - 2005-03-18 18:02:23
|
Update of /cvsroot/ctypes/ctypes/sandbox/tools/codegen In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20587 Modified Files: setup_gccxml.iss Added Files: snapshot.txt Log Message: Build script and readme file for my gccxml snapshot installer. --- NEW FILE: snapshot.txt --- This is *not* an official gccxml release! It was built from CVS Mar 18, 2005, with MSVC 6. For official releases, see http://www.gccxml.org/ Index: setup_gccxml.iss =================================================================== RCS file: /cvsroot/ctypes/ctypes/sandbox/tools/codegen/setup_gccxml.iss,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** setup_gccxml.iss 16 Mar 2005 18:10:20 -0000 1.3 --- setup_gccxml.iss 18 Mar 2005 18:02:13 -0000 1.4 *************** *** 1,17 **** [Setup] AppName=gccxml ! AppVerName=gccxml-20041208 DefaultDirName={pf}\gccxml DefaultGroupName=gccxml Compression=lzma - ;;Compression=None SolidCompression=yes LicenseFile="C:\sf\gccxml\GCC_XML\Copyright.txt" - InfoBeforeFile=snapshot.txt OutputDir="c:\inout" [Files] Source: "C:\sf\gccxml\GCC_XML\Copyright.txt"; DestDir: "{app}\doc"; Flags: ignoreversion ! Source: "C:\sf\buildgcc\bin\release\snapshot.txt"; DestDir: "{app}\doc"; Destname: README.txt; Flags: ignoreversion Source: "C:\sf\buildgcc6\bin\minsizerel\gccxml.exe"; DestDir: "{app}\bin"; Flags: ignoreversion --- 1,26 ---- [Setup] AppName=gccxml ! ! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ! AppVerName=gccxml-20050318 ! OutputBaseFileName=gccxml-20050318-setup ! InfoBeforeFile=snapshot.txt ! ;AppVerName=gccxml-20050318-vctk ! ;OutputBaseFileName=gccxml-20050318-vctk-setup ! ;InfoBeforeFile=snapshot-vctk.txt ! DefaultDirName={pf}\gccxml DefaultGroupName=gccxml Compression=lzma SolidCompression=yes LicenseFile="C:\sf\gccxml\GCC_XML\Copyright.txt" OutputDir="c:\inout" [Files] Source: "C:\sf\gccxml\GCC_XML\Copyright.txt"; DestDir: "{app}\doc"; Flags: ignoreversion ! ! ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ! Source: "snapshot.txt"; DestDir: "{app}\doc"; Destname: README.txt; Flags: ignoreversion ! ;Source: "snapshot-vctk.txt"; DestDir: "{app}\doc"; Destname: README.txt; Flags: ignoreversion Source: "C:\sf\buildgcc6\bin\minsizerel\gccxml.exe"; DestDir: "{app}\bin"; Flags: ignoreversion *************** *** 37,40 **** --- 46,52 ---- Type: filesandordirs; Name: {app}\bin\Vc71 + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;Type: filesandordirs; Name: {app}\bin\WS2003PlatformSDK + [Registry] Root: HKLM; Subkey: "Software\gccxml"; ValueType: string; ValueName: "loc"; ValueData: {app}; Flags: uninsdeletekey |
From: Thomas H. <th...@us...> - 2005-03-18 17:41:39
|
Update of /cvsroot/ctypes/ctypes/unittests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10605 Modified Files: test_posix.py Log Message: Comment out the test since it will no longer work this way. Index: test_posix.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/unittests/test_posix.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** test_posix.py 18 Mar 2005 09:38:26 -0000 1.1 --- test_posix.py 18 Mar 2005 17:41:27 -0000 1.2 *************** *** 2,27 **** from ctypes import * ! if os.name == "posix" and sys.platform != "darwin": ! # On platforms where the default shared library suffix is '.so', ! # at least some libraries can be loaded as attributes of the cdll ! # object, since ctypes now tries loading the lib again ! # with '.so' appended of the first try fails. ! # ! # Won't work for libc, unfortunately. OTOH, it isn't ! # needed for libc since this is already mapped into the current ! # process (?) ! # ! # On MAC OSX, it won't work either, because dlopen() needs a full path, ! # and the default suffix is either none or '.dylib'. ! class LoadLibs(unittest.TestCase): ! def test_libm(self): ! import math ! libm = cdll.libm ! sqrt = libm.sqrt ! sqrt.argtypes = (c_double,) ! sqrt.restype = c_double ! self.failUnlessEqual(sqrt(2), math.sqrt(2)) if __name__ == "__main__": --- 2,27 ---- from ctypes import * ! ##if os.name == "posix" and sys.platform != "darwin": ! ## # On platforms where the default shared library suffix is '.so', ! ## # at least some libraries can be loaded as attributes of the cdll ! ## # object, since ctypes now tries loading the lib again ! ## # with '.so' appended of the first try fails. ! ## # ! ## # Won't work for libc, unfortunately. OTOH, it isn't ! ## # needed for libc since this is already mapped into the current ! ## # process (?) ! ## # ! ## # On MAC OSX, it won't work either, because dlopen() needs a full path, ! ## # and the default suffix is either none or '.dylib'. ! ## class LoadLibs(unittest.TestCase): ! ## def test_libm(self): ! ## import math ! ## libm = cdll.libm ! ## sqrt = libm.sqrt ! ## sqrt.argtypes = (c_double,) ! ## sqrt.restype = c_double ! ## self.failUnlessEqual(sqrt(2), math.sqrt(2)) if __name__ == "__main__": |
From: Thomas H. <th...@us...> - 2005-03-18 17:39:43
|
Update of /cvsroot/ctypes/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9678 Modified Files: __init__.py Log Message: Revert the changes in 1.59 and 1.60 again (try to call dlopen() with '.so' appended when the first call fails). Index: __init__.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/__init__.py,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** __init__.py 18 Mar 2005 11:34:56 -0000 1.60 --- __init__.py 18 Mar 2005 17:39:31 -0000 1.61 *************** *** 121,136 **** elif _os.name == "posix": ! from _ctypes import dlopen as _dlopen _FreeLibrary = None - if sys.platform != "darwin": - def _LoadLibrary(name): - try: - return _dlopen(name) - except OSError: - if not name.endswith(".so"): - return _dlopen(name + ".so") - raise - else: - _LoadLibrary = _dlopen from _ctypes import sizeof, byref, addressof, alignment --- 121,126 ---- elif _os.name == "posix": ! from _ctypes import dlopen as _LoadLibrary _FreeLibrary = None from _ctypes import sizeof, byref, addressof, alignment |
From: Thomas H. <th...@us...> - 2005-03-18 11:35:04
|
Update of /cvsroot/ctypes/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27772 Modified Files: __init__.py Log Message: Disable the '.so' magic for dlopen() on OS X. Index: __init__.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/__init__.py,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** __init__.py 17 Mar 2005 20:45:03 -0000 1.59 --- __init__.py 18 Mar 2005 11:34:56 -0000 1.60 *************** *** 123,133 **** from _ctypes import dlopen as _dlopen _FreeLibrary = None ! def _LoadLibrary(name): ! try: ! return _dlopen(name) ! except OSError: ! if not name.endswith(".so"): ! return _dlopen(name + ".so") ! raise from _ctypes import sizeof, byref, addressof, alignment --- 123,136 ---- from _ctypes import dlopen as _dlopen _FreeLibrary = None ! if sys.platform != "darwin": ! def _LoadLibrary(name): ! try: ! return _dlopen(name) ! except OSError: ! if not name.endswith(".so"): ! return _dlopen(name + ".so") ! raise ! else: ! _LoadLibrary = _dlopen from _ctypes import sizeof, byref, addressof, alignment |
From: Thomas H. <th...@us...> - 2005-03-18 11:34:17
|
Update of /cvsroot/ctypes/ctypes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27606 Modified Files: ChangeLog Log Message: Record changes, and fix some spelling mistakes. Index: ChangeLog =================================================================== RCS file: /cvsroot/ctypes/ctypes/ChangeLog,v retrieving revision 1.83 retrieving revision 1.84 diff -C2 -d -r1.83 -r1.84 *** ChangeLog 17 Mar 2005 19:30:27 -0000 1.83 --- ChangeLog 18 Mar 2005 11:34:08 -0000 1.84 *************** *** 1,4 **** --- 1,17 ---- 2005-03-17 Thomas Heller <th...@py...> + * ctypes\__init__.py: On platforms where dlopen is used, and '.so' + is the default shared library extension, if dlopen fails and the + filename doesn't end with '.so', try again with '.so' appended to + the filename. This allows to use the attribute access syntax to + cdll to load libraries in some cases: 'cdll.libm'. + + * ctypes\__init__.py: Removed the __del__ method in _CDLL. This + caused garbage in Python's gc. Reported by Erik Andersen. + + * ctypes.com.register: Enclose the Python script to run as com + server in double quotes in case the path contains spaces. Fix by + Juan Carlos Coruna. + * ctypes.wrap.h2xml script: Added two command line options to include preprocessor symbols into the xml file (the was the *************** *** 21,25 **** * ctypes\source: Removed the unneeded nArgBytes member from ! StgDictObject, and change the code accordingly. Thanks to Andreas Degert for spotting this. --- 34,38 ---- * ctypes\source: Removed the unneeded nArgBytes member from ! StgDictObject, and changed the code accordingly. Thanks to Andreas Degert for spotting this. *************** *** 31,35 **** * _ctypes.c: Fixed refcount leak in functions with 'out' ! parameters. This has only relevance for comtypes. * _ctypes.c: Keyword arguments to Structures/Unions were ignored. --- 44,49 ---- * _ctypes.c: Fixed refcount leak in functions with 'out' ! parameters. This has only relevance for the unreleased comtypes ! package. * _ctypes.c: Keyword arguments to Structures/Unions were ignored. |
From: Thomas H. <th...@us...> - 2005-03-18 11:28:45
|
Update of /cvsroot/ctypes/ctypes/ctypes/wrap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26580 Modified Files: cparser_config.py Log Message: The newest gccxml now understands the MS integer suffixes. Next problem: integer instant too large for "long" type. Index: cparser_config.py =================================================================== RCS file: /cvsroot/ctypes/ctypes/ctypes/wrap/cparser_config.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** cparser_config.py 17 Mar 2005 18:59:00 -0000 1.3 --- cparser_config.py 18 Mar 2005 11:28:36 -0000 1.4 *************** *** 66,85 **** IMAGE_ORDINAL_FLAG64 SECURITY_NT_AUTHORITY ! _I8_MIN ! _I8_MAX ! _UI8_MAX ! _I16_MIN ! _I16_MAX ! _UI16_MAX ! _I32_MIN ! _I32_MAX ! _UI32_MAX ! _I64_MIN ! _I64_MAX ! _UI64_MAX """.strip().split() ! ! # The _I8_MIN symbols and friends are in limits.h, they have constanrs ! # with i8 i16 i32 i64 suffixes which gccxml refuses to compile. EXCLUDED_linux = """ --- 66,75 ---- IMAGE_ORDINAL_FLAG64 SECURITY_NT_AUTHORITY ! LLONG_MAX ! LLONG_MIN ! ULLONG_MAX """.strip().split() ! # The ..LONG_MIN and ..LONG_MAX symbols are in MSVC 7.1 limits.h, ! # gccxml complains: integer constant is too large for "long" type EXCLUDED_linux = """ |