관리-도구
편집 파일: zip.cpython-38.pyc
U +�e � @ s@ d Z ddlZddlZddlZddlZddlZdd� Zdd� ZdS )z Generate zip test data files. � Nc C sZ t �|d��D}t| �D ](\}}| jt�|�� � }|�||� qtj � |� W 5 Q R X |S )z9 Zip the files in src into a new zipfile at dst. �w)�zipfile�ZipFile�walk�name�pathlib� PurePosixPath�as_posix�write�zipp�CompleteDirsZinject)�src�dst�zfZsrc_path�rel�dst_name� r �K/opt/hc_python/lib/python3.8/site-packages/importlib_resources/tests/zip.py� make_zip_file s r c c sf t �| �D ]V\}}}t�t�� |�d� W 5 Q R X |D ]&}t�|�| }|�| �}||fV q8q d S )N�__pycache__) �osr � contextlib�suppress� ValueError�remover �Path�relative_to)�datapath�dirpath�dirnames� filenames�filename�resr r r r r s r )�__doc__r r r r r r r r r r r �<module> s