Added IDateTime interface

parent 8d432293
...@@ -19,6 +19,9 @@ import re, math, DateTimeZone ...@@ -19,6 +19,9 @@ import re, math, DateTimeZone
from time import time, gmtime, localtime from time import time, gmtime, localtime
from time import daylight, timezone, altzone, strftime from time import daylight, timezone, altzone, strftime
from datetime import datetime from datetime import datetime
from interfaces import IDateTime
from interfaces import DateTimeError, SyntaxError, DateError, TimeError
from zope.interface import implements
default_datefmt = None default_datefmt = None
...@@ -40,19 +43,6 @@ try: ...@@ -40,19 +43,6 @@ try:
except: except:
tzname=('UNKNOWN','UNKNOWN') tzname=('UNKNOWN','UNKNOWN')
class DateTimeError( Exception ):
pass
class SyntaxError( DateTimeError ):
pass
class DateError( DateTimeError ):
pass
class TimeError( DateTimeError ):
pass
# To control rounding errors, we round system time to the nearest # To control rounding errors, we round system time to the nearest
# millisecond. Then delicate calculations can rely on that the # millisecond. Then delicate calculations can rely on that the
# maximum precision that needs to be preserved is known. # maximum precision that needs to be preserved is known.
...@@ -492,6 +482,8 @@ class DateTime: ...@@ -492,6 +482,8 @@ class DateTime:
and numeric operations return a new DateTime object rather than and numeric operations return a new DateTime object rather than
modify the current object.""" modify the current object."""
implements(IDateTime)
# For security machinery: # For security machinery:
__roles__=None __roles__=None
__allow_access_to_unprotected_subobjects__=1 __allow_access_to_unprotected_subobjects__=1
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment