HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/alt/python38/lib/python3.8/site-packages/dateutil/tz/__pycache__/tz.cpython-38.opt-1.pyc
U

�!X��@s�dZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
mZddlmZmZmZddlmZmZzdd	lmZmZWnek
r�dZZYnXe�d�Zej�d�Ze��ZGd
d�dej�Z Gdd
�d
ej�Z!Gdd�de�Z"Gdd�de#�Z$Gdd�de#�Z%Gdd�de�Z&Gdd�de�Z'Gdd�de'�Z(Gdd�de#�Z)Gdd�de�Z*Gdd�de#�Z+ej,d k�r�d!d"gZ-d#d$d%d&gZ.ngZ-gZ.d1d'd(�Z/d2d)d*�Z0d3d+d,�Z1d-d.�Z2Gd/d0�d0e#�Z3dS)4a{
This module offers timezone implementations subclassing the abstract
:py:`datetime.tzinfo` type. There are classes to handle tzfile format files
(usually are in :file:`/etc/localtime`, :file:`/usr/share/zoneinfo`, etc), TZ
environment string (in all known formats), given ranges (with help from
relative deltas), local machine timezone, fixed offset timezone, and UTC
timezone.
�N)�
itemgetter)�contextmanager)�string_types�PY3�)�tzname_in_python2�_tzinfo�_total_seconds)�tzrangebase�enfold)�tzwin�
tzwinlocalc@sVeZdZdZdd�Zdd�Zedd��Zdd	�Zd
d�Z	dZ
d
d�Zdd�Ze
jZdS)�tzutczD
    This is a tzinfo object that represents the UTC time zone.
    cCstS�N��ZERO��self�dt�r�?/opt/alt/python38/lib/python3.8/site-packages/dateutil/tz/tz.py�	utcoffset'sztzutc.utcoffsetcCstSrrrrrr�dst*sz	tzutc.dstcCsdS)N�UTCrrrrr�tzname-sztzutc.tznamecCsdS��6
        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
        Frrrrr�is_ambiguous1sztzutc.is_ambiguouscCs0t|ttf�stSt|t�p.t|t�o.|jtkSr)�
isinstancer�tzoffset�NotImplemented�_offsetr�r�otherrrr�__eq__As

�ztzutc.__eq__NcCs
||kSrrr"rrr�__ne__Jsztzutc.__ne__cCsd|jjS�Nz%s()��	__class__�__name__�rrrr�__repr__Msztzutc.__repr__)r)�
__module__�__qualname__�__doc__rrrrrr$�__hash__r%r+�object�
__reduce__rrrrr#s
rc@s^eZdZdZdd�Zdd�Zdd�Zdd	�Zed
d��Z	dd
�Z
dZdd�Zdd�Z
ejZdS)ra1
    A simple class for representing a fixed offset from UTC.

    :param name:
        The timezone name, to be returned when ``tzname()`` is called.

    :param offset:
        The time zone offset in seconds, or (since version 2.6.0, represented
        as a :py:class:`datetime.timedelta` object.
    c	Cs>||_zt|�}Wnttfk
r*YnXtj|d�|_dS�N��seconds)�_namer	�	TypeError�AttributeError�datetime�	timedeltar!)r�name�offsetrrr�__init__^sztzoffset.__init__cCs|jSr)r!rrrrrhsztzoffset.utcoffsetcCstSrrrrrrrksztzoffset.dstcCsdSrrrrrrrnsztzoffset.is_ambiguouscCs|jSr)r5rrrrr~sztzoffset.tznamecCst|t�stS|j|jkSr)rrr r!r"rrrr$�s
ztzoffset.__eq__NcCs
||kSrrr"rrrr%�sztzoffset.__ne__cCs"d|jjt|j�tt|j��fS)Nz
%s(%s, %s))r(r)�reprr5�intr	r!r*rrrr+�s�ztzoffset.__repr__)r)r,r-r.r<rrrrrr$r/r%r+r0r1rrrrrSs


