Update of /cvsroot/pywin32/pywin32/com/win32com/client
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv4261/com/win32com/client
Modified Files:
Tag: py3k
__init__.py build.py genpy.py selecttlb.py
Log Message:
merge lots of changes (most via 2to3) from the trunk
Index: genpy.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/genpy.py,v
retrieving revision 1.55.2.7
retrieving revision 1.55.2.8
diff -C2 -d -r1.55.2.7 -r1.55.2.8
*** genpy.py 4 Dec 2008 05:08:41 -0000 1.55.2.7
--- genpy.py 5 Jan 2009 12:51:26 -0000 1.55.2.8
***************
*** 205,211 ****
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:
--- 205,211 ----
val = vdesc[1]
if sys.version_info <= (2,4) and (isinstance(val, int) or isinstance(val, int)):
! if val==0x80000000-1+1: # special case for py2.3 (and avoid 'L' syntax for py3k)
use = "0x80000000L" # 'L' for future warning
! elif val > 0x80000000-1+1 or val < 0: # avoid a FutureWarning
use = int(val)
else:
Index: selecttlb.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/selecttlb.py,v
retrieving revision 1.10.2.2
retrieving revision 1.10.2.3
diff -C2 -d -r1.10.2.2 -r1.10.2.3
*** selecttlb.py 31 Aug 2008 18:22:15 -0000 1.10.2.2
--- selecttlb.py 5 Jan 2009 12:51:26 -0000 1.10.2.3
***************
*** 32,35 ****
--- 32,37 ----
rc = cmp(self.major, other.minor)
return rc
+ def __lt__(self, other): # rich-cmp/py3k-friendly version
+ return self.__cmp__(other) < 0
def Resolve(self):
***************
*** 139,145 ****
return ret
- def tlb_sort_key(tlb_item):
- return tlb_item.ver_desc
-
def SelectTlb(title="Select Library", excludeFlags = 0):
"""Display a list of all the type libraries, and select one. Returns None if cancelled
--- 141,144 ----
***************
*** 151,155 ****
i.major = int(i.major, 16)
i.minor = int(i.minor, 16)
! items.sort(key=tlb_sort_key)
rc = pywin.dialogs.list.SelectFromLists(title, items, ["Type Library"])
if rc is None:
--- 150,154 ----
i.major = int(i.major, 16)
i.minor = int(i.minor, 16)
! items.sort()
rc = pywin.dialogs.list.SelectFromLists(title, items, ["Type Library"])
if rc is None:
Index: __init__.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/__init__.py,v
retrieving revision 1.34.4.6
retrieving revision 1.34.4.7
diff -C2 -d -r1.34.4.6 -r1.34.4.7
*** __init__.py 4 Dec 2008 05:08:41 -0000 1.34.4.6
--- __init__.py 5 Jan 2009 12:51:26 -0000 1.34.4.7
***************
*** 448,451 ****
--- 448,455 ----
return cmp(self._oleobj_, other)
+ def __eq__(self, other):
+ other = getattr(other, "_oleobj_", other)
+ return self._oleobj_ == other
+
def _ApplyTypes_(self, dispid, wFlags, retType, argTypes, user, resultCLSID, *args):
return self._get_good_object_(
Index: build.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/build.py,v
retrieving revision 1.31.2.6
retrieving revision 1.31.2.7
diff -C2 -d -r1.31.2.6 -r1.31.2.7
*** build.py 4 Dec 2008 05:08:41 -0000 1.31.2.6
--- build.py 5 Jan 2009 12:51:26 -0000 1.31.2.7
***************
*** 19,23 ****
import sys
import string
- import builtins
from keyword import iskeyword
--- 19,22 ----
***************
*** 523,532 ****
return demunge_leading_underscores(className)
elif className == 'None':
! # assign to None is evil (and SyntaxError in 2.4) - note
! # that if it was a global it would get picked up below
className = 'NONE'
! elif iskeyword(className): # all keywords are lower case
! return className.capitalize()
! elif is_global and hasattr(builtins, className):
# builtins may be mixed case. If capitalizing it doesn't change it,
# force to all uppercase (eg, "None", "True" become "NONE", "TRUE"
--- 522,537 ----
return demunge_leading_underscores(className)
elif className == 'None':
! # assign to None is evil (and SyntaxError in 2.4, even though
! # iskeyword says False there) - note that if it was a global
! # it would get picked up below
className = 'NONE'
! elif iskeyword(className):
! # most keywords are lower case (except True, False etc in py3k)
! ret = className.capitalize()
! # but those which aren't get forced upper.
! if ret == className:
! ret = ret.upper()
! return ret
! elif is_global and hasattr(__builtins__, className):
# builtins may be mixed case. If capitalizing it doesn't change it,
# force to all uppercase (eg, "None", "True" become "NONE", "TRUE"
|