HOME


sh-3ll 1.0
DIR:/usr/local/lib/python3.6/site-packages/dateutil/zoneinfo/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.6/site-packages/dateutil/zoneinfo/__pycache__/rebuild.cpython-36.pyc
3

���hX	�@szddlZddlZddlZddlZddlZddlmZmZddlm	Z	ddl
mZmZddgdfdd�Z
dd	�Zd
d�ZdS)�N)�
check_call�check_output)�TarFile)�METADATA_FN�ZONEFILENAME�gzcstj��tjj�d�}tjjt�}z�tj|��<}x|D]}|j	|��q6W�fdd�|D�}	t
||	�WdQRXttjj|t�d��}
tj
||
ddd�WdQRXtjj|t�}tj|d	|��4}x,tj|�D]}tjj||�}
|j|
|�q�WWdQRXWdtj��XdS)
z�Rebuild the internal timezone info in dateutil/zoneinfo/zoneinfo*tar*

    filename is the timezone tarball from ``ftp.iana.org/tz``.

    Zzoneinfocsg|]}tjj�|��qS�)�os�path�join)�.0�n)�tmpdirr�D/tmp/pip-build-5_djhm0z/python-dateutil/dateutil/zoneinfo/rebuild.py�
<listcomp>szrebuild.<locals>.<listcomp>N�w�T)�indent�	sort_keyszw:%s)�tempfile�mkdtempr	r
r�dirname�__file__r�open�extract�_run_zicr�json�dumpr�listdir�add�shutil�rmtree)�filename�tag�formatZ
zonegroups�metadata�zonedirZ	moduledir�tf�name�	filepaths�f�target�entryZ	entrypathr)rr�rebuilds"
r-cCsrytddg�}Wn,tk
r<}zt|��WYdd}~XnXd|krPddg}ng}tdg|d|g|�dS)a�Calls the ``zic`` compiler in a compatible way to get a "fat" binary.

    Recent versions of ``zic`` default to ``-b slim``, while older versions
    don't even have the ``-b`` option (but default to "fat" binaries). The
    current version of dateutil does not support Version 2+ TZif files, which
    causes problems when used in conjunction with "slim" binaries, so this
    function is used to ensure that we always get a "fat" binary.
    Zzicz--helpNs-b z-b�fatz-d)r�OSError�_print_on_nosuchfiler)r&r)�	help_text�eZ
bloat_argsrrrr)s

rcCs|jdkrtjd�dS)zdPrint helpful troubleshooting message

    e is an exception raised by subprocess.check_call()

    �zzCould not find zic. Perhaps you need to install libc-bin or some other package that provides it, or it's not in your PATH?N)�errno�logging�error)r2rrrr0As
r0)r5r	rr r�
subprocessrr�tarfilerZdateutil.zoneinforrr-rr0rrrr�<module>s