rcsxeZdZdZ�fdd�Zdd�Zdd�Zedd	��Zd
d�Z	dd
�Z
ddd�Zdd�ZdZ
dd�Zdd�ZejZ�ZS)�tzlocalzR
    A :class:`tzinfo` subclass built around the ``time`` timezone functions.
    cs`tt|���tjtjd�|_tjr:tjtj	d�|_
n|j|_
|j
|j|_t|j�|_
dSr2)�superr?r<r8r9�time�timezone�_std_offset�daylight�altzone�_dst_offset�
_dst_saved�bool�_hasdstr*�r(rrr<�sztzlocal.__init__cCs,|dkr|jrdS|�|�r"|jS|jSdSr)rI�_isdstrFrCrrrrr�s

ztzlocal.utcoffsetcCs0|dkr|jrdS|�|�r(|j|jStSdSr)rIrKrFrCrrrrrr�s

ztzlocal.dstcCstj|�|�Sr)rArrKrrrrr�sztzlocal.tznamecCs$|�|�}|o"||�||j�kS)r)�
_naive_is_dstrG)rrZ	naive_dstrrrr�s
�ztzlocal.is_ambiguouscCst|�}t�|tj�jSr)�_datetime_to_timestamprA�	localtimerB�tm_isdst)rr�	timestamprrrrL�sztzlocal._naive_is_dstTcCsF|js
dS|�|�}t|dd�}|�|�rB|dk	r>|�|�SdS|S)NF�foldT)rIrL�getattrr�_fold)rrZ
fold_naiveZdstvalrQrrrrK�s

ztzlocal._isdstcCs&t|t�stS|j|jko$|j|jkSr)rr?r rCrFr"rrrr$�s


�ztzlocal.__eq__NcCs
||kSrrr"rrrr%sztzlocal.__ne__cCsd|jjSr&r'r*rrrr+sztzlocal.__repr__)T)r)r,r-r.r<rrrrrrLrKr$r/r%r+r0r1�
__classcell__rrrJrr?�s		

(r?c@sReZdZdddddddgZdd	�Zd
d�Zdd
�ZdZdd�Zdd�Z	dd�Z
dS)�_ttinfor;�delta�isdst�abbr�isstd�isgmt�	dstoffsetcCs|jD]}t||d�qdSr��	__slots__�setattr)r�attrrrrr<s
z_ttinfo.__init__cCsNg}|jD],}t||�}|dk	r
|�d|t|�f�q
d|jjd�|�fS)Nz%s=%s�%s(%s)z, )r]rR�appendr=r(r)�join)r�lr_�valuerrrr+s

z_ttinfo.__repr__cCsbt|t�stS|j|jko`|j|jko`|j|jko`|j|jko`|j|jko`|j|jko`|j	|j	kSr)
rrUr r;rVrWrXrYrZr[r"rrrr$s

�
�
�
�
�
�z_ttinfo.__eq__NcCs
||kSrrr"rrrr%)sz_ttinfo.__ne__cCs$i}|jD]}t||d�||<q
|Sr)r]rR�r�stater:rrr�__getstate__,s
z_ttinfo.__getstate__cCs(|jD]}||krt||||�qdSrr\rerrr�__setstate__2s
z_ttinfo.__setstate__)r)r,r-r]r<r+r$r/r%rgrhrrrrrUs�rUc@s*eZdZdZdddddddgZd	d
�ZdS)�_tzfilezw
    Lightweight class for holding the relevant transition and time zone
    information read from binary tzfiles.
    �
trans_list�	trans_idx�ttinfo_list�
ttinfo_std�
ttinfo_dst�
ttinfo_before�ttinfo_firstcKs$|jD]}t|||�|d��qdSr)�attrsr^�get)r�kwargsr_rrrr<@s
z_tzfile.__init__N)r)r,r-r.rqr<rrrrri8s�rics�eZdZdZd#�fdd�	Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	d$dd�Z
dd�Zdd�Zdd�Z
edd��Zdd�ZdZdd�Zdd�Zdd �Zd!d"�Z�ZS)%�tzfilea�
    This is a ``tzinfo`` subclass that allows one to use the ``tzfile(5)``
    format timezone files to extract current and historical zone information.

    :param fileobj:
        This can be an opened file stream or a file name that the time zone
        information can be read from.

    :param filename:
        This is an optional parameter specifying the source of the time zone
        information in the event that ``fileobj`` is a file object. If omitted
        and ``fileobj`` is a file stream, this parameter will be set either to
        ``fileobj``'s ``name`` attribute or to ``repr(fileobj)``.

    See `Sources for Time Zone and Daylight Saving Time Data 
    <http://www.twinsun.com/tz/tz-link.htm>`_ for more information. Time zone
    files can be compiled from the `IANA Time Zone database files
    <https://www.iana.org/time-zones>`_ with the `zic time zone compiler
    <https://www.freebsd.org/cgi/man.cgi?query=zic&sektion=8>`_
    Nc	s�tt|���d}t|t�r2||_t|d�}d}n.|dk	rB||_nt|d�rV|j|_n
