관리-도구
편집 파일: dir_util.cpython-311.pyc
� �܋fG � � � d Z ddlZddlZddlmZ ddlmZmZ e� � a dd �Z dd �Z dd�Zd� Z dd �Zd� ZdS )zWdistutils.dir_util Utility functions for manipulating directories and directory trees.� N� )�log)�DistutilsFileError�DistutilsInternalError� TFc � � t | t � � st d| �d�� � �t j � | � � } g }t j � | � � s| dk r|S t j � | � � t v r|S t j � | � � \ }}|g}|r||rzt j � |� � s[t j � |� � \ }}|� d|� � |r!|rt j � |� � �[|D �]}t j � ||� � }t j � |� � } | t v r�L|dk rt j d|� � |s� t j ||� � nk# t $ r^} | j t j k rt j � |� � s t% d|� d| j d � �� � �Y d } ~ nd } ~ ww xY w|� |� � t � | � � ��|S )a� Create a directory and any missing ancestor directories. If the directory already exists (or if 'name' is the empty string, which means the current directory, which of course exists), then do nothing. Raise DistutilsFileError if unable to create some directory along the way (eg. some sub-path exists, but is a file rather than a directory). If 'verbose' is true, print a one-line summary of each mkdir to stdout. Return the list of directories actually created. os.makedirs is not used because: a) It's new to Python 1.5.2, and b) it blows up if the directory already exists (in which case it should silently succeed). z%mkpath: 'name' must be a string (got �)� r r zcreating %szcould not create '�': ���N)� isinstance�strr �os�path�normpath�isdir�abspath� _path_created�split�insert�joinr �info�mkdir�OSError�errno�EEXISTr �args�append�add)�name�mode�verbose�dry_run�created_dirs�head�tail�tails�d�abs_head�excs �U/opt/cloudlinux/venv/lib64/python3.11/site-packages/setuptools/_distutils/dir_util.py�mkpathr, sW � �( �d�C� � � X�$�%V�T�%V�%V�%V�W�W�W� �7���D�!�!�D��L� �w�}�}�T��� �d�b�j�j��� �w���t��� �-�-����7�=�=��&�&�L�T�4� �F�E� � �4� ��� � �d� 3� 3� ��w�}�}�T�*�*���t� ���Q����� � �4� ��� � �d� 3� 3� � � $� $���w�|�|�D�!�$�$���7�?�?�4�(�(���}�$�$���a�<�<��H�]�D�)�)�)�� &� ����t�$�$�$�$��� � � �� �U�\�1�1�b�g�m�m�D�6I�6I�1�,�D�T�D�D�c�h�r�l�D�D�� � � 2�1�1�1�1����� ���� ����%�%�%����(�#�#�#�#��s �(F>�> H&�AH!�!H&c � � � t � fd�|D � � � � }t |� � D ]}t ||||�� � �dS )a� Create all the empty directories under 'base_dir' needed to put 'files' there. 'base_dir' is just the name of a directory which doesn't necessarily exist yet; 'files' is a list of filenames to be interpreted relative to 'base_dir'. 'base_dir' + the directory portion of every file in 'files' will be created if it doesn't already exist. 'mode', 'verbose' and 'dry_run' flags are as for 'mkpath()'. c 3 � �K � | ]A}t j � �t j � |� � � � V � �Bd S )N)r r r �dirname)�.0�file�base_dirs �r+ � <genexpr>zcreate_tree.<locals>.<genexpr>a sA �� � � �S�S�T�2�7�<�<��"�'�/�/�$�*?�*?�@�@�S�S�S�S�S�S� �r"