o
    ðäjã  ã                   @   s  d Z ddlZddlZddlZddlZddlZddlZddlZejr(e	e
eefZne	eeeefZejdk rReeddƒZedu rEejdd„ ƒZdd„ Zd	d
„ Zdd„ ZnddlZejdkrddd
„ Zdd„ ZnejjZejjZdd„ Zdd„ Zdd„ ZG dd„ deƒZdS )zàThis is an implementation of functions that interact with the tzdata module.

It will only live as long as :mod:`dateutil.zoneinfo` lives; when the
``dateutil.zoneinfo`` module is removed, this can all move under :mod:`tz`.
é    N)é   é   Únullcontextc                 c   s   � | V  d S ©N© )Úvr   r   úY/var/www/ticemtrilhas/avaliacao_env/lib/python3.10/site-packages/dateutil/_tzdata_impl.pyÚ_nullcontext$   s   €
r	   c                 C   s.   t  | ¡ t | |¡}|d u rtd|  ƒ‚|S )NzNo package named %r)Ú	importlibÚimport_moduleÚpkgutilÚget_dataÚImportError)ÚpackageÚresourceÚpkg_datar   r   r   Ú	_get_data(   s
   
r   c                 C   s   t | |ƒ d¡}tt |¡ƒS )Núutf-8)r   Údecoder	   ÚioÚStringIO)r   r   Ústr_package_datar   r   r   Ú
_open_text6   s   r   c                 C   s   t  t| |ƒ¡S r   )r   ÚBytesIOr   ©r   r   r   r   r   Ú_open_binary;   s   r   )r   é	   c                 C   s   t j | ¡ |¡jddd�S )NÚrr   )Úencoding©r
   Ú	resourcesÚfilesÚjoinpathÚopenr   r   r   r   r   C   s
   
þÿc                 C   s   t j | ¡ |¡ d¡S )NÚrbr   r   r   r   r   r   J   s   ÿc                 C   sV   zt  | ¡}W n
 ty   Y dS w t|ddƒD ]}tj tj ||¡¡r( dS qdS )aT  Whether ``resource`` names a directory inside ``package``.

    Opening a directory raises IsADirectoryError on POSIX but PermissionError
    on Windows, and on Python < 3.9 there is no portable way to ask the
    resource API, so check the package's search path directly (the tzdata
    package is a regular directory-backed package).
    FÚ__path__r   T)r
   r   r   ÚgetattrÚosÚpathÚisdirÚjoin)r   r   ÚpkgÚbaser   r   r   Ú_is_package_directoryT   s   ÿÿr-   c              	   C   sˆ   |   d¡}d dg|d d…  ¡}|d }tdd„ |D ƒƒs#t||ƒr)td| d�‚zt||ƒW S  tyC   t td| d�d ¡ Y d S w )	Nú/Ú.ztzdata.zoneinfoéÿÿÿÿc                 s   s   � | ]}|d v V  qdS ))Ú r/   z..Nr   )Ú.0Úcr   r   r   Ú	<genexpr>r   ó   € z_load_tzdata.<locals>.<genexpr>zTime zone not found: %s)Úzone_key)	Úsplitr*   Úanyr-   ÚTZFileNotFoundr   Ú_TZDATA_LOAD_EXCEPTIONSÚsixÚ
raise_from)ÚkeyÚ
componentsÚpackage_nameÚresource_namer   r   r   Ú_load_tzdatah   s   
ÿ
ÿúrA   c                  C   sF   t ddƒ�} ttd dd„ | D ƒƒƒW  d   ƒ S 1 sw   Y  d S )NÚtzdataÚzonesc                 s   s   � | ]}|  ¡ V  qd S r   )Ústrip)r2   Úlr   r   r   r4   †   r5   z$_load_tzdata_keys.<locals>.<genexpr>)r   ÚlistÚfilter)Úfr   r   r   Ú_load_tzdata_keys„   s   $ÿrI   c                       s    e Zd ZdZ‡ fdd„Z‡  ZS )r9   z8Indicates that a time zone file isn't present in tzdata.c                    sB   |  dd ¡}|d u rtdƒ‚tt| ƒj|| g|¢R Ž  || _d S )Nr6   z+Required keyword argument missing: zone_key)ÚpopÚ	TypeErrorÚsuperr9   Ú__init__r6   )ÚselfÚmsgÚargsÚkwargsr6   ©Ú	__class__r   r   rM   Œ   s
   
zTZFileNotFound.__init__)Ú__name__Ú
__module__Ú__qualname__Ú__doc__rM   Ú__classcell__r   r   rR   r   r9   ‰   s    r9   )rW   Ú
contextlibr
   r   r'   r   Úsysr;   ÚPY2r   ÚIOErrorÚUnicodeEncodeErrorÚ
ValueErrorr:   ÚFileNotFoundErrorÚIsADirectoryErrorÚversion_infor&   r	   Úcontextmanagerr   r   r   Úimportlib.resourcesr    Ú	open_textÚopen_binaryr-   rA   rI   r9   r   r   r   r   Ú<module>   sL    üû