t	|�|_|dk	r�|stt
|�}|�}|�|�}W5QRX|�|�dS)NF�rbTr:)
r@rtr<rr�	_filename�open�hasattrr:r=�_ContextWrapper�_read_tzfile�_set_tzdata)r�fileobj�filename�file_opened_hereZfile_stream�tzobjrJrrr<[s"




ztzfile.__init__cCs&tjD]}t|d|t||��qdS)z= Set the time zone data of this object from a _tzfile object �_N)rirqr^rR)rrr_rrrr{ss
ztzfile._set_tzdatac	s�t��|�d���dkr td��|�d�t�d|�d��\}}}}}}|rntt�d||�|d����_ng�_|r�t�d||�|���_ng�_g}t	|�D]}	|�
t�d	|�d
���q�|�|���}
|r�t�d|d|�|d��}|�rt�d
||�|��}|�r*t�d
||�|��}
g�_t	|�D]�}	||	\}}}d|dd}t�}||_
t�d�|_tj|d�|_||_|
||
�d|��|_||	k�o�||	dk|_||	k�o�|
|	dk|_�j�
|��q8�fdd��jD��_d�_d�_d�_�j�rԈj�s(�jd�_�_n�t	|ddd�D]T}	�j|	}�j�s^|j�s^|�_n�j�st|j�rt|�_�j�r8�j�r8�q��q8�j�r��j�s��j�_�jD]}|j�s�|�_�qԐq��jd�_d}t�j�D]Z\}	}|j�s�|j
}|}n*|dk	�r|j
||_|�j|	<|�p&d}�j|	|7<�q�d}tt	t�j���D]h}	�j|	}|j�r�|j�s�|dk�s�|j
||_n|j
}t|jtj��s�tj|jd�|_|�j|	<�qTt�j��_t�j��_�S)N�ZTZifzmagic not found�z>6l�z>%dlz>%dBz>lbb���z>%db�<�rr3�csg|]}�j|�qSr)rl)�.0�idx��outrr�
<listcomp>sz'tzfile._read_tzfile.<locals>.<listcomp>r���) ri�read�decode�
ValueError�structZunpack�listrjrk�rangerarlrUr;r8r9r[rVrW�findrXrYrZrmrnrorp�	enumerate�reversed�lenr�tuple)rr|Z
ttisgmtcntZ
ttisstdcntZleapcntZtimecntZtypecntZcharcntZttinfo�irXZleaprYrZZgmtoffrWZabbrind�ttiZ
laststdoffsetr;rr�rrzys�
��
	
�
�
�
�



	



ztzfile._read_tzfilecCs(|js
dSt|�}t�|j|�}|dS)Nr)�_trans_listrM�bisectZbisect_right)rrrPr�rrr�_find_last_transitionTs
ztzfile._find_last_transitioncCs8|dks|dt|j�kr |jS|dkr.|jS|j|S)Nrr)r�r��_ttinfo_stdZ_ttinfo_before�
_trans_idx)rr�rrr�_get_ttinfobs
ztzfile._get_ttinfocCs|�|�}|�|�Sr)�_resolve_ambiguous_timer�)rrr�rrr�_find_ttinfoms
ztzfile._find_ttinfocCsd|dkr|�|�}t|�}|�|�}|dks4|dkr8dS|�|d�j|j}|j|}|||kS)rNrFr)r�rMr�r;r�)rrr�rPr�ZodZttrrrrrs


