ƺ[Q NddlmZddlmZmZddlmZGddeZdZdZ y) )division) timedeltatzinfo)deepcopyc4eZdZdZdZdZdZdZdZdZ y) FixedOffseta Represent a timezone with a fixed offset from UTC and no adjustment for DST. >>> FixedOffset(4,0) >>> FixedOffset(-4,0) >>> FixedOffset(4,30) >>> tz = FixedOffset(-5,0) >>> tz.dst(None) datetime.timedelta(0) The class tries to do the right thing with the sign of the time zone offset: >>> FixedOffset(-9,30) >>> FixedOffset(-9,-30) Traceback (most recent call last): ... ValueError: minutes must not be negative Offsets must thus be normalized so that the minute value is positive: >>> FixedOffset(-8,30) ctj||dkr td|dkr|dz}t|||_dt t |jz|_y)zK Create a new FixedOffset instance with the given offset. rzminutes must not be negative)hoursminutesUTCN)r__init__ ValueErrorr_FixedOffset__offsettimezonetimedelta_seconds_FixedOffset__name)selfr r s 1/usr/lib/python3/dist-packages/pyrfc3339/utils.pyrzFixedOffset.__init__(s_  Q;;< < 19 rMG!*13 h'8'GHH ctdS)zG Return offset for DST. Always returns timedelta(0). r)rrdts rdstzFixedOffset.dst6s |rc|jS)z* Return offset from UTC. )rrs r utcoffsetzFixedOffset.utcoffset=s }}rc|jS)z+ Return name of timezone. )rrs rtznamezFixedOffset.tznameDs {{rcBdj|jdS)Nz<{0}>)formatr)rs r__repr__zFixedOffset.__repr__Ks~~dkk$/00rc |j}|j|}||t|<|jj D]\}}t ||t |||S)N) __class____new__id__dict__itemssetattrr)rmemoclsresultkvs r __deepcopy__zFixedOffset.__deepcopy__Ns^nnS!RXMM'') 2DAq FAx40 1 2 rN) __name__ __module__ __qualname____doc__rrrrr!r.rrrrs'@ I1rrc tt|jS#t$rG|j}|j }|j }tt|dz|z|dz zcYSwxYw)a Return the offset stored by a :class:`datetime.timedelta` object as an integer number of seconds. Microseconds, if present, are rounded to the nearest second. Delegates to :meth:`timedelta.total_seconds() ` if available. >>> timedelta_seconds(timedelta(hours=1)) 3600 >>> timedelta_seconds(timedelta(hours=-1)) -3600 >>> timedelta_seconds(timedelta(hours=1, minutes=30)) 5400 >>> timedelta_seconds(timedelta(hours=1, minutes=30, ... microseconds=300000)) 5400 >>> timedelta_seconds(timedelta(hours=1, minutes=30, ... microseconds=900000)) 5401 iQi@B)intround total_secondsAttributeErrordaysseconds microseconds)tdr9r:r;s rrrWsp2O5))+,-- Oww** 5$,'1\G5KLMNN Os!$A A43A4ctt|d\}}tt|dz }|dk\rd}nd}dj |t |t |S)z Return a string representing the timezone offset. Remaining seconds are rounded to the nearest minute. >>> timezone(3600) '+01:00' >>> timezone(5400) '+01:30' >>> timezone(-28800) '-08:00' i<r+-z{0}{1:02d}:{2:02d})divmodabsr6floatr r5)rr r:r signs rrrzsYC ND1NE7E'NR'(GA~  & &tSZW FFrN) __future__rdatetimerrcopyrrrrr3rrrHs*&M&M` OFGr