Your IP : 3.133.153.110
3
6�cY� � @ sf d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZm Z m
Z
ddg dfdd�Zdd� ZdS ) � N)�
check_call)�tar_open�METADATA_FN�ZONEFILENAMEZgzc - sH t j� � tjj� d�}tjjt�}�zt| ��v}x|D ]}|j|� � q6W � fdd�|D �} yt dd|g| � W n, t
k
r� }
zt|
� � W Y dd}
~
X nX W dQ R X ttjj|t
�d��}tj||dd d
� W dQ R X tjj|t�}t|d| ��6}x.tj|�D ] }
tjj||
�}|j||
� �qW W dQ R X W dtj� � X dS )z�Rebuild the internal timezone info in dateutil/zoneinfo/zoneinfo*tar*
filename is the timezone tarball from ftp.iana.org/tz.
Zzoneinfoc s g | ]}t jj� |��qS � )�os�path�join)�.0�n)�tmpdirr �/usr/lib/python3.6/rebuild.py�
<listcomp> s zrebuild.<locals>.<listcomp>Zzicz-dN�w� T)�indentZ sort_keyszw:%s)�tempfileZmkdtempr r r �dirname�__file__r �extractr �OSError�_print_on_nosuchfile�openr �json�dumpr �listdir�add�shutilZrmtree)�filename�tag�formatZ
zonegroupsZmetadataZzonedirZ moduledirZtf�nameZ filepaths�e�f�target�entryZ entrypathr )r r
�rebuild s*
r&