ztzfile.is_ambiguouscCsF|�|�}|�|�}|dks$|dkr(|St|o:|�||��}||S)Nr)r�rSr>r)rrr�rSZ
idx_offsetrrrr��s

ztzfile._resolve_ambiguous_timecCs"|dkrdS|jstS|�|�jSr)r�rr�rVrrrrr�s
ztzfile.utcoffsetcCs0|dkrdS|jstS|�|�}|js*tS|jSr)Z_ttinfo_dstrr�rWr[)rrr�rrrr�s
z
tzfile.dstcCs|jr|dkrdS|�|�jSr)r�r�rXrrrrr�sz
tzfile.tznamecCs2t|t�stS|j|jko0|j|jko0|j|jkSr)rrtr r�r�Z_ttinfo_listr"rrrr$�s

�
�z
tzfile.__eq__cCs
||kSrrr"rrrr%�sz
tzfile.__ne__cCsd|jjt|j�fS�Nr`)r(r)r=rvr*rrrr+�sztzfile.__repr__cCs
|�d�Sr)�
__reduce_ex__r*rrrr1�sztzfile.__reduce__cCs|jd|jf|jfSr)r(rv�__dict__)rZprotocolrrrr��sztzfile.__reduce_ex__)N)N)r)r,r-r.r<r{rzr�r�r�rr�rrrrr$r/r%r+r1r�rTrrrJrrtEs(\

	
rtc@s6eZdZdZddd�Zdd�Zdd�Zed	d
��ZdS)�tzrangeaQ
    The ``tzrange`` object is a time zone specified by a set of offsets and
    abbreviations, equivalent to the way the ``TZ`` variable can be specified
    in POSIX-like systems, but using Python delta objects to specify DST
    start, end and offsets.

    :param stdabbr:
        The abbreviation for standard time (e.g. ``'EST'``).

    :param stdoffset:
        An integer or :class:`datetime.timedelta` object or equivalent
        specifying the base offset from UTC.

        If unspecified, +00:00 is used.

    :param dstabbr:
        The abbreviation for DST / "Summer" time (e.g. ``'EDT'``).

        If specified, with no other DST information, DST is assumed to occur
        and the default behavior or ``dstoffset``, ``start`` and ``end`` is
        used. If unspecified and no other DST information is specified, it
        is assumed that this zone has no DST.

        If this is unspecified and other DST information is *is* specified,
        DST occurs in the zone but the time zone abbreviation is left
        unchanged.

    :param dstoffset:
        A an integer or :class:`datetime.timedelta` object or equivalent
        specifying the UTC offset during DST. If unspecified and any other DST
        information is specified, it is assumed to be the STD offset +1 hour.

    :param start:
        A :class:`relativedelta.relativedelta` object or equivalent specifying
        the time and time of year that daylight savings time starts. To specify,
        for example, that DST starts at 2AM on the 2nd Sunday in March, pass:

            ``relativedelta(hours=2, month=3, day=1, weekday=SU(+2))``

        If unspecified and any other DST information is specified, the default
        value is 2 AM on the first Sunday in April.

    :param end:
        A :class:`relativedelta.relativedelta` object or equivalent representing
        the time and time of year that daylight savings time ends, with the
        same specification method as in ``start``. One note is that this should
        point to the first time in the *standard* zone, so if a transition
        occurs at 2AM in the DST zone and the clocks are set back 1 hour to 1AM,
        set the `hours` parameter to +1.


    **Examples:**

    .. testsetup:: tzrange

        from dateutil.tz import tzrange, tzstr

    .. doctest:: tzrange

        >>> tzstr('EST5EDT') == tzrange("EST", -18000, "EDT")
        True

        >>> from dateutil.relativedelta import *
        >>> range1 = tzrange("EST", -18000, "EDT")
        >>> range2 = tzrange("EST", -18000, "EDT", -14400,
        ...                  relativedelta(hours=+2, month=4, day=1,
        ...                                weekday=SU(+1)),
        ...                  relativedelta(hours=+1, month=10, day=31,
        ...                                weekday=SU(-1)))
        >>> tzstr('EST5EDT') == range1 == range2
        True

    Nc	Cs@ddlma||_||_zt|�}Wnttfk
r<YnXzt|�}Wnttfk
rbYnX|dk	r|tj|d�|_	nt
|_	|dk	r�tj|d�|_n(|r�|dk	r�|j	tjdd�|_nt
|_|r�|dkr�tjdddt�d�d�|_
n||_
|�r|dk�rtjdd	d
t�d�d�|_n||_|j|j	|_t|j
�|_dS)Nr��
relativedeltar3r)�hoursr�r�)r��month�day�weekday�
�r�)�dateutilr��	_std_abbr�	_dst_abbrr	r6r7r8r9rCrrF�SU�_start_delta�
_end_delta�_dst_base_offset_rH�hasdst)r�stdabbr�	stdoffset�dstabbrr[�start�endrrrr<sJ�
�
ztzrange.__init__cCs4|js
dSt�|dd�}||j}||j}||fS)a�
        For a given year, get the DST on and off transition times, expressed
        always on the standard time side. For zones with no transitions, this
        function returns ``None``.

        :param year:
            The year whose transitions you would like to query.

        :return:
            Returns a :class:`tuple` of :class:`datetime.datetime` objects,
            ``(dston, dstoff)`` for zones with an annual DST transition, or
            ``None`` for fixed offset zones.
        Nr)r�r8r�r�)rZyearZ	base_yearr�r�rrr�transitionsJs

ztzrange.transitionscCsVt|t�stS|j|jkoT|j|jkoT|j|jkoT|j|jkoT|j|jkoT|j|jkSr)	rr�r r�r�rCrFr�r�r"rrrr$bs

�
�
�
�
�ztzrange.__eq__cCs|jSr)r�r*rrr�_dst_base_offsetmsztzrange._dst_base_offset)NNNNN)	r)r,r-r.r<r�r$�propertyr�rrrrr��sI�
/r�c@s,eZdZdZddd�Zddd�Zdd	�Zd
S)
�tzstra
    ``tzstr`` objects are time zone objects specified by a time-zone string as
    it would be passed to a ``TZ`` variable on POSIX-style systems (see
    the `GNU C Library: TZ Variable`_ for more details).

    There is one notable exception, which is that POSIX-style time zones use an
    inverted offset format, so normally ``GMT+3`` would be parsed as an offset
    3 hours *behind* GMT. The ``tzstr`` time zone object will parse this as an
    offset 3 hours *ahead* of GMT. If you would like to maintain the POSIX
    behavior, pass a ``True`` value to ``posix_offset``.

    The :class:`tzrange` object provides the same functionality, but is
    specified using :class:`relativedelta.relativedelta` objects. rather than
    strings.

    :param s:
        A time zone string in ``TZ`` variable format. This can be a
        :class:`bytes` (2.x: :class:`str`), :class:`str` (2.x: :class:`unicode`)
        or a stream emitting unicode characters (e.g. :class:`StringIO`).

    :param posix_offset:
        Optional. If set to ``True``, interpret strings such as ``GMT+3`` or
        ``UTC+3`` as being 3 hours *behind* UTC rather than ahead, per the
        POSIX standard.

    .. _`GNU C Library: TZ Variable`:
        https://www.gnu.org/software/libc/manual/html_node/TZ-Variable.html
    Fc	Cs�ddlma||_t�|�}|dkr,td��|jdkrH|sH|jd9_tj||j|j|j	|j
ddd�|j	s|d|_d|_n&|�
|j�|_|jr�|j
|jdd	�|_t|j�|_dS)
Nr)�parserzunknown string format�ZGMTrr�F)r�r�r)�isend)r�r��_sZ_parsetzr�r�r�r�r<r�r[r�r��_deltar�r�rHr�)r�sZposix_offset�resrrrr<�s(
�ztzstr.__init__rcCs:ddlm}i}|jdk	rr|j|d<|jdk	r`|�|j|j�|d<|jdkrVd|d<qpd|d<q�|jr�|j|d<n*|jdk	r�|j|d<n|jdk	r�|j|d	<|s�|s�d
|d<d|d<|�d�|d<nd|d<d|d<|�d�|d<|j	dk	r�|j	|d
<nd|d
<|�r.|j
|j}|d
|j|j
d8<|jf|�S)Nrr�r�r�rr�r�ZyeardayZ	nlyeardayr�r�r�r4i i�Q)r�r�r�r�Zweekr�ZydayZjydayr�rArFrCr4Zdays)r�xr�r�rsrVrrrr��s<









