ruạṛ
a �u:jD � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZ ddl m Z mZ G dd� de�Z e � jZejedejdd�d d���Zejed�dd��Zejdd�dd��Zd dd�Zd!dd�Zdd� Zdd� Zd"dd�Zdd� ZdS )#zWdistutils.dir_util Utility functions for manipulating directories and directory trees.� N� )� file_util)�log)�DistutilsFileError�DistutilsInternalErrorc s4 e Zd ZdZdd� Ze� fdd��Zdd� Z� ZS )�SkipRepeatAbsolutePathsz� Cache for mkpath. In addition to cheapening redundant calls, eliminates redundant "creating /foo/bar/baz" messages in dry-run mode. c C s | t _d S �N)r �instance)�self� r �Q/opt/bart/bart_venv/lib/python3.9/site-packages/setuptools/_distutils/dir_util.py�__init__ s z SkipRepeatAbsolutePaths.__init__c s t | | j��� d S r )�superr �clear)�cls�� __class__r r r s zSkipRepeatAbsolutePaths.clearc s t �� �� �fdd��}|S )Nc s8 | � � �v rd S � | g|�R i |��}��| � � � |S r )�absolute�add)�path�args�kwargs�result��funcr r r �wrapper s z-SkipRepeatAbsolutePaths.wrap.<locals>.wrapper)� functools�wraps)r r r r r r �wrap s zSkipRepeatAbsolutePaths.wrap) �__name__� __module__�__qualname__�__doc__r �classmethodr r � __classcell__r r r r r s r � TF)�name�returnc C st |r| � � st�d| � z|p,| j|ddd� W n> tyn } z&td| � d|jd � ���W Y d}~n d}~0 0 dS )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, log the directory created. zcreating %sT)�mode�parents�exist_okzcould not create '�': ���N)�is_dirr �info�mkdir�OSErrorr r )r&