Update of /cvsroot/pywin32/pywin32/com/win32com/client
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15452
Modified Files:
genpy.py util.py
Log Message:
Pass the CLSID of the items in an interator. Via
[ 1707700 ] Iterator is missing automatic cast
Index: genpy.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/genpy.py,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -d -r1.51 -r1.52
*** genpy.py 7 Feb 2007 23:12:31 -0000 1.51
--- genpy.py 24 May 2007 13:00:03 -0000 1.52
***************
*** 507,511 ****
print >> stream, '\t\t"Return a Python iterator for this object"'
print >> stream, '\t\tob = self._oleobj_.InvokeTypes(%d,LCID,%d,(13, 10),())' % (pythoncom.DISPID_NEWENUM, enumEntry.desc[4])
! print >> stream, '\t\treturn win32com.client.util.Iterator(ob)'
# And 'old style' iterator support - magically used to simulate iterators
# before Python grew them
--- 507,511 ----
print >> stream, '\t\t"Return a Python iterator for this object"'
print >> stream, '\t\tob = self._oleobj_.InvokeTypes(%d,LCID,%d,(13, 10),())' % (pythoncom.DISPID_NEWENUM, enumEntry.desc[4])
! print >> stream, '\t\treturn win32com.client.util.Iterator(ob, %s)' % resultCLSID
# And 'old style' iterator support - magically used to simulate iterators
# before Python grew them
Index: util.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/util.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** util.py 23 Oct 2003 07:14:19 -0000 1.2
--- util.py 24 May 2007 13:00:03 -0000 1.3
***************
*** 76,83 ****
class Iterator:
! def __init__(self, enum):
self._iter_ = iter(enum.QueryInterface(pythoncom.IID_IEnumVARIANT))
def __iter__(self):
return self
def next(self):
! return _get_good_object_(self._iter_.next())
--- 76,84 ----
class Iterator:
! def __init__(self, enum, resultCLSID = None):
! self.resultCLSID = resultCLSID
self._iter_ = iter(enum.QueryInterface(pythoncom.IID_IEnumVARIANT))
def __iter__(self):
return self
def next(self):
! return _get_good_object_(self._iter_.next(), resultCLSID = self.resultCLSID)
|