ztzstr._deltacCsd|jjt|j�fSr��r(r)r=r�r*rrrr+�sztzstr.__repr__N)F)r)r)r,r-r.r<r�r+rrrrr�rs
 
)r�c@seZdZddd�ZdS)�_tzicalvtzcompNcCs@tj|d�|_tj|d�|_|j|j|_||_||_||_dSr2)r8r9�tzoffsetfrom�
tzoffsetto�tzoffsetdiffrWr�rrule)rr�r�rWrr�rrrr<�sz_tzicalvtzcomp.__init__)NN)r)r,r-r<rrrrr��s�r�csZeZdZgf�fdd�	Zdd�Zdd�Zdd�Zd	d
�Zedd��Z	d
d�Z
ejZ�Z
S)�
_tzicalvtzcs*tt|���||_||_g|_g|_dSr)r@r�r<�_tzid�_comps�
_cachedate�
_cachecomp)r�tzid�compsrJrrr<�s
z_tzicalvtz.__init__cCst|j�dkr|jdS|jdd�}z|j|j�||�|�f�WStk
rVYnXd}d}|jD](}|�||�}|rf|r�||krf|}|}qf|s�|jD]}|j	s�|}q�q�|d}|j�
d||�|�f�|j�
d|�t|j�dk�r|j��|j��|S)Nrr��tzinfor�)r�r��replacer�r��indexrSr��_find_compdtrW�insert�pop)rrZ
lastcompdtZlastcomp�comp�compdtrrr�
_find_comp�s4




