Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
contego / home / tvault / .virtenv / lib / python2.7 / site-packages / dateutil / tz / _common.pyc
Size: Mime:
ó
îEYc@sôddlmZddlmZddlmZmZmZddlZedƒZddgZ	d„Z
eed	ƒr‡d
d„Zn"defd
„ƒYZ
d
d„Zdefd„ƒYZdefd„ƒYZd„ZeedeƒZdS(iÿÿÿÿ(tPY3(t_thread(tdatetimet	timedeltattzinfoNittzname_in_python2tenfoldcs‡fd†}|S(sžChange unicode output into bytestrings in Python 2

    tzname() API changed in Python 3. It used to return bytes, but was changed
    to unicode strings
    cs5ˆ||Ž}|dk	r1tr1|jƒ}n|S(N(tNoneRtencode(targstkwargstname(tnamefunc(sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pytadjust_encodings((RR
((RsH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyRstfoldicCs|jd|ƒS(s­
        Provides a unified interface for assigning the ``fold`` attribute to
        datetimes both before and after the implementation of PEP-495.

        :param fold:
            The value for the ``fold`` attribute in the returned datetime. This
            should be either 0 or 1.

        :return:
            Returns an object for which ``getattr(dt, 'fold', 0)`` returns
            ``fold`` for all versions of Python. In versions prior to
            Python 3.6, this is a ``_DatetimeWithFold`` object, which is a
            subclass of :py:class:`datetime.datetime` with the ``fold``
            attribute added, if ``fold`` is 1.

        ..versionadded:: 2.6.0
        R(treplace(tdtR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyR st_DatetimeWithFoldcBs#eZdZdZed„ƒZRS(sõ
        This is a class designed to provide a PEP 495-compliant interface for
        Python versions before 3.6. It is used only for dates in a fold, so
        the ``fold`` attribute is fixed at ``1``.

        ..versionadded:: 2.6.0
        cCsdS(Ni((tself((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyR?s((t__name__t
__module__t__doc__t	__slots__tpropertyR(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyR5scCs`t|ddƒ|kr|S|jƒd }||j|jf7}|rRt|ŒSt|ŒSdS(s­
        Provides a unified interface for assigning the ``fold`` attribute to
        datetimes both before and after the implementation of PEP-495.

        :param fold:
            The value for the ``fold`` attribute in the returned datetime. This
            should be either 0 or 1.

        :return:
            Returns an object for which ``getattr(dt, 'fold', 0)`` returns
            ``fold`` for all versions of Python. In versions prior to
            Python 3.6, this is a ``_DatetimeWithFold`` object, which is a
            subclass of :py:class:`datetime.datetime` with the ``fold``
            attribute added, if ``fold`` is 1.

        ..versionadded:: 2.6.0
        RiiN(tgetattrt	timetupletmicrosecondRRR(RRR	((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyRCs
t_tzinfocBs;eZdZd„Zd„Zd„Zd„Zd„ZRS(s=
    Base class for all ``dateutil`` ``tzinfo`` objects.
    cCs}|jd|ƒ}t|ddƒ}t|ddƒ}|jƒ|jƒk}|jddƒ|jddƒk}|o||S(s5
        Whether or not the "wall time" of a given datetime is ambiguous in this
        zone.

        :param dt:
            A :py:class:`datetime.datetime`, naive or time zone aware.


        :return:
            Returns ``True`` if ambiguous, ``False`` otherwise.

        ..versionadded:: 2.6.0
        RRiiN(RRt	utcoffsetR(RRtwall_0twall_1tsame_offsettsame_dt((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pytis_ambiguousfs$cCsH|j|ƒr>||}t||jƒ|jƒkƒ}nd}|S(sÀ
        Determine the fold status of a "wall" datetime, given a representation
        of the same datetime as a (naive) UTC datetime. This is calculated based
        on the assumption that ``dt.utcoffset() - dt.dst()`` is constant for all
        datetimes, and that this offset is the actual number of hours separating
        ``dt_utc`` and ``dt_wall``.

        :param dt_utc:
            Representation of the datetime as UTC

        :param dt_wall:
            Representation of the datetime as "wall time". This parameter must
            either have a `fold` attribute or have a fold-naive
            :class:`datetime.tzinfo` attached, otherwise the calculation may
            fail.
        i(R!tintRtdst(Rtdt_utctdt_wallt
delta_wallt_fold((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyt_fold_statuss

%cCst|ddƒS(NRi(R(RR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyR'˜scCsât|tƒstdƒ‚n|j|k	r<tdƒ‚n|jƒ}|dkrctdƒ‚n|jƒ}|dkrŠtdƒ‚n||}|rÚ||7}t|ddƒjƒ}|dkrÚtdƒ‚qÚn||S(	sú
        Given a timezone-aware datetime in a given timezone, calculates a
        timezone-aware datetime in a new timezone.

        Since this is the one time that we *know* we have an unambiguous
        datetime object, we take this opportunity to determine whether the
        datetime is ambiguous and in a "fold" state (e.g. if it's the first
        occurence, chronologically, of the ambiguous datetime).

        :param dt:
            A timezone-aware :class:`datetime.dateime` object.
        s&fromutc() requires a datetime argumentsdt.tzinfo is not selfs0fromutc() requires a non-None utcoffset() results*fromutc() requires a non-None dst() resultRis;fromutc(): dt.dst gave inconsistent results; cannot convertN(	t
isinstanceRt	TypeErrorRt
ValueErrorRRR#R(RRtdtofftdtdsttdelta((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyt_fromutc›s"

cCs1|j|ƒ}|j||ƒ}t|d|ƒS(sú
        Given a timezone-aware datetime in a given timezone, calculates a
        timezone-aware datetime in a new timezone.

        Since this is the one time that we *know* we have an unambiguous
        datetime object, we take this opportunity to determine whether the
        datetime is ambiguous and in a "fold" state (e.g. if it's the first
        occurance, chronologically, of the ambiguous datetime).

        :param dt:
            A timezone-aware :class:`datetime.dateime` object.
        R(R/R(R(RRR%R'((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pytfromutcÅs
(RRRR!R(R'R/R0(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyRas				*ttzrangebasecBsŒeZdZd„Zd„Zd„Zed„ƒZd„Zd„Z	d„Z
d„Zed	„ƒZ
dZd
„Zd„ZejZRS(
sŠ
    This is an abstract base class for time zones represented by an annual
    transition into and out of DST. Child classes should implement the following
    methods:

        * ``__init__(self, *args, **kwargs)``
        * ``transitions(self, year)`` - this is expected to return a tuple of
          datetimes representing the DST on and off transitions in standard
          time.

    A fully initialized ``tzrangebase`` subclass should also provide the
    following attributes:
        * ``hasdst``: Boolean whether or not the zone uses DST.
        * ``_dst_offset`` / ``_std_offset``: :class:`datetime.timedelta` objects
          representing the respective UTC offsets.
        * ``_dst_abbr`` / ``_std_abbr``: Strings representing the timezone short
          abbreviations in DST and STD, respectively.
        * ``_hasdst``: Whether or not the zone has DST.

    ..versionadded:: 2.6.0
    cCstdƒ‚dS(Ns%tzrangebase is an abstract base class(tNotImplementedError(R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyt__init__ñscCs7|j|ƒ}|dkrdS|r,|jS|jSdS(N(t_isdstRt_dst_offsett_std_offset(RRtisdst((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyRôscCs4|j|ƒ}|dkrdS|r,|jStSdS(N(R4Rt_dst_base_offsettZERO(RRR7((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyR#þscCs!|j|ƒr|jS|jSdS(N(R4t	_dst_abbrt	_std_abbr(RR((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyttznamesc
Cst|tƒstdƒ‚n|j|k	r<tdƒ‚n|j|jƒ}|dkrk||j|ƒS|\}}||j	8}||j	8}||f}|j
ddƒ}|j||ƒ}|r×||j}n
||j	}t
|oú|j|ƒƒ}	t|d|	ƒS(s, Given a datetime in UTC, return local time s&fromutc() requires a datetime argumentsdt.tzinfo is not selfRRN(R)RR*RR+ttransitionstyearRRR6Rt_naive_isdstR5R"R!R(
RRR=tdstontdstofftutc_transitionsR$R7R%R'((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyR0s$


cCsV|js
tS|j|jƒ\}}|jddƒ}||koS||jkSS(s6
        Whether or not the "wall time" of a given datetime is ambiguous in this
        zone.

        :param dt:
            A :py:class:`datetime.datetime`, naive or time zone aware.


        :return:
            Returns ``True`` if ambiguous, ``False`` otherwise.

        .. versionadded:: 2.6.0
        RN(thasdsttFalseR=R>RRR8(RRtstarttend((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyR!1s
	cCs|js
tS|dkrdS|j|jƒ}|dkr?tS|jddƒ}|j||ƒ}|r‡|j|ƒr‡|j|ƒS|SdS(NR(	RCRDRR=R>RR?R!R'(RRR=R7((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyR4Gs	cCsj|\}}|jddƒ}||krI||koA|kn}n||ko`|kn}|S(NR(RR(RRR=R@RAR7((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyR?\scCs|j|jS(N(R5R6(R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyR8hscCs||kS(N((Rtother((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyt__ne__nscCsd|jjS(Ns%s(...)(t	__class__R(R((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyt__repr__qsN(RRRR3RR#RR<R0R!R4R?RR8Rt__hash__RHRJtobjectt
__reduce__(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyR1Ûs		
	
	"					cCs!|j|jdd|jdS(Ni€Qi@B(tsecondstdaystmicroseconds(ttd((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyt_total_secondswst
total_seconds(tsixRt	six.movesRRRRtcopyR9t__all__RthasattrRRRR1RRR(((sH/home/tvault/.virtenv/lib/python2.7/site-packages/dateutil/tz/_common.pyt<module>s	zœ