Update of /cvsroot/pywin32/pywin32/com/win32com/client
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18082/com/win32com/client
Modified Files:
dynamic.py genpy.py
Log Message:
more moderizations merged from py3k work
Index: genpy.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/genpy.py,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -d -r1.58 -r1.59
*** genpy.py 27 Nov 2008 03:53:25 -0000 1.58
--- genpy.py 27 Nov 2008 09:33:22 -0000 1.59
***************
*** 878,883 ****
if self.generate_type == GEN_FULL:
! items = oleItems.values()
! items = [l for l in items if l is not None]
items.sort()
for oleitem in items:
--- 878,882 ----
if self.generate_type == GEN_FULL:
! items = [l for l in oleItems.itervalues() if l is not None]
items.sort()
for oleitem in items:
***************
*** 905,909 ****
if self.generate_type == GEN_FULL:
print >> stream, 'CLSIDToClassMap = {'
! for item in oleItems.values():
if item is not None and item.bWritten:
print >> stream, "\t'%s' : %s," % (str(item.clsid), item.python_name)
--- 904,908 ----
if self.generate_type == GEN_FULL:
print >> stream, 'CLSIDToClassMap = {'
! for item in oleItems.itervalues():
if item is not None and item.bWritten:
print >> stream, "\t'%s' : %s," % (str(item.clsid), item.python_name)
***************
*** 913,917 ****
print >> stream, "VTablesToPackageMap = {}"
print >> stream, "VTablesToClassMap = {"
! for item in vtableItems.values():
print >> stream, "\t'%s' : '%s'," % (item.clsid,item.python_name)
print >> stream, '}'
--- 912,916 ----
print >> stream, "VTablesToPackageMap = {}"
print >> stream, "VTablesToClassMap = {"
! for item in vtableItems.itervalues():
print >> stream, "\t'%s' : '%s'," % (item.clsid,item.python_name)
print >> stream, '}'
***************
*** 921,925 ****
print >> stream, 'CLSIDToClassMap = {}'
print >> stream, 'CLSIDToPackageMap = {'
! for item in oleItems.values():
if item is not None:
print >> stream, "\t'%s' : %s," % (str(item.clsid), repr(item.python_name))
--- 920,924 ----
print >> stream, 'CLSIDToClassMap = {}'
print >> stream, 'CLSIDToPackageMap = {'
! for item in oleItems.itervalues():
if item is not None:
print >> stream, "\t'%s' : %s," % (str(item.clsid), repr(item.python_name))
***************
*** 927,931 ****
print >> stream, "VTablesToClassMap = {}"
print >> stream, "VTablesToPackageMap = {"
! for item in vtableItems.values():
print >> stream, "\t'%s' : '%s'," % (item.clsid,item.python_name)
print >> stream, '}'
--- 926,930 ----
print >> stream, "VTablesToClassMap = {}"
print >> stream, "VTablesToPackageMap = {"
! for item in vtableItems.itervalues():
print >> stream, "\t'%s' : '%s'," % (item.clsid,item.python_name)
print >> stream, '}'
***************
*** 935,942 ****
# Bit of a hack - build a temp map of iteItems + vtableItems - coClasses
map = {}
! for item in oleItems.values():
if item is not None and not isinstance(item, CoClassItem):
map[item.python_name] = item.clsid
! for item in vtableItems.values(): # No nones or CoClasses in this map
map[item.python_name] = item.clsid
--- 934,941 ----
# Bit of a hack - build a temp map of iteItems + vtableItems - coClasses
map = {}
! for item in oleItems.itervalues():
if item is not None and not isinstance(item, CoClassItem):
map[item.python_name] = item.clsid
! for item in vtableItems.itervalues(): # No nones or CoClasses in this map
map[item.python_name] = item.clsid
***************
*** 1011,1015 ****
self.progress.SetDescription("Generating...", len(items))
! for oleitem, vtableitem in items.values():
an_item = oleitem or vtableitem
assert not self.file, "already have a file?"
--- 1010,1014 ----
self.progress.SetDescription("Generating...", len(items))
! for oleitem, vtableitem in items.itervalues():
an_item = oleitem or vtableitem
assert not self.file, "already have a file?"
Index: dynamic.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/dynamic.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** dynamic.py 26 Nov 2008 01:38:42 -0000 1.25
--- dynamic.py 27 Nov 2008 09:33:22 -0000 1.26
***************
*** 74,82 ****
dispatchType = pythoncom.TypeIIDs[pythoncom.IID_IDispatch]
iunkType = pythoncom.TypeIIDs[pythoncom.IID_IUnknown]
! _GoodDispatchType=[str, IIDType, unicode]
_defaultDispatchItem=build.DispatchItem
def _GetGoodDispatch(IDispatch, clsctx = pythoncom.CLSCTX_SERVER):
! if type(IDispatch) in _GoodDispatchType:
try:
IDispatch = pythoncom.connect(IDispatch)
--- 74,82 ----
dispatchType = pythoncom.TypeIIDs[pythoncom.IID_IDispatch]
iunkType = pythoncom.TypeIIDs[pythoncom.IID_IUnknown]
! _GoodDispatchTypes=[str, IIDType, unicode]
_defaultDispatchItem=build.DispatchItem
def _GetGoodDispatch(IDispatch, clsctx = pythoncom.CLSCTX_SERVER):
! if type(IDispatch) in _GoodDispatchTypes:
try:
IDispatch = pythoncom.connect(IDispatch)
|