pywin32-checkins Mailing List for Python for Windows Extensions (Page 147)
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: <mha...@us...> - 2003-11-03 22:08:51
|
Update of /cvsroot/pywin32/pywin32/com In directory sc8-pr-cvs1:/tmp/cvs-serv15811 Modified Files: Tag: Python22 win32com.dsp Log Message: New source files on the Python22 branch (god this all sucks - roll on distutils build script!) Index: win32com.dsp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com.dsp,v retrieving revision 1.19.2.1.2.1 retrieving revision 1.19.2.1.2.2 diff -C2 -d -r1.19.2.1.2.1 -r1.19.2.1.2.2 *** win32com.dsp 23 Oct 2003 23:47:24 -0000 1.19.2.1.2.1 --- win32com.dsp 3 Nov 2003 22:08:46 -0000 1.19.2.1.2.2 *************** *** 5003,5006 **** --- 5003,5025 ---- # Begin Source File + SOURCE=.\win32com\src\extensions\PyIEnumSTATPROPSETSTG.cpp + + !IF "$(CFG)" == "win32com - Win32 Release" + + !ELSEIF "$(CFG)" == "win32com - Win32 Debug" + + !ELSEIF "$(CFG)" == "win32com - Win32 (WCE MIPS) Release" + + !ELSEIF "$(CFG)" == "win32com - Win32 (WCE SH3) Release" + + !ELSEIF "$(CFG)" == "win32com - Win32 (WCE x86em) Debug" + + !ELSEIF "$(CFG)" == "win32com - Win32 (WCE MIPS) Debug" + + !ENDIF + + # End Source File + # Begin Source File + SOURCE=.\win32com\src\extensions\PyIEnumSTATPROPSTG.cpp *************** *** 8386,8389 **** --- 8405,8412 ---- SOURCE=.\win32com\src\include\PyIEnumGUID.h + # End Source File + # Begin Source File + + SOURCE=.\win32com\src\include\PyIEnumSTATPROPSETSTG.h # End Source File # Begin Source File |
From: <mha...@us...> - 2003-11-03 07:35:35
|
Update of /cvsroot/pywin32/pywin32/Pythonwin In directory sc8-pr-cvs1:/tmp/cvs-serv5418 Modified Files: win32ctrlTree.cpp win32tooltip.cpp Log Message: Add PyCTreeCtrl.GetToolTips() and PyCToolTipCtr.SetMaxTipWidth() Index: win32ctrlTree.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32ctrlTree.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** win32ctrlTree.cpp 18 Dec 2002 11:44:00 -0000 1.3 --- win32ctrlTree.cpp 3 Nov 2003 07:35:32 -0000 1.4 *************** *** 708,711 **** --- 708,721 ---- } + // @pymethod <o PyCToolTopCtrl>|PyCTreeCtrl|GetToolTips|Returns the tooltip control + PyObject *PyCTreeCtrl_GetToolTips( PyObject *self, PyObject *args ) + { + CTreeCtrl *pList = GetTreeCtrl(self); + if (!pList) return NULL; + CHECK_NO_ARGS2(args,"GetToolTips"); + CToolTipCtrl*ret = pList->GetToolTips(); + return ui_assoc_object::make( PyCToolTipCtrl::type, ret)->GetGoodRet(); + } + // @pymethod (int, int)|PyCTreeCtrl|HitTest|Determines which tree view item, if any, is at a specified position. PyObject *PyCTreeCtrl_HitTest( PyObject *self, PyObject *args ) *************** *** 761,764 **** --- 771,775 ---- {"GetDropHilightItem",PyCTreeCtrl_GetDropHilightItem, 1}, // @pymeth GetDropHilightItem|Retrieves the target of a drag-and-drop operation. {"GetRootItem", PyCTreeCtrl_GetRootItem, 1}, // @pymeth GetRootItem|Retrieves the root of the specified tree view item. + {"GetToolTips", PyCTreeCtrl_GetToolTips, 1}, // @pymeth GetToolTips|Returns the tooltip control {"GetItem", PyCTreeCtrl_GetItem, 1}, // @pymeth GetItem|Retrieves the details of an items attributes. {"SetItem", PyCTreeCtrl_SetItem, 1}, // @pymeth SetItem|Sets some of all of an items attributes. Index: win32tooltip.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/win32tooltip.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** win32tooltip.cpp 1 Sep 1999 23:33:02 -0000 1.1 --- win32tooltip.cpp 3 Nov 2003 07:35:32 -0000 1.2 *************** *** 161,164 **** --- 161,183 ---- + // @pymethod int|PyCToolTipCtrl|SetMaxTipWidth| + static PyObject * + PyCToolTipCtrl_set_max_tip_width(PyObject *self, PyObject *args) + { + int width; + if (!PyArg_ParseTuple(args, "i:SetMaxTipWidth", + &width)) // @pyparm int|width||The new width + return NULL; + + CToolTipCtrl *pTTC = GetToolTipCtrl(self); + if (!pTTC)return NULL; + + GUI_BGN_SAVE; + int rc = pTTC->SetMaxTipWidth(width); + GUI_END_SAVE; + return PyInt_FromLong(rc); + } + + // @object PyCToolTipCtrl|A windows tooltip control. Encapsulates an MFC <c CToolTipCtrl> class. Derived from <o PyCControl>. *************** *** 167,170 **** --- 186,190 ---- {"UpdateTipText", PyCToolTipCtrl_update_tip_text, 1}, // @pymeth UpdateTipText|Update the tool tip text for a control's tools {"AddTool", PyCToolTipCtrl_add_tool, 1}, // @pymeth AddTool|Adds a tool to tooltip control. + {"SetMaxTipWidth", PyCToolTipCtrl_set_max_tip_width, 1}, // @pymeth SetMaxTipWidth| {NULL, NULL} }; |
From: <mha...@us...> - 2003-11-03 07:34:27
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor In directory sc8-pr-cvs1:/tmp/cvs-serv5281 Modified Files: ModuleBrowser.py Log Message: Oops - it looks like we still get fed with strings occasionally. Index: ModuleBrowser.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/ModuleBrowser.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ModuleBrowser.py 3 Nov 2003 05:35:55 -0000 1.7 --- ModuleBrowser.py 3 Nov 2003 07:34:24 -0000 1.8 *************** *** 53,61 **** class HierListCLBRClass(HierListCLBRItem): def __init__(self, clbrclass, suffix = ""): ! name = clbrclass.name ! file = clbrclass.file ! lineno = clbrclass.lineno ! self.super = clbrclass.super ! self.methods = clbrclass.methods HierListCLBRItem.__init__(self, name, file, lineno, suffix) def __cmp__(self,other): --- 53,66 ---- class HierListCLBRClass(HierListCLBRItem): def __init__(self, clbrclass, suffix = ""): ! try: ! name = clbrclass.name ! file = clbrclass.file ! lineno = clbrclass.lineno ! self.super = clbrclass.super ! self.methods = clbrclass.methods ! except AttributeError: ! name = clbrclass ! file = lineno = None ! self.super = []; self.methods = {} HierListCLBRItem.__init__(self, name, file, lineno, suffix) def __cmp__(self,other): |
From: <mha...@us...> - 2003-11-03 05:35:58
|
Update of /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor In directory sc8-pr-cvs1:/tmp/cvs-serv21800 Modified Files: ModuleBrowser.py Log Message: Fix the module browser for later Python versions. Index: ModuleBrowser.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/Pythonwin/pywin/framework/editor/ModuleBrowser.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ModuleBrowser.py 27 Feb 2003 23:20:43 -0000 1.6 --- ModuleBrowser.py 3 Nov 2003 05:35:55 -0000 1.7 *************** *** 53,66 **** class HierListCLBRClass(HierListCLBRItem): def __init__(self, clbrclass, suffix = ""): ! try: ! name = clbrclass.name ! file = clbrclass.file ! lineno = clbrclass.lineno ! self.super = clbrclass.super ! self.methods = clbrclass.methods ! except AttributeError: ! name = clbrclass ! file = lineno = None ! self.super = []; self.methods = {} HierListCLBRItem.__init__(self, name, file, lineno, suffix) def __cmp__(self,other): --- 53,61 ---- class HierListCLBRClass(HierListCLBRItem): def __init__(self, clbrclass, suffix = ""): ! name = clbrclass.name ! file = clbrclass.file ! lineno = clbrclass.lineno ! self.super = clbrclass.super ! self.methods = clbrclass.methods HierListCLBRItem.__init__(self, name, file, lineno, suffix) def __cmp__(self,other): *************** *** 86,90 **** return 21 ! class HierListCLBRFunction(HierListCLBRClass): def GetBitmapColumn(self): return 22 --- 81,90 ---- return 21 ! class HierListCLBRFunction(HierListCLBRItem): ! def __init__(self, clbrfunc, suffix = ""): ! name = clbrfunc.name ! file = clbrfunc.file ! lineno = clbrfunc.lineno ! HierListCLBRItem.__init__(self, name, file, lineno, suffix) def GetBitmapColumn(self): return 22 |
From: <mha...@us...> - 2003-11-02 11:43:32
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1:/tmp/cvs-serv17362 Modified Files: gencache.py Log Message: zipfile yields KeyError rather than IOError when 'file' not found. Index: gencache.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/gencache.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** gencache.py 2 Nov 2003 10:08:20 -0000 1.24 --- gencache.py 2 Nov 2003 11:43:28 -0000 1.25 *************** *** 81,85 **** f = cStringIO.StringIO(zf.read(zip_path)) zf.close() ! except IOError: # Our gencache is in a .zip file (and almost certainly readonly) # but no dicts file. That actually needn't be fatal for a frozen --- 81,85 ---- f = cStringIO.StringIO(zf.read(zip_path)) zf.close() ! except KeyError: # Our gencache is in a .zip file (and almost certainly readonly) # but no dicts file. That actually needn't be fatal for a frozen |
From: <mha...@us...> - 2003-11-02 10:15:51
|
Update of /cvsroot/pywin32/pywin32/win32/test In directory sc8-pr-cvs1:/tmp/cvs-serv6413 Modified Files: testall.py Log Message: A simple test that every win32 .pyd module can actually import! Index: testall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/test/testall.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testall.py 24 Oct 2003 01:49:36 -0000 1.2 --- testall.py 2 Nov 2003 10:15:43 -0000 1.3 *************** *** 2,5 **** --- 2,21 ---- import unittest + def import_all(): + # Some hacks for import order - dde depends on win32ui + import win32ui + + import win32api + dir = os.path.dirname(win32api.__file__) + num = 0 + is_debug = os.path.basename(win32api.__file__).endswith("_d") + for name in os.listdir(dir): + base, ext = os.path.splitext(name) + if (ext==".pyd") and \ + (is_debug and base.endswith("_d") or \ + not is_debug and not base.endswith("_d")): + __import__(base) + num += 1 + def suite(): # Loop over all .py files here, except me :) *************** *** 11,14 **** --- 27,31 ---- files = os.listdir(os.path.dirname(me)) suite = unittest.TestSuite() + suite.addTest(unittest.FunctionTestCase(import_all)) for file in files: base, ext = os.path.splitext(file) |
From: <mha...@us...> - 2003-11-02 10:09:08
|
Update of /cvsroot/pywin32/pywin32/com/win32com In directory sc8-pr-cvs1:/tmp/cvs-serv5277 Modified Files: universal.py Log Message: Drop the old warning that is printed even when not relevant. Index: universal.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/universal.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** universal.py 26 Jul 2003 00:53:55 -0000 1.11 --- universal.py 2 Nov 2003 10:09:05 -0000 1.12 *************** *** 79,87 **** cb = _univgw.SizeOfVT(pythoncom.VT_PTR)[1] elif t == pythoncom.VT_RECORD: ! try: ! import warnings ! warnings.warn("warning: records are known to not work for vtable interfaces") ! except ImportError: ! print "warning: records are known to not work for vtable interfaces" cb = _univgw.SizeOfVT(pythoncom.VT_PTR)[1] #cb = typeInfo.GetTypeAttr().cbSizeInstance --- 79,90 ---- cb = _univgw.SizeOfVT(pythoncom.VT_PTR)[1] elif t == pythoncom.VT_RECORD: ! # Just because a type library uses records doesn't mean the user ! # is trying to. We need to better place to warn about this, but it ! # isn't here. ! #try: ! # import warnings ! # warnings.warn("warning: records are known to not work for vtable interfaces") ! #except ImportError: ! # print "warning: records are known to not work for vtable interfaces" cb = _univgw.SizeOfVT(pythoncom.VT_PTR)[1] #cb = typeInfo.GetTypeAttr().cbSizeInstance |
From: <mha...@us...> - 2003-11-02 10:08:23
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory sc8-pr-cvs1:/tmp/cvs-serv5082 Modified Files: gencache.py Log Message: Fix a subtle bug that only showed up in the test suite. Consider: * Process A starts, with empty gencache * Process A starts process B * Process B creates gencache module for tlb and exits * Process A tries to import gencache module for tlb. Now the module exists, but Process A has never seen it. Index: gencache.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/gencache.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** gencache.py 31 Oct 2003 03:04:02 -0000 1.23 --- gencache.py 2 Nov 2003 10:08:20 -0000 1.24 *************** *** 77,83 **** zip_path = win32com.__gen_path__[zip_pos+5:] zip_path = os.path.join(zip_path, "dicts.dat").replace("\\", "/") ! zf = zipfile.ZipFile(zip_file) ! f = cStringIO.StringIO(zf.read(zip_path)) ! zf.close() else: # NOTE: IOError on file open must be caught by caller. --- 77,97 ---- zip_path = win32com.__gen_path__[zip_pos+5:] zip_path = os.path.join(zip_path, "dicts.dat").replace("\\", "/") ! try: ! zf = zipfile.ZipFile(zip_file) ! f = cStringIO.StringIO(zf.read(zip_path)) ! zf.close() ! except IOError: ! # Our gencache is in a .zip file (and almost certainly readonly) ! # but no dicts file. That actually needn't be fatal for a frozen ! # application. Assuming they call "EnsureModule" with the same ! # typelib IDs they have been frozen with, that EnsureModule will ! # correctly re-build the dicts on the fly. However, objects that ! # rely on the gencache but have not done an EnsureModule will ! # fail (but their apps are likely to fail running from source ! # with a clean gencache anyway, as then they would be getting ! # Dynamic objects until the cache is built - so the best answer ! # for these apps is to call EnsureModule, rather than freezing ! # the dict) ! return else: # NOTE: IOError on file open must be caught by caller. *************** *** 234,238 **** """ modName = GetGeneratedFileName(typelibCLSID, lcid, major, minor) ! return _GetModule(modName) def MakeModuleForTypelib(typelibCLSID, lcid, major, minor, progressInstance = None, bGUIProgress = None, bForDemand = bForDemandDefault, bBuildHidden = 1): --- 248,258 ---- """ modName = GetGeneratedFileName(typelibCLSID, lcid, major, minor) ! mod = _GetModule(modName) ! # If the import worked, it doesn't mean we have actually added this ! # module to our cache though - check that here. ! if not mod.__dict__.has_key("_in_gencache_"): ! AddModuleToCache(typelibCLSID, lcid, major, minor) ! assert mod.__dict__.has_key("_in_gencache_") ! return mod def MakeModuleForTypelib(typelibCLSID, lcid, major, minor, progressInstance = None, bGUIProgress = None, bForDemand = bForDemandDefault, bBuildHidden = 1): *************** *** 516,519 **** --- 536,542 ---- fname = GetGeneratedFileName(typelibclsid, lcid, major, minor) mod = _GetModule(fname) + assert not mod.__dict__.has_key("_in_gencache_"), \ + "This module has already been processed by this process" + mod._in_gencache_ = 1 dict = mod.CLSIDToClassMap info = str(typelibclsid), lcid, major, minor *************** *** 657,662 **** if opt=='-q': verbose = 0 - - #if __name__=='__main__': - # print "Rebuilding cache..." - # Rebuild(1) \ No newline at end of file --- 680,681 ---- |
From: <mha...@us...> - 2003-11-02 10:06:15
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1:/tmp/cvs-serv5029 Added Files: testROT.py testShell.py testStorage.py Log Message: New tests. --- NEW FILE: testROT.py --- import pythoncom import unittest class TestROT(unittest.TestCase): def testit(self): ctx = pythoncom.CreateBindCtx() rot = pythoncom.GetRunningObjectTable() num = 0 for mk in rot: name = mk.GetDisplayName(ctx, None) num += 1 # Monikers themselves can iterate their contents for sub in mk: num += 1 if num < 2: print "Only", num, "objects in the ROT - this is unusual" if __name__=='__main__': unittest.main() --- NEW FILE: testShell.py --- import sys, os import unittest import pythoncom from win32com.shell import shell from win32com.shell.shellcon import * from win32com.storagecon import * class ShellTester(unittest.TestCase): def testShellLink(self): desktop = str(shell.SHGetSpecialFolderPath(0, CSIDL_DESKTOP)) num = 0 shellLink = pythoncom.CoCreateInstance(shell.CLSID_ShellLink, None, pythoncom.CLSCTX_INPROC_SERVER, shell.IID_IShellLink) persistFile = shellLink.QueryInterface(pythoncom.IID_IPersistFile) for base_name in os.listdir(desktop): name = os.path.join(desktop, base_name) try: persistFile.Load(name,STGM_READ) except pythoncom.com_error: continue # Resolve is slow - avoid it for our tests. #shellLink.Resolve(0, shell.SLR_ANY_MATCH | shell.SLR_NO_UI) fname, findData = shellLink.GetPath(0) unc = shellLink.GetPath(shell.SLGP_UNCPRIORITY)[0] num += 1 self.failIf(num<3, "Only found %d items on the desktop??" % num) def testShellFolder(self): sf = shell.SHGetDesktopFolder() names_1 = [] for i in sf: # Magically calls EnumObjects name = sf.GetDisplayNameOf(i, SHGDN_NORMAL) names_1.append(name) # And get the enumerator manually enum = sf.EnumObjects(0, SHCONTF_FOLDERS | SHCONTF_NONFOLDERS | SHCONTF_INCLUDEHIDDEN) names_2 = [] for i in enum: name = sf.GetDisplayNameOf(i, SHGDN_NORMAL) names_2.append(name) names_1.sort() names_2.sort() self.assertEqual(names_1, names_2) if __name__=='__main__': unittest.main() --- NEW FILE: testStorage.py --- from win32com import storagecon import pythoncom, os, win32api import unittest class TestEnum(unittest.TestCase): def testit(self): fname, tmp = win32api.GetTempFileName(win32api.GetTempPath(),'stg') m=storagecon.STGM_READWRITE | storagecon.STGM_SHARE_EXCLUSIVE ## file, mode, format, attrs (always 0), IID (IStorage or IPropertySetStorage, storage options(only used with STGFMT_DOCFILE) pss=pythoncom.StgOpenStorageEx(fname, m, storagecon.STGFMT_FILE, 0 , pythoncom.IID_IPropertySetStorage) ### {"Version":2,"reserved":0,"SectorSize":512,"TemplateFile":u'somefilename'}) ## FMTID_SummaryInformation FMTID_DocSummaryInformation FMTID_UserDefinedProperties psuser=pss.Create(pythoncom.FMTID_UserDefinedProperties, pythoncom.IID_IPropertySetStorage, storagecon.PROPSETFLAG_DEFAULT, storagecon.STGM_READWRITE|storagecon.STGM_CREATE|storagecon.STGM_SHARE_EXCLUSIVE) ## its very picky about flag combinations! psuser.WriteMultiple((3,4),('hey','bubba')) psuser.WritePropertyNames((3,4),('property3','property4')) expected_summaries = [] expected_summaries.append( ('property3', 3, pythoncom.VT_BSTR)) expected_summaries.append( ('property4', 4, pythoncom.VT_BSTR)) psuser=None pssum=pss.Create(pythoncom.FMTID_SummaryInformation, pythoncom.IID_IPropertySetStorage, storagecon.PROPSETFLAG_DEFAULT, storagecon.STGM_READWRITE|storagecon.STGM_CREATE|storagecon.STGM_SHARE_EXCLUSIVE) pssum.WriteMultiple((storagecon.PIDSI_AUTHOR,storagecon.PIDSI_COMMENTS),('me', 'comment')) pssum=None pss=None ## doesn't seem to be a close or release method, and you can't even reopen it from the same process until previous object is gone pssread=pythoncom.StgOpenStorageEx(fname, storagecon.STGM_READ|storagecon.STGM_SHARE_EXCLUSIVE, storagecon.STGFMT_FILE, 0 , pythoncom.IID_IPropertySetStorage) found_summaries = [] for psstat in pssread: ps=pssread.Open(psstat[0],storagecon.STGM_READ|storagecon.STGM_SHARE_EXCLUSIVE) for p in ps: p_val = ps.ReadMultiple((p[1],))[0] if (p[1]==storagecon.PIDSI_AUTHOR and p_val=='me') or \ (p[1]==storagecon.PIDSI_COMMENTS and p_val=='comment'): pass else: self.fail("Uxexpected property %s/%s" % (p, p_val)) ps=None ## FMTID_UserDefinedProperties can't exist without FMTID_DocSummaryInformation, and isn't returned independently from Enum ## also can't be open at same time if psstat[0]==pythoncom.FMTID_DocSummaryInformation: ps=pssread.Open(pythoncom.FMTID_UserDefinedProperties,storagecon.STGM_READ|storagecon.STGM_SHARE_EXCLUSIVE) for p in ps: found_summaries.append(p) ps=None psread=None expected_summaries.sort() found_summaries.sort() self.assertEqual(expected_summaries, found_summaries) if __name__=='__main__': unittest.main() |
From: <mha...@us...> - 2003-11-02 10:05:27
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1:/tmp/cvs-serv4895 Modified Files: testall.py Log Message: More tests use UnitTest - but nore critically, testPyCOMTest would silently fail - fix that! Index: testall.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testall.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** testall.py 31 Oct 2003 13:52:24 -0000 1.17 --- testall.py 2 Nov 2003 10:05:23 -0000 1.18 *************** *** 5,8 **** --- 5,15 ---- import traceback + import unittest + + try: + this_file = __file__ + except NameError: + this_file = sys.argv[0] + def GenerateAndRunOldStyle(): import GenTestScripts *************** *** 38,42 **** print "***** %s test FAILED after %d lines of output" % (desc, capture.get_num_lines_captured()) ! unittest_modules = "testIterators testvbscript_regexp".split() if __name__=='__main__': --- 45,69 ---- print "***** %s test FAILED after %d lines of output" % (desc, capture.get_num_lines_captured()) ! class PyCOMTest(unittest.TestCase): ! def testit(self): ! # Execute testPyComTest in its own process so it can play ! # with the Python thread state ! fname = os.path.join(os.path.dirname(this_file), "testPyComTest.py") ! cmd = '%s "%s" -q 2>&1' % (sys.executable, fname) ! f = os.popen(cmd) ! data = f.read() ! rc = f.close() ! if rc: ! print data ! self.fail("Executing '%s' failed (%d)" % (cmd, rc)) ! data = string.strip(data) ! if data: ! print "** testPyCOMTest generated unexpected output" ! # lf -> cr/lf ! print string.join(string.split(data, "\n"), "\r\n") ! ! unittest_modules = """testIterators testvbscript_regexp testStorage ! testStreams testWMI policySemantics testShell testROT ! """.split() if __name__=='__main__': *************** *** 51,56 **** CleanGenerated() ! import unittest ! testRunner = unittest.TextTestRunner(verbosity=1) for mod_name in unittest_modules: mod = __import__(mod_name) --- 78,85 ---- CleanGenerated() ! verbosity = 1 ! if "-v" in sys.argv: verbosity += 1 ! testRunner = unittest.TextTestRunner(verbosity=verbosity) ! suite = unittest.TestSuite() for mod_name in unittest_modules: mod = __import__(mod_name) *************** *** 59,66 **** else: test = unittest.defaultTestLoader.loadTestsFromModule(mod) ! result = testRunner.run(test) ! if not result.wasSuccessful(): ! print "*" * 50 ! print "Unittest tests failed" import win32com.test.util capture = win32com.test.util.CaptureWriter() --- 88,95 ---- else: test = unittest.defaultTestLoader.loadTestsFromModule(mod) ! suite.addTest(test) ! suite.addTest(unittest.defaultTestLoader.loadTestsFromTestCase(PyCOMTest)) ! result = testRunner.run(suite) ! import win32com.test.util capture = win32com.test.util.CaptureWriter() *************** *** 81,101 **** _test_with_import(capture, "testExchange", "test", "MS Exchange") - _test_with_import(capture, "testStreams", "test", "Streams") - _test_with_import(capture, "testWMI", "test", "WMI") - - # Execute testPyComTest in its own process so it can play - # with the Python thread state - import win32pipe - data = win32pipe.popen(sys.executable + " testPyComTest.py -q").read() - data = string.strip(data) - # lf -> cr/lf - print string.join(string.split(data, "\n"), "\r\n") - import errorSemantics errorSemantics.test() - import policySemantics - policySemantics.TestAll() - try: import testvb --- 110,116 ---- *************** *** 104,108 **** print why - import testAXScript testAXScript.TestAll() --- 119,122 ---- *************** *** 148,151 **** --- 162,169 ---- print "Tests completed." + # re-print unit-test error here so it is noticed + if not result.wasSuccessful(): + print "*" * 20, "- unittest tests FAILED" + CheckClean() pythoncom.CoUninitialize() |
From: <mha...@us...> - 2003-11-02 10:04:41
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1:/tmp/cvs-serv4853 Modified Files: policySemantics.py Log Message: Convert to unitttest test Index: policySemantics.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/policySemantics.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** policySemantics.py 18 Nov 2002 11:20:06 -0000 1.2 --- policySemantics.py 2 Nov 2003 10:04:39 -0000 1.3 *************** *** 4,7 **** --- 4,9 ---- import winerror + import unittest + class Error(Exception): pass *************** *** 48,52 **** if dispids <> [pythoncom.DISPID_EVALUATE, pythoncom.DISPID_NEWENUM, 10, 11, 1000]: raise Error, "Got back the wrong dispids: %s" % dispids - print "IDispatchEx semantics worked" def SemanticTest(ob): --- 50,53 ---- *************** *** 65,83 **** raise Error, "Evaluate returned", rc - dispexob = dispob.QueryInterface(pythoncom.IID_IDispatchEx) - DispExTest(dispexob) - print "Python policy semantics worked." ! def TestAll(): ! debug=0 ! import win32com.server.dispatcher ! if debug: ! dispatcher=win32com.server.dispatcher.DefaultDebugDispatcher ! else: ! dispatcher=None ! disp = win32com.server.util.wrap(PythonSemanticClass(), useDispatcher=dispatcher) ! ob = win32com.client.Dispatch(disp) ! SemanticTest(ob) if __name__=='__main__': ! TestAll() --- 66,88 ---- raise Error, "Evaluate returned", rc ! class Tester(unittest.TestCase): ! def setUp(self): ! debug=0 ! import win32com.server.dispatcher ! if debug: ! dispatcher=win32com.server.dispatcher.DefaultDebugDispatcher ! else: ! dispatcher=None ! disp = win32com.server.util.wrap(PythonSemanticClass(), useDispatcher=dispatcher) ! self.ob = win32com.client.Dispatch(disp) ! def tearDown(self): ! self.ob = None ! def testSemantics(self): ! SemanticTest(self.ob) ! def testIDispatchEx(self): ! dispexob = self.ob._oleobj_.QueryInterface(pythoncom.IID_IDispatchEx) ! DispExTest(dispexob) if __name__=='__main__': ! unittest.main() |
From: <mha...@us...> - 2003-11-02 10:04:10
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1:/tmp/cvs-serv4790 Modified Files: testWMI.py testStreams.py Log Message: Convert to unittest tests Index: testWMI.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testWMI.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** testWMI.py 3 Jul 2003 03:45:18 -0000 1.1 --- testWMI.py 2 Nov 2003 10:04:06 -0000 1.2 *************** *** 1,9 **** from win32com.client import GetObject ! def test(): ! cses = GetObject("WinMgMts:").InstancesOf("Win32_Process") ! for cs in cses: ! print cs.Properties_("Caption").Value if __name__=='__main__': ! test() --- 1,16 ---- from win32com.client import GetObject ! import unittest ! ! class Simple(unittest.TestCase): ! def testit(self): ! cses = GetObject("WinMgMts:").InstancesOf("Win32_Process") ! vals = [] ! for cs in cses: ! val = cs.Properties_("Caption").Value ! vals.append(val) ! self.failIf(len(vals)<5, "We only found %d processes!" % len(vals)) if __name__=='__main__': ! unittest.main() ! Index: testStreams.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testStreams.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** testStreams.py 18 Nov 2002 11:20:07 -0000 1.2 --- testStreams.py 2 Nov 2003 10:04:07 -0000 1.3 *************** *** 3,26 **** import util class Persists: _public_methods_ = [ 'GetClassID', 'IsDirty', 'Load', 'Save', 'GetSizeMax', 'InitNew' ] _com_interfaces_ = [ pythoncom.IID_IPersistStreamInit ] ! def GetClassID(self): return pythoncom.IID_NULL - def IsDirty(self): ! return 1 ! def Load(self, stream): ! print "loaded:", stream.Read(26) ! def Save(self, stream, clearDirty): ! stream.Write('ABCDEFGHIJKLMNOPQRSTUVWXYZ') ! print "(saved state)" ! def GetSizeMax(self): ! return 26 def InitNew(self): --- 3,27 ---- import util + import unittest + class Persists: _public_methods_ = [ 'GetClassID', 'IsDirty', 'Load', 'Save', 'GetSizeMax', 'InitNew' ] _com_interfaces_ = [ pythoncom.IID_IPersistStreamInit ] ! def __init__(self): ! self.data = "abcdefg" ! self.dirty = 1 def GetClassID(self): return pythoncom.IID_NULL def IsDirty(self): ! return self.dirty def Load(self, stream): ! self.data = stream.Read(26) def Save(self, stream, clearDirty): ! stream.Write(self.data) ! if clearDirty: ! self.dirty = 0 def GetSizeMax(self): ! return 1024 def InitNew(self): *************** *** 47,81 **** ! def test(): ! mydata = 'abcdefghijklmnopqrstuvwxyz' ! ! # First test the objects just as Python objects... ! s = Stream(mydata) ! p = Persists() ! ! p.Load(s) ! p.Save(s, 0) ! print "new state:", s.data ! ! # reset the stream ! s.Write(mydata) ! ! # Wrap the Python objects as COM objects, and make the calls as if ! # they were non-Python COM objects. ! s2 = win32com.server.util.wrap(s, pythoncom.IID_IStream) ! p2 = win32com.server.util.wrap(p, pythoncom.IID_IPersistStreamInit) ! print "read:", s2.Read(26) ! s2.Write("kilroy was here") ! print "new state:", s.data ! # reset the stream ! s.Write(mydata) ! p2.Load(s2) ! p2.Save(s2, 0) ! print "new state:", s.data if __name__=='__main__': ! test() util.CheckClean() --- 48,87 ---- ! class StreamTest(unittest.TestCase): ! def _readWrite(self, data, write_stream, read_stream = None): ! if read_stream is None: read_stream = write_stream ! write_stream.Write(data) ! got = read_stream.Read(len(data)) ! self.assertEqual(data, got) ! def testit(self): ! mydata = 'abcdefghijklmnopqrstuvwxyz' ! ! # First test the objects just as Python objects... ! s = Stream(mydata) ! p = Persists() ! ! p.Load(s) ! p.Save(s, 0) ! self.assertEqual(s.data, mydata) ! ! # Wrap the Python objects as COM objects, and make the calls as if ! # they were non-Python COM objects. ! s2 = win32com.server.util.wrap(s, pythoncom.IID_IStream) ! p2 = win32com.server.util.wrap(p, pythoncom.IID_IPersistStreamInit) ! self._readWrite(mydata, s, s) ! self._readWrite(mydata, s, s2) ! self._readWrite(mydata, s2, s) ! self._readWrite(mydata, s2, s2) ! self._readWrite("string with\0a NULL", s2, s2) ! # reset the stream ! s.Write(mydata) ! p2.Load(s2) ! p2.Save(s2, 0) ! self.assertEqual(s.data, mydata) if __name__=='__main__': ! unittest.main() util.CheckClean() |
From: <mha...@us...> - 2003-11-02 10:03:27
|
Update of /cvsroot/pywin32/pywin32/com/win32com/test In directory sc8-pr-cvs1:/tmp/cvs-serv4662 Modified Files: testPyComTest.py Log Message: Add a few comments, and dont print anything when quiet Index: testPyComTest.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/test/testPyComTest.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** testPyComTest.py 23 Oct 2003 07:09:05 -0000 1.16 --- testPyComTest.py 2 Nov 2003 10:03:24 -0000 1.17 *************** *** 7,10 **** --- 7,12 ---- from win32com.test.util import CheckClean from win32com.client import constants + import win32com + from util import RegisterPythonServer importMsg = "**** PyCOMTest is not installed ***\n PyCOMTest is a Python test specific COM client and server.\n It is likely this server is not installed on this machine\n To install the server, you must get the win32com sources\n and build it using MS Visual C++" *************** *** 13,18 **** # This test uses a Python implemented COM server - ensure correctly registered. - from util import RegisterPythonServer - import win32com RegisterPythonServer(os.path.join(win32com.__path__[0], "servers", "test_pycomtest.py")) --- 15,18 ---- *************** *** 25,30 **** raise RuntimeError, importMsg - import sys - # We had a bg where RegisterInterfaces would fail if gencache had # already been run - exercise that here --- 25,28 ---- *************** *** 319,331 **** def TestMultiVTable(): ! # Ideally we should be able to do this test multiple times, ! # however at the moment the second call generates an invalid ! # memory read to bubble up out of python. Set the range ! # to 1 to pass this test, i.e. for i in range(1) ! for i in range(2): progress("Testing VTables in-process #%d..." % (i+1)) TestVTable(pythoncom.CLSCTX_INPROC_SERVER) ! for i in range(2): progress("Testing VTables out-of-process #%d..." % (i+1)) TestVTable(pythoncom.CLSCTX_LOCAL_SERVER) --- 317,326 ---- def TestMultiVTable(): ! # We used to crash running this the second time - do it a few times ! for i in range(3): progress("Testing VTables in-process #%d..." % (i+1)) TestVTable(pythoncom.CLSCTX_INPROC_SERVER) ! for i in range(3): progress("Testing VTables out-of-process #%d..." % (i+1)) TestVTable(pythoncom.CLSCTX_LOCAL_SERVER) *************** *** 372,374 **** CheckClean() pythoncom.CoUninitialize() ! print "C++ test harness worked OK." --- 367,370 ---- CheckClean() pythoncom.CoUninitialize() ! if verbose: ! print "C++ test harness worked OK." |
From: <mha...@us...> - 2003-11-02 10:00:36
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/axscript/src In directory sc8-pr-cvs1:/tmp/cvs-serv4379 Modified Files: GUIDS.CPP Log Message: Correct case of #include file Index: GUIDS.CPP =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/axscript/src/GUIDS.CPP,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GUIDS.CPP 16 Oct 2000 06:00:50 -0000 1.2 --- GUIDS.CPP 2 Nov 2003 10:00:32 -0000 1.3 *************** *** 19,23 **** // === Project Guids === ! #include "guids.h" // NOTE - The standard "activscp.h" header is not good enough - // need to use IE4 SDK or MSVC6 etc --- 19,23 ---- // === Project Guids === ! #include "GUIDS.h" // NOTE - The standard "activscp.h" header is not good enough - // need to use IE4 SDK or MSVC6 etc |
From: <mha...@us...> - 2003-11-02 09:58:36
|
Update of /cvsroot/pywin32/pywin32/com/win32comext/shell/src In directory sc8-pr-cvs1:/tmp/cvs-serv4026 Modified Files: PyIEnumIDList.cpp PyIEnumIDList.h PyIShellFolder.cpp PyIShellFolder.h Log Message: New iterator world order. Index: PyIEnumIDList.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIEnumIDList.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyIEnumIDList.cpp 31 Oct 2003 06:58:13 -0000 1.3 --- PyIEnumIDList.cpp 2 Nov 2003 09:58:32 -0000 1.4 *************** *** 25,55 **** } - PyObject * - PyIEnumIDList::iter() - { - Py_INCREF(this); - return this; - } - - PyObject * - PyIEnumIDList::iternext() - { - ULONG celtFetched = 0; - ITEMIDLIST *pRet; - IEnumIDList *peidl = GetI(this); - if ( peidl == NULL ) - return NULL; - PY_INTERFACE_PRECALL; - HRESULT hr = peidl->Next(1, &pRet, &celtFetched); - PY_INTERFACE_POSTCALL; - if ( HRESULT_CODE(hr) != ERROR_NO_MORE_ITEMS && FAILED(hr) ) - return PyCom_BuildPyException(hr,peidl, IID_IEnumIDList); - if (celtFetched==0) { - PyErr_SetNone(PyExc_StopIteration); - return NULL; - } - return PyObject_FromPIDL(pRet, TRUE); - } - // @pymethod object|PyIEnumIDList|Next|Retrieves a specified number of items in the enumeration sequence. PyObject *PyIEnumIDList::Next(PyObject *self, PyObject *args) --- 25,28 ---- *************** *** 64,72 **** return NULL; ! ITEMIDLIST *rgVar = new ITEMIDLIST [celt]; if ( rgVar == NULL ) { PyErr_SetString(PyExc_MemoryError, "allocating result ITEMIDLISTs"); return NULL; } int i; --- 37,46 ---- return NULL; ! LPITEMIDLIST *rgVar = new LPITEMIDLIST [celt]; if ( rgVar == NULL ) { PyErr_SetString(PyExc_MemoryError, "allocating result ITEMIDLISTs"); return NULL; } + memset(rgVar, 0, sizeof(ITEMIDLIST *) * celt); int i; *************** *** 77,81 **** ULONG celtFetched = 0; PY_INTERFACE_PRECALL; ! HRESULT hr = peidl->Next(celt, &rgVar, &celtFetched); PY_INTERFACE_POSTCALL; if ( HRESULT_CODE(hr) != ERROR_NO_MORE_ITEMS && FAILED(hr) ) --- 51,55 ---- ULONG celtFetched = 0; PY_INTERFACE_PRECALL; ! HRESULT hr = peidl->Next(celt, rgVar, &celtFetched); PY_INTERFACE_POSTCALL; if ( HRESULT_CODE(hr) != ERROR_NO_MORE_ITEMS && FAILED(hr) ) *************** *** 90,94 **** for ( i = celtFetched; i--; ) { ! PyObject *ob = PyObject_FromPIDL(rgVar+i, TRUE); if ( ob == NULL ) { --- 64,68 ---- for ( i = celtFetched; i--; ) { ! PyObject *ob = PyObject_FromPIDL(rgVar[i], TRUE); if ( ob == NULL ) { *************** *** 101,107 **** } ! /* for ( i = celtFetched; i--; ) ! // *** possibly cleanup each structure element??? ! */ delete [] rgVar; return result; --- 75,79 ---- } ! // Each item free'd by PyObject_FromPIDL'd TRUE param delete [] rgVar; return result; Index: PyIEnumIDList.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIEnumIDList.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyIEnumIDList.h 31 Oct 2003 06:58:13 -0000 1.3 --- PyIEnumIDList.h 2 Nov 2003 09:58:32 -0000 1.4 *************** *** 12,18 **** static PyComEnumTypeObject type; - virtual PyObject *iter(); - virtual PyObject *iternext(); - // The Python methods static PyObject *Next(PyObject *self, PyObject *args); --- 12,15 ---- Index: PyIShellFolder.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellFolder.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIShellFolder.cpp 31 Oct 2003 06:58:13 -0000 1.2 --- PyIShellFolder.cpp 2 Nov 2003 09:58:32 -0000 1.3 *************** *** 25,46 **** } - // @pymethod |PyIShellFolder|__iter__|Enumerates all objects in this folder. - // @comm Calls EnumObjects(SHCONTF_FOLDERS\|SHCONTF_NONFOLDERS\|SHCONTF_INCLUDEHIDDEN), - // returning PIDL objects. - PyObject * - PyIShellFolder::iter() - { - IShellFolder *pISF = GetI(this); - DWORD flags = SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN; - IEnumIDList * ppeidl; - HRESULT hr; - PY_INTERFACE_PRECALL; - hr = pISF->EnumObjects( 0, flags, &ppeidl ); - PY_INTERFACE_POSTCALL; - if ( FAILED(hr) ) - return PyCom_BuildPyException(hr, pISF, IID_IShellFolder ); - return PyCom_PyObjectFromIUnknown(ppeidl, IID_IEnumIDList, FALSE); - } - // @pymethod |PyIShellFolder|ParseDisplayName|Description of ParseDisplayName. PyObject *PyIShellFolder::ParseDisplayName(PyObject *self, PyObject *args) --- 25,28 ---- *************** *** 91,100 **** if ( pISF == NULL ) return NULL; ! // @pyparm HWND|hwndOwner||Description for hwndOwner ! // @pyparm int|grfFlags||Description for grfFlags ! HWND hwndOwner; ! DWORD grfFlags; IEnumIDList * ppeidl; ! if ( !PyArg_ParseTuple(args, "ll:EnumObjects", &hwndOwner, &grfFlags) ) return NULL; HRESULT hr; --- 73,82 ---- if ( pISF == NULL ) return NULL; ! // @pyparm HWND|hwndOwner|0|Description for hwndOwner ! // @pyparm int|grfFlags|SHCONTF_FOLDERS\|SHCONTF_NONFOLDERS\|SHCONTF_INCLUDEHIDDEN|Description for grfFlags ! HWND hwndOwner = 0; ! DWORD grfFlags = SHCONTF_FOLDERS|SHCONTF_NONFOLDERS|SHCONTF_INCLUDEHIDDEN; IEnumIDList * ppeidl; ! if ( !PyArg_ParseTuple(args, "|ll:EnumObjects", &hwndOwner, &grfFlags) ) return NULL; HRESULT hr; *************** *** 416,420 **** sizeof(PyIShellFolder), PyIShellFolder_methods, ! GET_PYCOM_CTOR(PyIShellFolder)); // --------------------------------------------------- // --- 398,403 ---- sizeof(PyIShellFolder), PyIShellFolder_methods, ! GET_PYCOM_CTOR(PyIShellFolder), ! "EnumObjects"); // --------------------------------------------------- // Index: PyIShellFolder.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32comext/shell/src/PyIShellFolder.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIShellFolder.h 31 Oct 2003 06:58:13 -0000 1.2 --- PyIShellFolder.h 2 Nov 2003 09:58:32 -0000 1.3 *************** *** 12,17 **** static PyComEnumProviderTypeObject type; - virtual PyObject *iter(); - // The Python methods static PyObject *ParseDisplayName(PyObject *self, PyObject *args); --- 12,15 ---- |
From: <mha...@us...> - 2003-11-02 09:57:49
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv3869/include Modified Files: PyIEnumConnectionPoints.h PyIEnumConnections.h PyIEnumFORMATETC.h PyIEnumGUID.h PyIEnumSTATPROPSETSTG.h PyIEnumSTATPROPSTG.h PyIEnumSTATSTG.h PyIEnumVARIANT.h PyIPropertySetStorage.h PyIPropertyStorage.h PyIRunningObjectTable.h Log Message: New iterator world order (last time, I promise!) Index: PyIEnumConnectionPoints.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumConnectionPoints.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIEnumConnectionPoints.h 2 Nov 2003 05:26:13 -0000 1.2 --- PyIEnumConnectionPoints.h 2 Nov 2003 09:57:44 -0000 1.3 *************** *** 5,9 **** // Interface Declaration ! class PyIEnumConnectionPoints : public PyIEnum { public: --- 5,9 ---- // Interface Declaration ! class PyIEnumConnectionPoints : public PyIUnknown { public: Index: PyIEnumConnections.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumConnections.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIEnumConnections.h 2 Nov 2003 05:26:13 -0000 1.2 --- PyIEnumConnections.h 2 Nov 2003 09:57:44 -0000 1.3 *************** *** 5,9 **** // Interface Declaration ! class PyIEnumConnections : public PyIEnum { public: --- 5,9 ---- // Interface Declaration ! class PyIEnumConnections : public PyIUnknown { public: Index: PyIEnumFORMATETC.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumFORMATETC.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyIEnumFORMATETC.h 2 Nov 2003 05:26:13 -0000 1.5 --- PyIEnumFORMATETC.h 2 Nov 2003 09:57:44 -0000 1.6 *************** *** 5,9 **** // Interface Declaration ! class PyIEnumFORMATETC : public PyIEnum { public: --- 5,9 ---- // Interface Declaration ! class PyIEnumFORMATETC : public PyIUnknown { public: Index: PyIEnumGUID.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumGUID.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIEnumGUID.h 2 Nov 2003 05:26:13 -0000 1.2 --- PyIEnumGUID.h 2 Nov 2003 09:57:45 -0000 1.3 *************** *** 2,6 **** // class PyIEnumGUID #ifndef NO_PYCOM_IENUMGUID ! class PyIEnumGUID : public PyIEnum { public: --- 2,6 ---- // class PyIEnumGUID #ifndef NO_PYCOM_IENUMGUID ! class PyIEnumGUID : public PyIUnknown { public: *************** *** 23,27 **** // class PyIEnumCATEGORYINFO #ifndef NO_PYCOM_IENUMCATEGORYINFO ! class PyIEnumCATEGORYINFO : public PyIEnum { public: --- 23,27 ---- // class PyIEnumCATEGORYINFO #ifndef NO_PYCOM_IENUMCATEGORYINFO ! class PyIEnumCATEGORYINFO : public PyIUnknown { public: Index: PyIEnumSTATPROPSETSTG.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumSTATPROPSETSTG.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIEnumSTATPROPSETSTG.h 2 Nov 2003 05:26:13 -0000 1.2 --- PyIEnumSTATPROPSETSTG.h 2 Nov 2003 09:57:45 -0000 1.3 *************** *** 2,6 **** ! class PyIEnumSTATPROPSETSTG : public PyIEnum { public: --- 2,6 ---- ! class PyIEnumSTATPROPSETSTG : public PyIUnknown { public: Index: PyIEnumSTATPROPSTG.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumSTATPROPSTG.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIEnumSTATPROPSTG.h 2 Nov 2003 05:26:13 -0000 1.2 --- PyIEnumSTATPROPSTG.h 2 Nov 2003 09:57:45 -0000 1.3 *************** *** 5,9 **** // Interface Declaration ! class PyIEnumSTATPROPSTG : public PyIEnum { public: --- 5,9 ---- // Interface Declaration ! class PyIEnumSTATPROPSTG : public PyIUnknown { public: Index: PyIEnumSTATSTG.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumSTATSTG.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIEnumSTATSTG.h 2 Nov 2003 05:26:13 -0000 1.2 --- PyIEnumSTATSTG.h 2 Nov 2003 09:57:45 -0000 1.3 *************** *** 5,9 **** // Interface Declaration ! class PyIEnumSTATSTG : public PyIEnum { public: --- 5,9 ---- // Interface Declaration ! class PyIEnumSTATSTG : public PyIUnknown { public: Index: PyIEnumVARIANT.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumVARIANT.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyIEnumVARIANT.h 2 Nov 2003 05:26:13 -0000 1.6 --- PyIEnumVARIANT.h 2 Nov 2003 09:57:45 -0000 1.7 *************** *** 5,9 **** #include "PythonCOMServer.h" ! class PYCOM_EXPORT PyIEnumVARIANT : public PyIEnum { public: --- 5,9 ---- #include "PythonCOMServer.h" ! class PYCOM_EXPORT PyIEnumVARIANT : public PyIUnknown { public: Index: PyIPropertySetStorage.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIPropertySetStorage.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIPropertySetStorage.h 2 Nov 2003 05:26:13 -0000 1.2 --- PyIPropertySetStorage.h 2 Nov 2003 09:57:45 -0000 1.3 *************** *** 5,9 **** // Interface Declaration ! class PyIPropertySetStorage : public PyIEnumProvider { public: --- 5,9 ---- // Interface Declaration ! class PyIPropertySetStorage : public PyIUnknown { public: Index: PyIPropertyStorage.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIPropertyStorage.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIPropertyStorage.h 2 Nov 2003 05:26:13 -0000 1.2 --- PyIPropertyStorage.h 2 Nov 2003 09:57:45 -0000 1.3 *************** *** 5,9 **** // Interface Declaration ! class PyIPropertyStorage : public PyIEnumProvider { public: --- 5,9 ---- // Interface Declaration ! class PyIPropertyStorage : public PyIUnknown { public: Index: PyIRunningObjectTable.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIRunningObjectTable.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIRunningObjectTable.h 1 Sep 1999 23:04:14 -0000 1.1 --- PyIRunningObjectTable.h 2 Nov 2003 09:57:45 -0000 1.2 *************** *** 4,8 **** public: MAKE_PYCOM_CTOR(PyIRunningObjectTable); ! static PyComTypeObject type; static IRunningObjectTable *GetI(PyObject *self); --- 4,8 ---- public: MAKE_PYCOM_CTOR(PyIRunningObjectTable); ! static PyComEnumProviderTypeObject type; static IRunningObjectTable *GetI(PyObject *self); |
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1:/tmp/cvs-serv3869/extensions Modified Files: PyIEnumCATEGORYINFO.cpp PyIEnumConnectionPoints.cpp PyIEnumConnections.cpp PyIEnumFORMATETC.cpp PyIEnumGUID.cpp PyIEnumSTATPROPSETSTG.cpp PyIEnumSTATPROPSTG.cpp PyIEnumSTATSTG.cpp PyIEnumVARIANT.cpp PyIPropertySetStorage.cpp PyIPropertyStorage.cpp PyIRunningObjectTable.cpp Log Message: New iterator world order (last time, I promise!) Index: PyIEnumCATEGORYINFO.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIEnumCATEGORYINFO.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyIEnumCATEGORYINFO.cpp 2 Nov 2003 05:26:13 -0000 1.5 --- PyIEnumCATEGORYINFO.cpp 2 Nov 2003 09:57:44 -0000 1.6 *************** *** 11,15 **** PyIEnumCATEGORYINFO::PyIEnumCATEGORYINFO(IUnknown *pDisp) : ! PyIEnum(pDisp) { ob_type = &type; --- 11,15 ---- PyIEnumCATEGORYINFO::PyIEnumCATEGORYINFO(IUnknown *pDisp) : ! PyIUnknown(pDisp) { ob_type = &type; Index: PyIEnumConnectionPoints.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIEnumConnectionPoints.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIEnumConnectionPoints.cpp 2 Nov 2003 05:26:13 -0000 1.2 --- PyIEnumConnectionPoints.cpp 2 Nov 2003 09:57:44 -0000 1.3 *************** *** 14,18 **** PyIEnumConnectionPoints::PyIEnumConnectionPoints(IUnknown *pdisp): ! PyIEnum(pdisp) { ob_type = &type; --- 14,18 ---- PyIEnumConnectionPoints::PyIEnumConnectionPoints(IUnknown *pdisp): ! PyIUnknown(pdisp) { ob_type = &type; Index: PyIEnumConnections.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIEnumConnections.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyIEnumConnections.cpp 2 Nov 2003 05:26:13 -0000 1.3 --- PyIEnumConnections.cpp 2 Nov 2003 09:57:44 -0000 1.4 *************** *** 14,18 **** PyIEnumConnections::PyIEnumConnections(IUnknown *pdisp): ! PyIEnum(pdisp) { ob_type = &type; --- 14,18 ---- PyIEnumConnections::PyIEnumConnections(IUnknown *pdisp): ! PyIUnknown(pdisp) { ob_type = &type; Index: PyIEnumFORMATETC.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIEnumFORMATETC.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyIEnumFORMATETC.cpp 2 Nov 2003 05:26:13 -0000 1.5 --- PyIEnumFORMATETC.cpp 2 Nov 2003 09:57:44 -0000 1.6 *************** *** 16,20 **** PyIEnumFORMATETC::PyIEnumFORMATETC(IUnknown *pdisp): ! PyIEnum(pdisp) { ob_type = &type; --- 16,20 ---- PyIEnumFORMATETC::PyIEnumFORMATETC(IUnknown *pdisp): ! PyIUnknown(pdisp) { ob_type = &type; Index: PyIEnumGUID.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIEnumGUID.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyIEnumGUID.cpp 2 Nov 2003 05:26:13 -0000 1.4 --- PyIEnumGUID.cpp 2 Nov 2003 09:57:44 -0000 1.5 *************** *** 11,15 **** PyIEnumGUID::PyIEnumGUID(IUnknown *pDisp) : ! PyIEnum(pDisp) { ob_type = &type; --- 11,15 ---- PyIEnumGUID::PyIEnumGUID(IUnknown *pDisp) : ! PyIUnknown(pDisp) { ob_type = &type; Index: PyIEnumSTATPROPSETSTG.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIEnumSTATPROPSETSTG.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** PyIEnumSTATPROPSETSTG.cpp 2 Nov 2003 05:26:13 -0000 1.2 --- PyIEnumSTATPROPSETSTG.cpp 2 Nov 2003 09:57:44 -0000 1.3 *************** *** 16,20 **** PyIEnumSTATPROPSETSTG::PyIEnumSTATPROPSETSTG(IUnknown *pdisp): ! PyIEnum(pdisp) { ob_type = &type; --- 16,20 ---- PyIEnumSTATPROPSETSTG::PyIEnumSTATPROPSETSTG(IUnknown *pdisp): ! PyIUnknown(pdisp) { ob_type = &type; Index: PyIEnumSTATPROPSTG.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIEnumSTATPROPSTG.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyIEnumSTATPROPSTG.cpp 2 Nov 2003 05:26:13 -0000 1.4 --- PyIEnumSTATPROPSTG.cpp 2 Nov 2003 09:57:44 -0000 1.5 *************** *** 16,20 **** PyIEnumSTATPROPSTG::PyIEnumSTATPROPSTG(IUnknown *pdisp): ! PyIEnum(pdisp) { ob_type = &type; --- 16,20 ---- PyIEnumSTATPROPSTG::PyIEnumSTATPROPSTG(IUnknown *pdisp): ! PyIUnknown(pdisp) { ob_type = &type; Index: PyIEnumSTATSTG.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIEnumSTATSTG.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyIEnumSTATSTG.cpp 2 Nov 2003 05:26:13 -0000 1.3 --- PyIEnumSTATSTG.cpp 2 Nov 2003 09:57:44 -0000 1.4 *************** *** 14,18 **** PyIEnumSTATSTG::PyIEnumSTATSTG(IUnknown *pdisp): ! PyIEnum(pdisp) { ob_type = &type; --- 14,18 ---- PyIEnumSTATSTG::PyIEnumSTATSTG(IUnknown *pdisp): ! PyIUnknown(pdisp) { ob_type = &type; Index: PyIEnumVARIANT.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIEnumVARIANT.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyIEnumVARIANT.cpp 2 Nov 2003 05:26:13 -0000 1.6 --- PyIEnumVARIANT.cpp 2 Nov 2003 09:57:44 -0000 1.7 *************** *** 4,8 **** PyIEnumVARIANT::PyIEnumVARIANT(IUnknown *pdisp): ! PyIEnum(pdisp) { ob_type = &type; --- 4,8 ---- PyIEnumVARIANT::PyIEnumVARIANT(IUnknown *pdisp): ! PyIUnknown(pdisp) { ob_type = &type; Index: PyIPropertySetStorage.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIPropertySetStorage.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyIPropertySetStorage.cpp 2 Nov 2003 05:26:13 -0000 1.3 --- PyIPropertySetStorage.cpp 2 Nov 2003 09:57:44 -0000 1.4 *************** *** 14,18 **** PyIPropertySetStorage::PyIPropertySetStorage(IUnknown *pdisp): ! PyIEnumProvider(pdisp) { ob_type = &type; --- 14,18 ---- PyIPropertySetStorage::PyIPropertySetStorage(IUnknown *pdisp): ! PyIUnknown(pdisp) { ob_type = &type; Index: PyIPropertyStorage.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIPropertyStorage.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PyIPropertyStorage.cpp 2 Nov 2003 05:26:13 -0000 1.7 --- PyIPropertyStorage.cpp 2 Nov 2003 09:57:44 -0000 1.8 *************** *** 247,251 **** PyIPropertyStorage::PyIPropertyStorage(IUnknown *pdisp): ! PyIEnumProvider(pdisp) { ob_type = &type; --- 247,251 ---- PyIPropertyStorage::PyIPropertyStorage(IUnknown *pdisp): ! PyIUnknown(pdisp) { ob_type = &type; Index: PyIRunningObjectTable.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIRunningObjectTable.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyIRunningObjectTable.cpp 26 Nov 1999 04:01:33 -0000 1.3 --- PyIRunningObjectTable.cpp 2 Nov 2003 09:57:44 -0000 1.4 *************** *** 101,108 **** }; ! PyComTypeObject PyIRunningObjectTable::type("PyIRunningObjectTable", &PyIUnknown::type, // @base PyIRunningObjectTable|PyIUnknown sizeof(PyIRunningObjectTable), PyIRunningObjectTable_methods, ! GET_PYCOM_CTOR(PyIRunningObjectTable)); ! --- 101,108 ---- }; ! PyComEnumProviderTypeObject PyIRunningObjectTable::type("PyIRunningObjectTable", &PyIUnknown::type, // @base PyIRunningObjectTable|PyIUnknown sizeof(PyIRunningObjectTable), PyIRunningObjectTable_methods, ! GET_PYCOM_CTOR(PyIRunningObjectTable), ! "EnumRunning"); |
From: <mha...@us...> - 2003-11-02 09:56:50
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/extensions In directory sc8-pr-cvs1:/tmp/cvs-serv3671/extensions Modified Files: PyIMoniker.cpp Log Message: Fix a reference leak in the PyIMoniker enum implementation. Make a moniker an iterator Index: PyIMoniker.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/extensions/PyIMoniker.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PyIMoniker.cpp 26 Nov 1999 04:01:05 -0000 1.3 --- PyIMoniker.cpp 2 Nov 2003 09:56:42 -0000 1.4 *************** *** 58,62 **** for ( i = celtFetched; i--; ) { ! PyObject *ob = PyCom_PyObjectFromIUnknown(rgVar[i], IID_IMoniker, TRUE); if ( ob == NULL ) { --- 58,62 ---- for ( i = celtFetched; i--; ) { ! PyObject *ob = PyCom_PyObjectFromIUnknown(rgVar[i], IID_IMoniker, FALSE); if ( ob == NULL ) { *************** *** 139,143 **** }; ! PyComTypeObject PyIEnumMoniker::type("PyIEnumMoniker", &PyIUnknown::type, // @base PyIEnumMoniker|PyIUnknown sizeof(PyIEnumMoniker), --- 139,143 ---- }; ! PyComEnumTypeObject PyIEnumMoniker::type("PyIEnumMoniker", &PyIUnknown::type, // @base PyIEnumMoniker|PyIUnknown sizeof(PyIEnumMoniker), *************** *** 344,350 **** PyObject *PyIMoniker::Enum(PyObject *self, PyObject *args) { ! // @pyparm int|fForward||If TRUE, enumerates the monikers from left to right. If FALSE, enumerates from right to left. ! int fForward; ! if (!PyArg_ParseTuple(args, "i:Enum", &fForward)) return NULL; --- 344,350 ---- PyObject *PyIMoniker::Enum(PyObject *self, PyObject *args) { ! // @pyparm int|fForward|True|If TRUE, enumerates the monikers from left to right. If FALSE, enumerates from right to left. ! int fForward = TRUE; ! if (!PyArg_ParseTuple(args, "|i:Enum", &fForward)) return NULL; *************** *** 432,438 **** }; ! PyComTypeObject PyIMoniker::type("PyIMoniker", &PyIPersistStream::type, // @base PyIMoniker|PyIPersistStream sizeof(PyIMoniker), PyIMoniker_methods, ! GET_PYCOM_CTOR(PyIMoniker)); --- 432,439 ---- }; ! PyComEnumProviderTypeObject PyIMoniker::type("PyIMoniker", &PyIPersistStream::type, // @base PyIMoniker|PyIPersistStream sizeof(PyIMoniker), PyIMoniker_methods, ! GET_PYCOM_CTOR(PyIMoniker), ! "Enum"); |
From: <mha...@us...> - 2003-11-02 09:56:50
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv3671/include Modified Files: PyIMoniker.h Log Message: Fix a reference leak in the PyIMoniker enum implementation. Make a moniker an iterator Index: PyIMoniker.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIMoniker.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIMoniker.h 1 Sep 1999 23:04:14 -0000 1.1 --- PyIMoniker.h 2 Nov 2003 09:56:42 -0000 1.2 *************** *** 8,12 **** public: MAKE_PYCOM_CTOR(PyIEnumMoniker); ! static PyComTypeObject type; static IEnumMoniker *GetI(PyObject *self); --- 8,12 ---- public: MAKE_PYCOM_CTOR(PyIEnumMoniker); ! static PyComEnumTypeObject type; static IEnumMoniker *GetI(PyObject *self); *************** *** 26,30 **** public: MAKE_PYCOM_CTOR(PyIMoniker); ! static PyComTypeObject type; static IMoniker *GetI(PyObject *self); --- 26,30 ---- public: MAKE_PYCOM_CTOR(PyIMoniker); ! static PyComEnumProviderTypeObject type; static IMoniker *GetI(PyObject *self); |
From: <mha...@us...> - 2003-11-02 09:55:30
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv3446/include Modified Files: PythonCOM.h Log Message: Fix iterators yet again. Drop the PyIEnum classes, and keep all the functionality in the new types. This means we can still be an enumerator even if we dont derive directly from PyIUnknown (eg, IMoniker) Index: PythonCOM.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PythonCOM.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** PythonCOM.h 2 Nov 2003 05:26:13 -0000 1.16 --- PythonCOM.h 2 Nov 2003 09:55:27 -0000 1.17 *************** *** 165,168 **** --- 165,169 ---- PyIUnknown* (* thector)(IUnknown *), const char *enum_method_name); + static PyObject *iter(PyObject *self); const char *enum_method_name; }; *************** *** 171,174 **** --- 172,177 ---- class PYCOM_EXPORT PyComEnumTypeObject : public PyComTypeObject { public: + static PyObject *iter(PyObject *self); + static PyObject *iternext(PyObject *self); PyComEnumTypeObject( const char *name, PyComTypeObject *pBaseType, int typeSize, struct PyMethodDef* methodList, PyIUnknown* (* thector)(IUnknown *) ); }; *************** *** 185,188 **** --- 188,195 ---- virtual PyObject *repr(); virtual int compare(PyObject *other) {return (int)this-int(other);} + // These iter are a little special, in that returning NULL means + // use the implementation in the type + virtual PyObject *iter() {return NULL;} + virtual PyObject *iternext() {return NULL;} static struct PyMethodDef PyIBase::empty_methods[]; protected: *************** *** 413,442 **** PyIUnknown(IUnknown *punk); ~PyIUnknown(); - }; - - ///////////////////////////////////////////////////////////////////////////// - // class PyIEnum - base for all Python interfaces implement IEnum* - class PYCOM_EXPORT PyIEnum : public PyIUnknown - { - protected: - PyIEnum(IUnknown *punk) : PyIUnknown(punk) {;} - public: - virtual PyObject *iter(); - virtual PyObject *iternext(); - static PyObject *iter(PyObject *self) {return ((PyIEnum *)self)->iter();} - static PyObject *iternext(PyObject *self) {return ((PyIEnum *)self)->iternext();} - - }; - - ///////////////////////////////////////////////////////////////////////////// - // class PyIEnum - base for all Python interfaces that can provide an - // IEnum* via a method - class PYCOM_EXPORT PyIEnumProvider : public PyIUnknown - { - protected: - PyIEnumProvider(IUnknown *punk) : PyIUnknown(punk) {;} - public: - virtual PyObject *iter(); - static PyObject *iter(PyObject *self) {return ((PyIEnumProvider *)self)->iter();} }; --- 420,423 ---- |
From: <mha...@us...> - 2003-11-02 09:55:30
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1:/tmp/cvs-serv3446 Modified Files: MiscTypes.cpp PyIBase.cpp Log Message: Fix iterators yet again. Drop the PyIEnum classes, and keep all the functionality in the new types. This means we can still be an enumerator even if we dont derive directly from PyIUnknown (eg, IMoniker) Index: MiscTypes.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/MiscTypes.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** MiscTypes.cpp 2 Nov 2003 05:26:13 -0000 1.6 --- MiscTypes.cpp 2 Nov 2003 09:55:27 -0000 1.7 *************** *** 113,122 **** PyComTypeObject( name, pBase, typeSize, methodList, thector) { ! tp_iter = PyIEnum::iter; ! tp_iternext = PyIEnum::iternext; tp_flags |= Py_TPFLAGS_HAVE_ITER; } ! // Our type for IEnum provider interfaces PyComEnumProviderTypeObject::PyComEnumProviderTypeObject( const char *name, --- 113,158 ---- PyComTypeObject( name, pBase, typeSize, methodList, thector) { ! tp_iter = iter; ! tp_iternext = iternext; tp_flags |= Py_TPFLAGS_HAVE_ITER; } ! // PyIEnum iter methods - generic for any "standard" COM IEnum interface, but ! // if the object provides a real one, we use it. ! PyObject *PyComEnumTypeObject::iter(PyObject *self) ! { ! assert(!PyErr_Occurred()); ! PyObject *rc = ((PyIBase *)self)->iter(); ! if (rc || PyErr_Occurred()) ! return rc; ! Py_INCREF(self); ! return self; ! } ! ! PyObject *PyComEnumTypeObject::iternext(PyObject *self) ! { ! PyObject *ret = ((PyIBase *)self)->iter(); ! if (ret || PyErr_Occurred()) ! return ret; ! PyObject *method = PyObject_GetAttrString(self, "Next"); ! if (!method) ! return NULL; ! PyObject *args=Py_BuildValue("(i)", 1); ! PyObject *result = PyObject_Call(method, args, NULL); ! Py_DECREF(method); ! Py_DECREF(args); ! if (!result) ! return NULL; ! if (PySequence_Length(result)==0){ ! PyErr_SetNone(PyExc_StopIteration); ! ret = NULL; ! } else ! ret = PySequence_GetItem(result, 0); ! Py_DECREF(result); ! return ret; ! } ! ! ! // Our type for IEnum provider interfaces PyComEnumProviderTypeObject::PyComEnumProviderTypeObject( const char *name, *************** *** 129,136 **** enum_method_name(penum_method_name) { ! tp_iter = PyIEnumProvider::iter; // tp_iternext remains NULL tp_flags |= Py_TPFLAGS_HAVE_ITER; } ///////////////////////////////////////////////////////////////////////////// --- 165,203 ---- enum_method_name(penum_method_name) { ! tp_iter = iter; // tp_iternext remains NULL tp_flags |= Py_TPFLAGS_HAVE_ITER; } + + // PyIEnumProvider iter methods - generic for COM object that can provide an IEnum* + // interface via a method call taking no args. + PyObject *PyComEnumProviderTypeObject::iter(PyObject *self) + { + PyObject *result = ((PyIBase *)self)->iter(); + if (result || PyErr_Occurred()) + return result; + PyComEnumProviderTypeObject *t = (PyComEnumProviderTypeObject *)self->ob_type; + PyObject *method = PyObject_GetAttrString(self, (char *)t->enum_method_name); + if (!method) + return NULL; + PyObject *args=PyTuple_New(0); + result = PyObject_Call(method, args, NULL); + Py_DECREF(method); + Py_DECREF(args); + if (result==Py_None) { + // If we returned None for the iterator (but there is + // no error) then we simulate an empty iterator + // Otherwise we get: + // TypeError: iter() returned non-iterator of type 'NoneType' + Py_DECREF(result); + PyObject *dummy = PyTuple_New(0); + if (!dummy) + return NULL; + result = PySeqIter_New(dummy); + Py_DECREF(dummy); + } + return result; + } + ///////////////////////////////////////////////////////////////////////////// Index: PyIBase.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyIBase.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** PyIBase.cpp 2 Nov 2003 05:26:13 -0000 1.6 --- PyIBase.cpp 2 Nov 2003 09:55:27 -0000 1.7 *************** *** 90,134 **** } - // PyIEnum iter methods - generic for any "standard" COM IEnum interface. - PyObject *PyIEnum::iter() - { - Py_INCREF(this); - return this; - } - - PyObject *PyIEnum::iternext() - { - PyObject *method = PyObject_GetAttrString(this, "Next"); - if (!method) - return NULL; - PyObject *args=Py_BuildValue("(i)", 1); - PyObject *result = PyObject_Call(method, args, NULL); - Py_DECREF(method); - Py_DECREF(args); - if (!result) - return NULL; - PyObject *ret; - if (PySequence_Length(result)==0){ - PyErr_SetNone(PyExc_StopIteration); - ret = NULL; - } else - ret = PySequence_GetItem(result, 0); - Py_DECREF(result); - return ret; - } - - // PyIEnumProvider iter methods - generic for COM object that can provide an IEnum* - // interface via a method call taking no args. - PyObject *PyIEnumProvider::iter() - { - PyComEnumProviderTypeObject *t = (PyComEnumProviderTypeObject *)ob_type; - PyObject *method = PyObject_GetAttrString(this, (char *)t->enum_method_name); - if (!method) - return NULL; - PyObject *args=PyTuple_New(0); - PyObject *result = PyObject_Call(method, args, NULL); - Py_DECREF(method); - Py_DECREF(args); - return result; - } - --- 90,91 ---- |
From: <mha...@us...> - 2003-11-02 09:52:55
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1:/tmp/cvs-serv3151 Modified Files: oleargs.cpp Log Message: Fix a bug in the safearray code, that testPyCOMTest failed with in 160/161 but due to a bug in the test suite, went unnoticed! Index: oleargs.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/oleargs.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** oleargs.cpp 24 Oct 2003 04:26:21 -0000 1.23 --- oleargs.cpp 2 Nov 2003 09:52:51 -0000 1.24 *************** *** 495,498 **** --- 495,503 ---- break; } + } else { + // it is a sequence, but has zero items - can't search + // any deeper for another dimension + Py_XDECREF(obItemCheck); + obItemCheck = NULL; } } else { |
From: <mha...@us...> - 2003-11-02 09:50:45
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1:/tmp/cvs-serv2751 Modified Files: PyIUnknown.cpp Log Message: If we failed create a return Python object for our COM object, we leaked a COM reference to the COM object. Index: PyIUnknown.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyIUnknown.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** PyIUnknown.cpp 31 Oct 2003 06:53:36 -0000 1.8 --- PyIUnknown.cpp 2 Nov 2003 09:50:42 -0000 1.9 *************** *** 233,237 **** if (pMyUnknown==NULL) return NULL; ! IUnknown *punk; PY_INTERFACE_PRECALL; HRESULT hr = pMyUnknown->QueryInterface(iid, (LPVOID*)&punk); --- 233,237 ---- if (pMyUnknown==NULL) return NULL; ! IUnknown *punk = NULL; PY_INTERFACE_PRECALL; HRESULT hr = pMyUnknown->QueryInterface(iid, (LPVOID*)&punk); *************** *** 239,247 **** /* Note that this failure may include E_NOINTERFACE */ ! if ( FAILED(hr) ) return PyCom_BuildPyException(hr, pMyUnknown, IID_IUnknown); ! /* Return a type based on the IID (with no extra ref) */ ! PyObject *rc = PyCom_PyObjectFromIUnknown(punk, iid, FALSE); /* we may have been asked to use a different interface */ --- 239,250 ---- /* Note that this failure may include E_NOINTERFACE */ ! if ( FAILED(hr) || punk==NULL) return PyCom_BuildPyException(hr, pMyUnknown, IID_IUnknown); ! /* Return a type based on the IID. Note we can't ask PyCom_PyObjectFromIUnknown ! to own the reference, as we expect failure - and this will release our reference, ! which means we can't try again. So a new ref is added should they work. ! */ ! PyObject *rc = PyCom_PyObjectFromIUnknown(punk, iid, TRUE); /* we may have been asked to use a different interface */ *************** *** 249,253 **** { PyErr_Clear(); ! rc = PyCom_PyObjectFromIUnknown(punk, useIID, FALSE); } return rc; --- 252,261 ---- { PyErr_Clear(); ! rc = PyCom_PyObjectFromIUnknown(punk, useIID, TRUE); ! } ! { ! PY_INTERFACE_PRECALL; ! punk->Release(); ! PY_INTERFACE_POSTCALL; } return rc; |
From: <mha...@us...> - 2003-11-02 09:48:16
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src In directory sc8-pr-cvs1:/tmp/cvs-serv2481 Modified Files: PyComHelpers.cpp Log Message: If PyCom_PyObjectFromIUnknown() failed and we have been asked to own the COM reference, release the reference. Index: PyComHelpers.cpp =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/PyComHelpers.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyComHelpers.cpp 31 Oct 2003 09:36:52 -0000 1.5 --- PyComHelpers.cpp 2 Nov 2003 09:48:13 -0000 1.6 *************** *** 66,69 **** --- 66,80 ---- } + // If PyCom_PyObjectFromIUnknown is called with bAddRef==FALSE, the + // caller is asking us to take ownership of the COM reference. If we + // fail to create a Python object, we must release the reference. + #define POFIU_RELEASE_ON_FAILURE \ + if (!bAddRef) { \ + PY_INTERFACE_PRECALL; \ + punk->Release(); \ + PY_INTERFACE_POSTCALL; \ + } + + // Interface conversions PyObject *PyCom_PyObjectFromIUnknown(IUnknown *punk, REFIID riid, BOOL bAddRef /* = FALSE */) *************** *** 84,87 **** --- 95,99 ---- PyErr_Clear(); PyErr_SetString(PyExc_TypeError, "There is no interface object registered that supports this IID"); + POFIU_RELEASE_ON_FAILURE return NULL; } *************** *** 90,93 **** --- 102,106 ---- if ( !PyComTypeObject::is_interface_type(createType) ) { PyErr_SetString(PyExc_TypeError, "The Python IID map is invalid - the value is not an interface type object"); + POFIU_RELEASE_ON_FAILURE return NULL; } *************** *** 97,100 **** --- 110,114 ---- if (myCreateType->ctor==NULL) { PyErr_SetString(PyExc_TypeError, "The type does not declare a PyCom constructor"); + POFIU_RELEASE_ON_FAILURE return NULL; } |
From: <mha...@us...> - 2003-11-02 05:26:39
|
Update of /cvsroot/pywin32/pywin32/com/win32com/src/include In directory sc8-pr-cvs1:/tmp/cvs-serv5588/include Modified Files: PyIEnumConnectionPoints.h PyIEnumConnections.h PyIEnumFORMATETC.h PyIEnumGUID.h PyIEnumSTATPROPSETSTG.h PyIEnumSTATPROPSTG.h PyIEnumSTATSTG.h PyIEnumVARIANT.h PyIPropertySetStorage.h PyIPropertyStorage.h PythonCOM.h Log Message: Roger inspired me to do tp_iter support in a far more generic way. Should be possible to make all Enums and Providers support tp_iter() simply by declaring the correct type - no implementation of the iter()/iternext() should be necessary. All enums in the core package should now support Enums correctly (a few more could possibly be nominated as Enum providers though. Index: PyIEnumConnectionPoints.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumConnectionPoints.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIEnumConnectionPoints.h 24 Nov 1999 10:04:11 -0000 1.1 --- PyIEnumConnectionPoints.h 2 Nov 2003 05:26:13 -0000 1.2 *************** *** 5,14 **** // Interface Declaration ! class PyIEnumConnectionPoints : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIEnumConnectionPoints); static IEnumConnectionPoints *GetI(PyObject *self); ! static PyComTypeObject type; // The Python methods --- 5,14 ---- // Interface Declaration ! class PyIEnumConnectionPoints : public PyIEnum { public: MAKE_PYCOM_CTOR(PyIEnumConnectionPoints); static IEnumConnectionPoints *GetI(PyObject *self); ! static PyComEnumTypeObject type; // The Python methods Index: PyIEnumConnections.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumConnections.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIEnumConnections.h 1 Sep 1999 23:04:13 -0000 1.1 --- PyIEnumConnections.h 2 Nov 2003 05:26:13 -0000 1.2 *************** *** 5,14 **** // Interface Declaration ! class PyIEnumConnections : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIEnumConnections); static IEnumConnections *GetI(PyObject *self); ! static PyComTypeObject type; // The Python methods --- 5,14 ---- // Interface Declaration ! class PyIEnumConnections : public PyIEnum { public: MAKE_PYCOM_CTOR(PyIEnumConnections); static IEnumConnections *GetI(PyObject *self); ! static PyComEnumTypeObject type; // The Python methods Index: PyIEnumFORMATETC.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumFORMATETC.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** PyIEnumFORMATETC.h 31 Oct 2003 06:55:13 -0000 1.4 --- PyIEnumFORMATETC.h 2 Nov 2003 05:26:13 -0000 1.5 *************** *** 5,9 **** // Interface Declaration ! class PyIEnumFORMATETC : public PyIUnknown { public: --- 5,9 ---- // Interface Declaration ! class PyIEnumFORMATETC : public PyIEnum { public: *************** *** 11,17 **** static IEnumFORMATETC *GetI(PyObject *self); static PyComEnumTypeObject type; - - virtual PyObject *iter(); - virtual PyObject *iternext(); // The Python methods --- 11,14 ---- Index: PyIEnumGUID.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumGUID.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIEnumGUID.h 1 Sep 1999 23:04:13 -0000 1.1 --- PyIEnumGUID.h 2 Nov 2003 05:26:13 -0000 1.2 *************** *** 2,10 **** // class PyIEnumGUID #ifndef NO_PYCOM_IENUMGUID ! class PyIEnumGUID : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIEnumGUID); ! static PyComTypeObject type; static IEnumGUID *GetI(PyObject *self); --- 2,10 ---- // class PyIEnumGUID #ifndef NO_PYCOM_IENUMGUID ! class PyIEnumGUID : public PyIEnum { public: MAKE_PYCOM_CTOR(PyIEnumGUID); ! static PyComEnumTypeObject type; static IEnumGUID *GetI(PyObject *self); *************** *** 23,31 **** // class PyIEnumCATEGORYINFO #ifndef NO_PYCOM_IENUMCATEGORYINFO ! class PyIEnumCATEGORYINFO : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIEnumCATEGORYINFO); ! static PyComTypeObject type; static IEnumCATEGORYINFO *GetI(PyObject *self); --- 23,31 ---- // class PyIEnumCATEGORYINFO #ifndef NO_PYCOM_IENUMCATEGORYINFO ! class PyIEnumCATEGORYINFO : public PyIEnum { public: MAKE_PYCOM_CTOR(PyIEnumCATEGORYINFO); ! static PyComEnumTypeObject type; static IEnumCATEGORYINFO *GetI(PyObject *self); Index: PyIEnumSTATPROPSETSTG.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumSTATPROPSETSTG.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIEnumSTATPROPSETSTG.h 30 Oct 2003 06:30:38 -0000 1.1 --- PyIEnumSTATPROPSETSTG.h 2 Nov 2003 05:26:13 -0000 1.2 *************** *** 2,12 **** ! class PyIEnumSTATPROPSETSTG : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIEnumSTATPROPSETSTG); static IEnumSTATPROPSETSTG *GetI(PyObject *self); ! static PyComTypeObject type; ! // The Python methods static PyObject *Next(PyObject *self, PyObject *args); --- 2,11 ---- ! class PyIEnumSTATPROPSETSTG : public PyIEnum { public: MAKE_PYCOM_CTOR(PyIEnumSTATPROPSETSTG); static IEnumSTATPROPSETSTG *GetI(PyObject *self); ! static PyComEnumTypeObject type; // The Python methods static PyObject *Next(PyObject *self, PyObject *args); Index: PyIEnumSTATPROPSTG.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumSTATPROPSTG.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIEnumSTATPROPSTG.h 1 Sep 1999 23:04:13 -0000 1.1 --- PyIEnumSTATPROPSTG.h 2 Nov 2003 05:26:13 -0000 1.2 *************** *** 5,14 **** // Interface Declaration ! class PyIEnumSTATPROPSTG : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIEnumSTATPROPSTG); static IEnumSTATPROPSTG *GetI(PyObject *self); ! static PyComTypeObject type; // The Python methods --- 5,14 ---- // Interface Declaration ! class PyIEnumSTATPROPSTG : public PyIEnum { public: MAKE_PYCOM_CTOR(PyIEnumSTATPROPSTG); static IEnumSTATPROPSTG *GetI(PyObject *self); ! static PyComEnumTypeObject type; // The Python methods Index: PyIEnumSTATSTG.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumSTATSTG.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIEnumSTATSTG.h 1 Sep 1999 23:04:13 -0000 1.1 --- PyIEnumSTATSTG.h 2 Nov 2003 05:26:13 -0000 1.2 *************** *** 5,14 **** // Interface Declaration ! class PyIEnumSTATSTG : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIEnumSTATSTG); static IEnumSTATSTG *GetI(PyObject *self); ! static PyComTypeObject type; // The Python methods --- 5,14 ---- // Interface Declaration ! class PyIEnumSTATSTG : public PyIEnum { public: MAKE_PYCOM_CTOR(PyIEnumSTATSTG); static IEnumSTATSTG *GetI(PyObject *self); ! static PyComEnumTypeObject type; // The Python methods Index: PyIEnumVARIANT.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIEnumVARIANT.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** PyIEnumVARIANT.h 31 Oct 2003 06:55:13 -0000 1.5 --- PyIEnumVARIANT.h 2 Nov 2003 05:26:13 -0000 1.6 *************** *** 5,9 **** #include "PythonCOMServer.h" ! class PYCOM_EXPORT PyIEnumVARIANT : public PyIUnknown { public: --- 5,9 ---- #include "PythonCOMServer.h" ! class PYCOM_EXPORT PyIEnumVARIANT : public PyIEnum { public: *************** *** 11,17 **** static IEnumVARIANT *GetI(PyObject *self); static PyComEnumTypeObject type; - - virtual PyObject *iter(); - virtual PyObject *iternext(); // The Python methods --- 11,14 ---- Index: PyIPropertySetStorage.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIPropertySetStorage.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIPropertySetStorage.h 1 Sep 1999 23:04:14 -0000 1.1 --- PyIPropertySetStorage.h 2 Nov 2003 05:26:13 -0000 1.2 *************** *** 5,14 **** // Interface Declaration ! class PyIPropertySetStorage : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIPropertySetStorage); static IPropertySetStorage *GetI(PyObject *self); ! static PyComTypeObject type; // The Python methods --- 5,14 ---- // Interface Declaration ! class PyIPropertySetStorage : public PyIEnumProvider { public: MAKE_PYCOM_CTOR(PyIPropertySetStorage); static IPropertySetStorage *GetI(PyObject *self); ! static PyComEnumProviderTypeObject type; // The Python methods *************** *** 17,21 **** static PyObject *Delete(PyObject *self, PyObject *args); static PyObject *Enum(PyObject *self, PyObject *args); - protected: PyIPropertySetStorage(IUnknown *pdisp); --- 17,20 ---- Index: PyIPropertyStorage.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PyIPropertyStorage.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** PyIPropertyStorage.h 1 Sep 1999 23:04:14 -0000 1.1 --- PyIPropertyStorage.h 2 Nov 2003 05:26:13 -0000 1.2 *************** *** 5,14 **** // Interface Declaration ! class PyIPropertyStorage : public PyIUnknown { public: MAKE_PYCOM_CTOR(PyIPropertyStorage); static IPropertyStorage *GetI(PyObject *self); ! static PyComTypeObject type; // The Python methods --- 5,14 ---- // Interface Declaration ! class PyIPropertyStorage : public PyIEnumProvider { public: MAKE_PYCOM_CTOR(PyIPropertyStorage); static IPropertyStorage *GetI(PyObject *self); ! static PyComEnumProviderTypeObject type; // The Python methods Index: PythonCOM.h =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/src/include/PythonCOM.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** PythonCOM.h 31 Oct 2003 11:42:03 -0000 1.15 --- PythonCOM.h 2 Nov 2003 05:26:13 -0000 1.16 *************** *** 159,163 **** class PYCOM_EXPORT PyComEnumProviderTypeObject : public PyComTypeObject { public: ! PyComEnumProviderTypeObject( const char *name, PyComTypeObject *pBaseType, int typeSize, struct PyMethodDef* methodList, PyIUnknown* (* thector)(IUnknown *) ); }; --- 159,169 ---- class PYCOM_EXPORT PyComEnumProviderTypeObject : public PyComTypeObject { public: ! PyComEnumProviderTypeObject( const char *name, ! PyComTypeObject *pBaseType, ! int typeSize, ! struct PyMethodDef* methodList, ! PyIUnknown* (* thector)(IUnknown *), ! const char *enum_method_name); ! const char *enum_method_name; }; *************** *** 179,185 **** virtual PyObject *repr(); virtual int compare(PyObject *other) {return (int)this-int(other);} - virtual PyObject *iter(); - virtual PyObject *iternext(); - static struct PyMethodDef PyIBase::empty_methods[]; protected: --- 185,188 ---- *************** *** 195,200 **** static int setattr(PyObject *op, char *name, PyObject *v); static int cmp(PyObject *ob1, PyObject *ob2); - static PyObject *iter(PyObject *self); - static PyObject *iternext(PyObject *self); }; --- 198,201 ---- *************** *** 414,417 **** --- 415,443 ---- }; + ///////////////////////////////////////////////////////////////////////////// + // class PyIEnum - base for all Python interfaces implement IEnum* + class PYCOM_EXPORT PyIEnum : public PyIUnknown + { + protected: + PyIEnum(IUnknown *punk) : PyIUnknown(punk) {;} + public: + virtual PyObject *iter(); + virtual PyObject *iternext(); + static PyObject *iter(PyObject *self) {return ((PyIEnum *)self)->iter();} + static PyObject *iternext(PyObject *self) {return ((PyIEnum *)self)->iternext();} + + }; + + ///////////////////////////////////////////////////////////////////////////// + // class PyIEnum - base for all Python interfaces that can provide an + // IEnum* via a method + class PYCOM_EXPORT PyIEnumProvider : public PyIUnknown + { + protected: + PyIEnumProvider(IUnknown *punk) : PyIUnknown(punk) {;} + public: + virtual PyObject *iter(); + static PyObject *iter(PyObject *self) {return ((PyIEnumProvider *)self)->iter();} + }; ///////////////////////////////////////////////////////////////////////////// |