/usr/lib64/python2.6/site-packages/mx/DateTime
NameSizeModeActions
mxDateTime/-0755rm
ARPA.py76160644editdlrm
ARPA.pyc74800644editdlrm
ARPA.pyo74800644editdlrm
COPYRIGHT10300644editdlrm
DateTime.py321190644editdlrm
DateTime.pyc273180644editdlrm
DateTime.pyo272170644editdlrm
Feasts.py28560644editdlrm
Feasts.pyc46590644editdlrm
Feasts.pyo46590644editdlrm
ISO.py104410644editdlrm
ISO.pyc103810644editdlrm
ISO.pyo103810644editdlrm
LazyModule.py44000644editdlrm
LazyModule.pyc42720644editdlrm
LazyModule.pyo42720644editdlrm
LICENSE45870644editdlrm
Locale.py45840644editdlrm
Locale.pyc58500644editdlrm
Locale.pyo58500644editdlrm
NIST.py145840644editdlrm
NIST.pyc135790644editdlrm
NIST.pyo135790644editdlrm
ODMG.py52620644editdlrm
ODMG.pyc76600644editdlrm
ODMG.pyo76600644editdlrm
Parser.py425430644editdlrm
Parser.pyc364050644editdlrm
Parser.pyo364050644editdlrm
README1420644editdlrm
timegm.py28330644editdlrm
timegm.pyc30950644editdlrm
timegm.pyo30950644editdlrm
Timezone.py50960644editdlrm
Timezone.pyc36520644editdlrm
Timezone.pyo36520644editdlrm
__init__.py17080644editdlrm
__init__.pyc21800644editdlrm
__init__.pyo21800644editdlrm
Edit: /usr/lib64/python2.6/site-packages/mx/DateTime/ODMG.py (5262B)
""" ODMG type classes for date/time handling These are built on top of the basic DateTime[Delta] types and include rudimentary time zone handling through an offset in minutes. It is the applications responsibility to set the offset to correct values. The offsets are then used in date calculations. The implementation has not yet been thoroughly tested, but provides a good example of the swiftness with which you can build new date/time classes on top of the two basic types. If you find any errors or would like to see new features, mail them to mal@lemburg.com. """ __version__ = '0.1alpha' __author__ = 'Marc-Andre Lemburg, mailto:mal@lemburg.com' import DateTime class _EmptyClass: pass class Date: offset = 0 # from some imaginary time zone in minutes def __init__(self,*args): self.data = apply(DateTime.DateTime,args) def set_timezone(self,offset): self.offset = offset def __getattr__(self,what): return getattr(self.data,what) def __sub__(self,other): if isinstance(other,Date): if self.offset != other.offset: # Be careful about different offsets: d = (self.data - self.offset * DateTime.oneMinute) \ - (other.data - other.offset * DateTime.oneMinute) else: # Offsets are equal: no adjustment needed d = self.data - other.data o = _EmptyClass() o.__class__ = Interval o.data = d return o elif isinstance(other,Interval): d = self.data - other.data o = _EmptyClass() o.__class__ = Date o.data = d o.offset = self.offset # inherit the offset return o else: raise TypeError,"operation not supported" def __add__(self,other): if isinstance(other,Interval): d = self.data + other.data o = _EmptyClass() o.__class__ = Date o.data = d o.offset = self.offset # inherit the offset return o else: raise TypeError,"operation not supported" def __str__(self): return str(self.data) def __repr__(self): return '' % (str(self.data),id(self)) class Timestamp(Date): def __repr__(self): return '' % (str(self.data),id(self)) class Time: def __init__(self,*args): self.data = apply(DateTime.TimeDelta,args) def __getattr__(self,what): return getattr(self.data,what) def __sub__(self,other): if isinstance(other,Time): d = self.data - other.data o = _EmptyClass() o.__class__ = Interval o.data = d return o elif isinstance(other,Interval): d = self.data - other.data o = _EmptyClass() o.__class__ = Time o.data = d return o else: raise TypeError,"operation not supported" def __add__(self,other): if isinstance(other,Time): d = self.data + other.data o = _EmptyClass() o.__class__ = Interval o.data = d return o elif isinstance(other,Interval): d = self.data + other.data o = _EmptyClass() o.__class__ = Time o.data = d return o else: raise TypeError,"operation not supported" def __str__(self): return str(self.data) def __repr__(self): return '