[Python-checkins] python/nondist/sandbox/datetime US.py,1.9,1.10
tim_one@users.sourceforge.net
tim_one@users.sourceforge.net
2002年12月27日 12:37:02 -0800
Update of /cvsroot/python/python/nondist/sandbox/datetime
In directory sc8-pr-cvs1:/tmp/cvs-serv29845
Modified Files:
US.py
Log Message:
Made the necessary imports explicit.
Index: US.py
===================================================================
RCS file: /cvsroot/python/python/nondist/sandbox/datetime/US.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** US.py 27 Dec 2002 19:27:37 -0000 1.9
--- US.py 27 Dec 2002 20:37:00 -0000 1.10
***************
*** 1,3 ****
! from datetime import *
def _first_sunday_at_or_after(dt):
--- 1,5 ----
! from datetime import time, datetime, datetimetz
! from datetime import tzinfo
! from datetime import timedelta
def _first_sunday_at_or_after(dt):
***************
*** 53,60 ****
end = datetime(1, 10, 25, 2)
! def __init__(self, stdoffset, stdname, dstname):
! if not isinstance(stdoffset, timedelta):
! stdoffset = timedelta(hours=stdoffset)
! self.stdoff = stdoffset
self.stdname = stdname
self.dstname = dstname
--- 55,60 ----
end = datetime(1, 10, 25, 2)
! def __init__(self, stdhours, stdname, dstname):
! self.stdoff = timedelta(hours=stdhours)
self.stdname = stdname
self.dstname = dstname
***************
*** 108,113 ****
return self.zero
brainbuster_test = """
! >>> Eastern = USTimeZone(timedelta(hours=-5), "EST", "EDT")
>>> def printstuff(d):
--- 108,115 ----
return self.zero
+
+
brainbuster_test = """
! >>> Eastern = USTimeZone(-5, "EST", "EDT")
>>> def printstuff(d):