z_tzicalvtz._find_compcCs2|jtkr|�|�r||j8}|jj|dd�}|S)NT)Zinc)r�rrSr��before)rr�rr�rrrr�s
z_tzicalvtz._find_compdtcCs|dkrdS|�|�jSr)r�r�rrrrr#sz_tzicalvtz.utcoffsetcCs|�|�}|jr|jStSdSr)r�rWr�r)rrr�rrrr)s
z_tzicalvtz.dstcCs|�|�jSr)r�rrrrrr0sz_tzicalvtz.tznamecCsdt|j�S)Nz<tzicalvtz %s>)r=r�r*rrrr+4sz_tzicalvtz.__repr__)r)r,r-r<r�r�rrrrr+r0r1rTrrrJrr��s+
r�c@sBeZdZdZdd�Zdd�Zddd�Zd	d
�Zdd�Zd
d�Z	dS)�tzicala\
    This object is designed to parse an iCalendar-style ``VTIMEZONE`` structure
    as set out in `RFC 2445`_ Section 4.6.5 into one or more `tzinfo` objects.

    :param `fileobj`:
        A file or stream in iCalendar format, which should be UTF-8 encoded
        with CRLF endings.

    .. _`RFC 2445`: https://www.ietf.org/rfc/rfc2445.txt
    c	Csnddlmat|t�r,||_t|d�}d}nt|dt|��|_t|�}i|_	|�}|�
|���W5QRXdS)Nr)r��rTr:)r�r�rrr�rwrRr=ry�_vtz�
_parse_rfcr�)rr|r~Zfobjrrrr<Es

ztzical.__init__cCst|j���S)z?
        Retrieves the available time zones as a list.
        )r�r��keysr*rrrr�Wsztzical.keysNcCsP|dkrDt|j�dkr td��nt|j�dkr6td��tt|j��}|j�|�S)a�
        Retrieve a :py:class:`datetime.tzinfo` object by its ``tzid``.

        :param tzid:
            If there is exactly one time zone available, omitting ``tzid``
            or passing :py:const:`None` value returns it. Otherwise a valid
            key (which can be retrieved from :func:`keys`) is required.

        :raises ValueError:
            Raised if ``tzid`` is not specified but there are either more
            or fewer than 1 zone defined.

        :returns:
            Returns either a :py:class:`datetime.tzinfo` object representing
            the relevant time zone or :py:const:`None` if the ``tzid`` was
            not found.
        Nrzno timezones definedrz more than one timezone available)r�r�r��next�iterrr)rr�rrrrr]s
z
tzical.getcCs�|��}|std��|ddkr>d|ddk}|dd�}nd}t|�dkrzt|dd��d	t|dd��d
|St|�dkr�t|dd��d	t|dd��d
t|dd��|Std|��dS)
Nzempty offsetr)�+�-)r�rr�rr�r�ir�r�zinvalid offset: )�stripr�r�r>)rr��signalrrr�
_parse_offsetxs,<ztzical._parse_offsetcCs<|��}|std��d}|t|�kr~||��}|s<||=q|dkrt|ddkrt||d|dd�7<||=q|d7}qd}g}d}d}|D�]�}|s�q�|�dd�\}	}
|	�d�}|s�td��|d��}	|dd�}|�r|	d	k�r|
d
kr�ntd|
��|
}d}d}
d}g}d}�q6|	dk�r|
d
k�rv|�rDtd|��|�sRtd��|�s`td��t||�|j|<d}n�|
|k�r�|�s�td��|
dk�r�td��|dk�r�td��d}|�r�tj	d�
|�dddd�}t|
||dk||�}|�|�d}ntd|
���q6|�r�|	dk�r(|�|�d}n�|	dk�r>|�|�n�|	dk�rn|�rbtd|	|df��|�
|
�}
nj|	dk�r�|�r�td|d��|�
|
�}n>|	dk�r�|�r�td|d��|
}n|	d k�r�ntd!|	��n>|	d"k�r|�r�td#|d��|
}n|	d$k�rntd!|	��q�|	d	kr�|
d
kr�d}g}d}q�dS)%Nzempty stringr� rF�:�;zempty property nameZBEGIN)ZSTANDARD�DAYLIGHTzunknown component: ZENDZ	VTIMEZONEzcomponent not closed: zmandatory TZID not foundz at least one component is neededzmandatory DTSTART not foundz mandatory TZOFFSETFROM not found�
T)Z
compatibleZignoretz�cacher�zinvalid component end: ZDTSTART)ZRRULEZRDATEZEXRULEZEXDATEZTZOFFSETFROMzunsupported %s parm: %s Z
TZOFFSETTOzunsupported TZOFFSETTO parm: ZTZNAMEzunsupported TZNAME parm: �COMMENTzunsupported property: ZTZIDzunsupported TZID parm: )ZTZURLz
LAST-MODIFIEDr�)�
splitlinesr�r��rstrip�split�upperr�r�r�Zrrulestrrbr�rar�)rr��linesr��liner�r�ZinvtzZcomptyper:rdZparmsZfounddtstartr�r�Z
rrulelinesrZrrr�rrrr��s�





�

�
���




�

�

�


�
ztzical._parse_rfccCsd|jjt|j�fSr�r�r*rrrr+�sztzical.__repr__)N)
r)r,r-r.r<r�rrr�r�r+rrrrr�:s

vr��win32z/etc/localtimerNz/usr/share/zoneinfoz/usr/lib/zoneinfoz/usr/share/lib/zoneinfoz
/etc/zoneinfocCs@d}|s,ztjd}Wntk
r*YnX|dks<|dkr�tD]x}tj�|�s~|}tD]"}tj�||�}tj�|�rXq~qXq@tj�|�r@zt	|�}Wq�Wq@t
ttfk
r�Yq@Xq@t
�}�nx|�d�r�|dd�}tj�|��rtj�|�r�t	|�}nd}�n6tD]r}tj�||�}tj�|��sH|�dd�}tj�|��sH�q
zt	|�}W�q<Wnt
ttfk
�rxYnX�q
d}tdk	�r�zt|�}Wntk
�r�d}YnX|�s�ddlm}|��|�}|�s<|D]:}|dk�r�zt|�}Wntk
�rYnX�q<�q�|d	k�r*t�}n|tjk�r<t
�}|S)
NZTZr�r�r�r�r)�get_zonefile_instance�
0123456789r�)�os�environ�KeyError�TZFILES�path�isabs�TZPATHSrb�isfilert�IOError�OSErrorr�r?�
startswithr�rZWindowsErrorZdateutil.zoneinfor�rrr�rrAr)r:�tz�filepathr}rr��crrr�gettzsz









rcCsZ|dkr |jdkrtd��|j}|jdd�}|j|d��t���|�}|jdd�}||kS)a�
    Given a datetime and a time zone, determine whether or not a given datetime
    would fall in a gap.

    :param dt:
        A :class:`datetime.datetime` (whose time zone will be ignored if ``tz``
        is provided.)

    :param tz:
        A :class:`datetime.tzinfo` with support for the ``fold`` attribute. If
        ``None`` or not provided, the datetime's own time zone will be used.
    
    :return:
        Returns a boolean value whether or not the "wall time" exists in ``tz``.
    N�,Datetime is naive and no time zone provided.r�)r�r�r�Z
astimezoner)rr	Zdt_rtrrr�datetime_existsVs
rcCs�|dkr |jdkrtd��|j}t|dd�}|dk	rNz|�|�WSYnX|j|d�}t|dd�}t|dd�}|��|��k}|��|��k}|o�|S)a`
    Given a datetime and a time zone, determine whether or not a given datetime
    is ambiguous (i.e if there are two times differentiated only by their DST
    status).

    :param dt:
        A :class:`datetime.datetime` (whose time zone will be ignored if ``tz``
        is provided.)

    :param tz:
        A :class:`datetime.tzinfo` with support for the ``fold`` attribute. If
        ``None`` or not provided, the datetime's own time zone will be used.
    
    :return:
        Returns a boolean value whether or not the "wall time" is ambiguous in
        ``tz``.

    .. versionadded:: 2.6.0
    Nr
