Sindbad~EG File Manager
�
)Μg� � �Z � d Z ddlZddlZddlZddlZd� Zd� Zd� Zedk( xr e� y y)z�
Generate the zip test data files.
Run to build the tests/zipdataNN/ziptestdata.zip files from
files in tests/dataNN.
Replaces the file with the working copy, but does commit anything
to the source repo.
� Nc �: � d} t t t | � � y)a;
>>> from unittest import mock
>>> monkeypatch = getfixture('monkeypatch')
>>> monkeypatch.setattr(zipfile, 'ZipFile', mock.MagicMock())
>>> print(); main() # print workaround for bpo-32509
<BLANKLINE>
...data01... -> ziptestdata/...
...
...data02... -> ziptestdata/...
...
)�01�02N)�tuple�map�generate)�suffixess �F/usr/local/lib/python3.12/test/test_importlib/resources/update-zips.py�mainr s � � �H� �#�h��
!�"� c � � t j t � j j t j � � }|d| � d�z }t j |d� 5 }t |d| � �z � D ]J \ }}dt j |j � � z }t |d|� |j ||� �L d d d � y # 1 sw Y y xY w)N�zipdataz/ziptestdata.zip�w�data�ziptestdataz->)�pathlib�Path�__file__�parent�relative_to�os�getcwd�zipfile�ZipFile�walk�
PurePosixPath�as_posix�print�write)�suffix�root�zfpath�zf�src�rel�dsts r
r r ! s� � ��<�<��!�(�(�4�4�R�Y�Y�[�A�D�
�g�f�X�%5�6�
6�F� ����� %���T�d�6�(�O�3�4�H�C���'�"7�"7�����"G�G�C��#�t�S�!��H�H�S�#�� 5�
&� %� %�s
�$AC
�
Cc # �2 K � t j | � D ]o \ }}}t j t � 5 |j d� d d d � |D ]1 }t
j |� |z }|j | � }||f�� �3 �q y # 1 sw Y �BxY w�w)N�__pycache__) r r �
contextlib�suppress�
ValueError�remover r r )�datapath�dirpath�dirnames� filenames�filename�resr% s r
r r + sy � �� �(*����(9�$���9�
�
�
��
,��O�O�M�*� -�!�H��,�,�w�'�(�2�C��/�/�(�+�C��s�(�N� "� ):�
,�
,�s �6B�B�
AB�B �B�__main__) �__doc__r) r r r r r r �__name__� r r
�<module>r7 s; ��� � � � �
#� �� �J� � !�4�6� !r
Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists