;ò MDc@s/dZdkZdkZdfd„ƒYZdS(s. utctime.py - various functions for parsing display UTCTime (c) by Michael Stroeder This module is distributed under the terms of the GPL (GNU GENERAL PUBLIC LICENSE) Version 2 (see http://www.gnu.org/copyleft/gpl.html) $Id: utctime.py,v 1.4 2006/04/24 17:29:46 michael Exp $ NsUTCTimecBsMtZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z RS(s^ UTCTime object The timestamp is stored internally as time tuple in self.__datetime__. cCs|i|ƒ|_dS(sÖ Intialize a UTCTime object Parameter datetime can be either of type string UTCTime string like 20000914101638Z tuple time tuple like used in module time integer Seconds since "epoch". N(sselfs __timetuple__sdatetimes __datetime__(sselfsdatetime((s./pylib/mspki/utctime.pys__init__scCs•t|ƒtdƒjo|i|ƒSnht|ƒtfƒjot|ƒdjo|Sn4t|ƒtdƒjoti|ƒSn td‚dS(s#Convert datetime type to time tuplesi f1.0sGParameter datetime must be of type string, time tuple or float seconds.N(stypesdatetimesselfs __strptime__slenstimesgmtimes TypeError(sselfsdatetime((s./pylib/mspki/utctime.pys __timetuple__!s,cCs|itjSdS(N(sselfs __datetime__sNone(sself((s./pylib/mspki/utctime.pys __nonzero__/scCsY|tjodSnAt|tƒot|i|iƒSnt|i|i|ƒƒSdS(Ni(sothersNones isinstancesUTCTimescmpsselfs __datetime__s __timetuple__(sselfsother((s./pylib/mspki/utctime.pys__cmp__2s  cCstid|iƒSdS(Ns%Y-%m-%dT%H:%M:%SZ(stimesstrftimesselfs __datetime__(sself((s./pylib/mspki/utctime.pys__str__:scCstid|iƒSdS(Ns %Y%m%d%H%M%SZ(stimesstrftimesselfs __datetime__(sself((s./pylib/mspki/utctime.pys__repr__=sc CsDt|ƒtdƒjo td‚n|diƒdjo td‚nt|ƒdjo|t|dd!ƒt|dd !ƒt|d d !ƒt|d d !ƒt|d d !ƒt|d d !ƒf\}}}}}}n7t|ƒdjo|t|dd!ƒt|dd!ƒt|dd !ƒt|d d !ƒt|d d !ƒt|d d !ƒf\}}}}}}nƒt|ƒdjoot|dd!ƒt|dd!ƒt|dd !ƒt|d d !ƒt|d d !ƒdf\}}}}}}n|djo|d}n |d}t iti||||||dddf ƒƒSdS(s" Parse a UTC time string. ss#Parameter s must be of string type.iÿÿÿÿsZs)Trailing Z of UTC time string is missing.iiiiii i ii ii i2iĞiliN(stypesss TypeErrorsuppers ValueErrorslenslongsyearsmonthsdayshoursminutessecondstimesgmtimescalendarstimegm(sselfssshourssecondsmonthsminutesyearsday((s./pylib/mspki/utctime.pys __strptime__@s  ||o  ( s__name__s __module__s__doc__s__init__s __timetuple__s __nonzero__s__cmp__s__str__s__repr__s __strptime__(((s./pylib/mspki/utctime.pysUTCTimes      (s__doc__stimescalendarsUTCTime(scalendarsUTCTimestime((s./pylib/mspki/utctime.pys? s