rr�r)rQr)r�r�rRrr�rrr)rr	Zis_ambiguous_fnZwall_0Zwall_1Zsame_offsetZsame_dstrrr�datetime_ambiguousus 
rcCst|jdd�t�S)z�
    Convert a :class:`datetime.datetime` object to an epoch timestamp in seconds
    since January 1, 1970, ignoring the time zone.
    Nr�)r	r��EPOCH)rrrrrM�srMc@s(eZdZdZdd�Zdd�Zdd�ZdS)	ryz_
    Class for wrapping contexts so that they are passed through in a 
    with statement.
    cCs
||_dSr��context)rrrrrr<�sz_ContextWrapper.__init__cCs|jSrrr*rrr�	__enter__�sz_ContextWrapper.__enter__cOsdSrr)�argsrsrrr�__exit__�sz_ContextWrapper.__exit__N)r)r,r-r.r<rrrrrrry�sry)N)N)N)4r.r8r�rA�sysr�r��copy�operatorr�
contextlibrZsixrrZ_commonrrr	r
r�winrr
�ImportErrorr9rZutcfromtimestamprZ	toordinalZEPOCHORDINALr�rrr?r0rUrirtr�r�r�r�r��platformrrrrrrMryrrrr�<module>sb
0Bv-
"jSH�
J

.