Update of /cvsroot/pywin32/pywin32/win32/Lib
In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv3631/win32/Lib
Modified Files:
Tag: py3k
win32timezone.py win32verstamp.py
Log Message:
merge various fixes and changes from the trunk
Index: win32verstamp.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32verstamp.py,v
retrieving revision 1.2.4.1
retrieving revision 1.2.4.2
diff -C2 -d -r1.2.4.1 -r1.2.4.2
*** win32verstamp.py 26 Nov 2008 09:03:30 -0000 1.2.4.1
--- win32verstamp.py 6 Dec 2008 01:48:26 -0000 1.2.4.2
***************
*** 2,7 ****
"""
! from win32api import BeginUpdateResource, UpdateResource, EndUpdateResource, Unicode
! U = Unicode
import os
--- 2,6 ----
"""
! from win32api import BeginUpdateResource, UpdateResource, EndUpdateResource
import os
***************
*** 16,19 ****
--- 15,19 ----
VOS_NT_WINDOWS32 = 0x00040004
+ null_byte = "\0".encode("ascii") # str in py2k, bytes in py3k
#
# Set VS_FF_PRERELEASE and DEBUG if Debug
***************
*** 47,54 ****
def nullterm(s):
! try:
! return buffer(unicode(s)) + "\0\0"
! except NameError: # No unicode builtin
! return U(s).raw + '\0\0'
def pad32(s, extra=2):
--- 47,52 ----
def nullterm(s):
! # get raw bytes for a NULL terminated unicode string.
! return (s + '\0').encode('unicode-internal')
def pad32(s, extra=2):
***************
*** 56,60 ****
l = 4 - ((len(s) + extra) & 3)
if l < 4:
! return s + ('\0' * l)
return s
--- 54,58 ----
l = 4 - ((len(s) + extra) & 3)
if l < 4:
! return s + (null_byte * l)
return s
Index: win32timezone.py
===================================================================
RCS file: /cvsroot/pywin32/pywin32/win32/Lib/win32timezone.py,v
retrieving revision 1.9.2.6
retrieving revision 1.9.2.7
diff -C2 -d -r1.9.2.6 -r1.9.2.7
*** win32timezone.py 4 Dec 2008 07:32:06 -0000 1.9.2.6
--- win32timezone.py 6 Dec 2008 01:48:26 -0000 1.9.2.7
***************
*** 116,122 ****
>>> isinstance(caps, dict)
True
! >>> caps.has_key('MissingTZPatch')
True
! >>> caps.has_key('DynamicTZSupport')
True
"""
--- 116,122 ----
>>> isinstance(caps, dict)
True
! >>> 'MissingTZPatch' in caps
True
! >>> 'DynamicTZSupport' in caps
True
"""
***************
*** 379,383 ****
def get_all_time_zones():
! return map(TimeZoneInfo, TimeZoneInfo._get_time_zone_key_names())
get_all_time_zones = staticmethod(get_all_time_zones)
--- 379,383 ----
def get_all_time_zones():
! return [TimeZoneInfo(n) for n in TimeZoneInfo._get_time_zone_key_names()]
get_all_time_zones = staticmethod(get_all_time_zones)
***************
*** 414,418 ****
values = _RegValueEnumerator(key)
values = tuple(values)
! return dict(map(lambda (name,value,type): (name,value), values))
# for backward compatibility
--- 414,418 ----
values = _RegValueEnumerator(key)
values = tuple(values)
! return dict([(name, value) for name,value,type in values])
# for backward compatibility
***************
*** 501,505 ****
"""Resolve a multilingual user interface resource for the time zone name
>>> result = resolveMUITimeZone('@tzres.dll,-110')
! >>> expectedResultType = [type(None),unicode][sys.getwindowsversion() >= (6,)]
>>> type(result) is expectedResultType
True
--- 501,506 ----
"""Resolve a multilingual user interface resource for the time zone name
>>> result = resolveMUITimeZone('@tzres.dll,-110')
! >>> str_type = type(''.encode('ascii').decode('ascii')) # 2to3 doesn't do docstrings yet!
! >>> expectedResultType = [type(None),str_type][sys.getwindowsversion() >= (6,)]
>>> type(result) is expectedResultType
True
|