Update of /cvsroot/pywin32/pywin32/com/win32com/client
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv25938/com/win32com/client
Modified Files:
Tag: py3k
__init__.py combrowse.py dynamic.py gencache.py genpy.py
makepy.py
Log Message:
merge lots of fixes from the trunk
Index: makepy.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/makepy.py,v
retrieving revision 1.25.2.4
retrieving revision 1.25.2.5
diff -C2 -d -r1.25.2.4 -r1.25.2.5
*** makepy.py 26 Nov 2008 07:17:39 -0000 1.25.2.4
--- makepy.py 27 Nov 2008 11:31:04 -0000 1.25.2.5
***************
*** 68,75 ****
import sys, os, pythoncom
! from win32com.client import genpy
!
! from . import selecttlb
! from . import gencache
from win32com.client import NeedUnicodeConversions, Dispatch
--- 68,72 ----
import sys, os, pythoncom
! from win32com.client import genpy, selecttlb, gencache
from win32com.client import NeedUnicodeConversions, Dispatch
Index: dynamic.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/dynamic.py,v
retrieving revision 1.22.2.5
retrieving revision 1.22.2.6
diff -C2 -d -r1.22.2.5 -r1.22.2.6
*** dynamic.py 26 Nov 2008 09:05:11 -0000 1.22.2.5
--- dynamic.py 27 Nov 2008 11:31:04 -0000 1.22.2.6
***************
*** 24,28 ****
from . import build
-
from pywintypes import IIDType
--- 24,27 ----
***************
*** 75,79 ****
dispatchType = pythoncom.TypeIIDs[pythoncom.IID_IDispatch]
iunkType = pythoncom.TypeIIDs[pythoncom.IID_IUnknown]
! _GoodDispatchTypes=(str, IIDType, str)
_defaultDispatchItem=build.DispatchItem
--- 74,78 ----
dispatchType = pythoncom.TypeIIDs[pythoncom.IID_IDispatch]
iunkType = pythoncom.TypeIIDs[pythoncom.IID_IUnknown]
! _GoodDispatchTypes=[str, IIDType, str]
_defaultDispatchItem=build.DispatchItem
***************
*** 320,324 ****
"""Cleanup object - like a close - to force cleanup when you dont
want to rely on Python's reference counting."""
! for childCont in self._mapCachedItems_.itervalues():
childCont._Release_()
self._mapCachedItems_ = {}
--- 319,323 ----
"""Cleanup object - like a close - to force cleanup when you dont
want to rely on Python's reference counting."""
! for childCont in self._mapCachedItems_.values():
childCont._Release_()
self._mapCachedItems_ = {}
***************
*** 345,358 ****
try:
print("Methods:")
! for method in list(self._olerepr_.mapFuncs.keys()):
print("\t", method)
print("Props:")
! for prop, entry in list(self._olerepr_.propMap.items()):
print("\t%s = 0x%x - %s" % (prop, entry.dispid, repr(entry)))
print("Get Props:")
! for prop, entry in list(self._olerepr_.propMapGet.items()):
print("\t%s = 0x%x - %s" % (prop, entry.dispid, repr(entry)))
print("Put Props:")
! for prop, entry in list(self._olerepr_.propMapPut.items()):
print("\t%s = 0x%x - %s" % (prop, entry.dispid, repr(entry)))
except:
--- 344,357 ----
try:
print("Methods:")
! for method in self._olerepr_.mapFuncs.keys():
print("\t", method)
print("Props:")
! for prop, entry in self._olerepr_.propMap.items():
print("\t%s = 0x%x - %s" % (prop, entry.dispid, repr(entry)))
print("Get Props:")
! for prop, entry in self._olerepr_.propMapGet.items():
print("\t%s = 0x%x - %s" % (prop, entry.dispid, repr(entry)))
print("Put Props:")
! for prop, entry in self._olerepr_.propMapPut.items():
print("\t%s = 0x%x - %s" % (prop, entry.dispid, repr(entry)))
except:
Index: combrowse.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/combrowse.py,v
retrieving revision 1.8.2.3
retrieving revision 1.8.2.4
diff -C2 -d -r1.8.2.3 -r1.8.2.4
*** combrowse.py 26 Nov 2008 09:03:29 -0000 1.8.2.3
--- combrowse.py 27 Nov 2008 11:31:04 -0000 1.8.2.4
***************
*** 520,524 ****
from pywin.tools import hierlist
root = HLIRoot("COM Browser")
! if sys.modules.has_key("app"):
# do it in a window
browser.MakeTemplate()
--- 520,524 ----
from pywin.tools import hierlist
root = HLIRoot("COM Browser")
! if "app" in sys.modules:
# do it in a window
browser.MakeTemplate()
Index: __init__.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/__init__.py,v
retrieving revision 1.34.4.4
retrieving revision 1.34.4.5
diff -C2 -d -r1.34.4.4 -r1.34.4.5
*** __init__.py 26 Nov 2008 07:17:39 -0000 1.34.4.4
--- __init__.py 27 Nov 2008 11:31:04 -0000 1.34.4.5
***************
*** 11,15 ****
import pythoncom
! from . import dynamic, gencache
import sys
import pywintypes
--- 11,16 ----
import pythoncom
! from . import dynamic
! from . import gencache
import sys
import pywintypes
Index: genpy.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/genpy.py,v
retrieving revision 1.55.2.5
retrieving revision 1.55.2.6
diff -C2 -d -r1.55.2.5 -r1.55.2.6
*** genpy.py 27 Nov 2008 05:36:19 -0000 1.55.2.5
--- genpy.py 27 Nov 2008 11:31:04 -0000 1.55.2.6
***************
*** 211,223 ****
if vdesc[4] == pythoncom.VAR_CONST:
val = vdesc[1]
! if sys.version_info <= (2,4) and (isinstance(val, int) or isinstance(val, long)):
if val==0x80000000: # special case
use = "0x80000000L" # 'L' for future warning
elif val > 0x80000000 or val < 0: # avoid a FutureWarning
! use = long(val)
else:
use = hex(val)
else:
! use = repr(str(val))
print("\t%-30s=%-10s # from enum %s" % \
(build.MakePublicAttributeName(name, True), use, enumName), file=stream)
--- 211,223 ----
if vdesc[4] == pythoncom.VAR_CONST:
val = vdesc[1]
! if sys.version_info <= (2,4) and (isinstance(val, int) or isinstance(val, int)):
if val==0x80000000: # special case
use = "0x80000000L" # 'L' for future warning
elif val > 0x80000000 or val < 0: # avoid a FutureWarning
! use = int(val)
else:
use = hex(val)
else:
! use = repr(val)
print("\t%-30s=%-10s # from enum %s" % \
(build.MakePublicAttributeName(name, True), use, enumName), file=stream)
***************
*** 821,825 ****
encoding = self.file.encoding # or "mbcs"
! print('# -*- coding: mbcs -*-', file=self.file) # Is this always correct?
print('# Created by makepy.py version %s' % (makepy_version,), file=self.file)
print('# By python version %s' % \
--- 821,825 ----
encoding = self.file.encoding # or "mbcs"
! print('# -*- coding: %s -*-' % (encoding,), file=self.file)
print('# Created by makepy.py version %s' % (makepy_version,), file=self.file)
print('# By python version %s' % \
***************
*** 832,839 ****
print('makepy_version =', repr(makepy_version), file=self.file)
! try:
! print('python_version = 0x%x' % (sys.hexversion,), file=self.file)
! except AttributeError:
! print('python_version = 0x0 # Presumably Python 1.5.2 - 0x0 is not a problem', file=self.file)
print(file=self.file)
print('import win32com.client.CLSIDToClass, pythoncom', file=self.file)
--- 832,836 ----
print('makepy_version =', repr(makepy_version), file=self.file)
! print('python_version = 0x%x' % (sys.hexversion,), file=self.file)
print(file=self.file)
print('import win32com.client.CLSIDToClass, pythoncom', file=self.file)
***************
*** 873,879 ****
if enumItems:
print("class constants:", file=stream)
! values = list(enumItems.values())
! values.sort()
! for oleitem in values:
oleitem.WriteEnumerationItems(stream)
self.progress.Tick()
--- 870,876 ----
if enumItems:
print("class constants:", file=stream)
! items = list(enumItems.values())
! items.sort()
! for oleitem in items:
oleitem.WriteEnumerationItems(stream)
self.progress.Tick()
***************
*** 881,893 ****
if self.generate_type == GEN_FULL:
! values = [v for v in oleItems.values() if v is not None]
! values.sort()
! for oleitem in values:
self.progress.Tick()
oleitem.WriteClass(self)
! values = list(vtableItems.values())
! values.sort()
! for oleitem in values:
self.progress.Tick()
oleitem.WriteClass(self)
--- 878,890 ----
if self.generate_type == GEN_FULL:
! items = [l for l in oleItems.values() if l is not None]
! items.sort()
! for oleitem in items:
self.progress.Tick()
oleitem.WriteClass(self)
! items = list(vtableItems.values())
! items.sort()
! for oleitem in items:
self.progress.Tick()
oleitem.WriteClass(self)
Index: gencache.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/gencache.py,v
retrieving revision 1.32.2.3
retrieving revision 1.32.2.4
diff -C2 -d -r1.32.2.3 -r1.32.2.4
*** gencache.py 27 Nov 2008 05:36:19 -0000 1.32.2.3
--- gencache.py 27 Nov 2008 11:31:04 -0000 1.32.2.4
***************
*** 584,588 ****
zip_pos = win32com.__gen_path__.find(".zip\\")
if zip_pos >= 0:
! import zipfile, io
zip_file = win32com.__gen_path__[:zip_pos+4]
zip_path = win32com.__gen_path__[zip_pos+5:].replace("\\", "/")
--- 584,588 ----
zip_pos = win32com.__gen_path__.find(".zip\\")
if zip_pos >= 0:
! import zipfile
zip_file = win32com.__gen_path__[:zip_pos+4]
zip_path = win32com.__gen_path__[zip_pos+5:].replace("\\", "/")
|