[pywin32-checkins] pywin32/com/win32com/client build.py, 1.31.2.9, 1.31.2.10
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
|
From: Mark H. <mha...@us...> - 2009-01-27 07:55:37
|
Update of /cvsroot/pywin32/pywin32/com/win32com/client In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv18841/com/win32com/client Modified Files: Tag: py3k build.py Log Message: merge datetime changes from trunk (and other misc trunk changes) Index: build.py =================================================================== RCS file: /cvsroot/pywin32/pywin32/com/win32com/client/build.py,v retrieving revision 1.31.2.9 retrieving revision 1.31.2.10 diff -C2 -d -r1.31.2.9 -r1.31.2.10 *** build.py 25 Jan 2009 04:52:20 -0000 1.31.2.9 --- build.py 27 Jan 2009 07:55:31 -0000 1.31.2.10 *************** *** 24,27 **** --- 24,28 ---- from pywintypes import TimeType import winerror + import datetime # A string ending with a quote can not be safely triple-quoted. *************** *** 558,568 **** if inOut & pythoncom.PARAMFLAG_FHASDEFAULT: ! # hack for Unicode until it repr's better. val = defArgVal[2] if type(val) is TimeType: year=val.year; month=val.month; day=val.day; hour=val.hour; minute=val.minute; second=val.second; msec=val.msec return "pywintypes.Time((%(year)d, %(month)d, %(day)d, %(hour)d, %(minute)d, %(second)d,0,0,0,%(msec)d))" % locals() ! else: ! return repr(val) return None --- 559,573 ---- if inOut & pythoncom.PARAMFLAG_FHASDEFAULT: ! # times need special handling... val = defArgVal[2] + if isinstance(val, datetime.datetime): + # VARIANT <-> SYSTEMTIME conversions always lose any sub-second + # resolution, so just use a 'timetuple' here. + return repr(tuple(val.utctimetuple())) if type(val) is TimeType: + # must be the 'old' pywintypes time object... year=val.year; month=val.month; day=val.day; hour=val.hour; minute=val.minute; second=val.second; msec=val.msec return "pywintypes.Time((%(year)d, %(month)d, %(day)d, %(hour)d, %(minute)d, %(second)d,0,0,0,%(msec)d))" % locals() ! return repr(val) return None |