File: //usr/lib/python3/dist-packages/sphinx/testing/__pycache__/path.cpython-310.pyc
o
$�a� � @ s� d Z ddlZddlZddlZddlZddlZddlmZmZm Z m
Z
ddlmZ e�
� p/e�� Zdefdd�Ze� ZG dd � d e�ZdS )
z�
sphinx.testing.path
~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
� N)�IO�Any�Callable�List)�RemovedInSphinx50Warning�returnc C s t �d�} t �| � | S )zGet current umask valuer )�os�umask)r � r
�5/usr/lib/python3/dist-packages/sphinx/testing/path.py�getumask s
r c s� e Zd ZdZedKdd��Zdefdd�ZdKdd�Zde fd d
�Z
de fdd�Zde fd
d�Zde fdd�Z
de fdd�ZdLde deddfdd�ZdMdede ddfdd�Zdeddfdd�ZeZdNdd �Zdefd!d"�Zd#eddfd$d%�ZdOd'ed(edefd)d*�ZdPd,ed-ed(eddfd.d/�ZdPd-ed(edefd0d1�ZdPd-ed(edefd2d3�Zdejfd4d5�Zdejfd6d7�ZdMd8ed9e ddfd:d;�Z de fd<d=�Z!de fd>d?�Z"dQd'e#dAe ddfdBdC�Z$dDedd fdEdF�Z%de&e fdGdH�Z'e% Z(Z)def� fdIdJ�Z*� Z+S )R�pathz8
Represents a path which behaves like a string.
r c C � | � tj�| ��S )zH
The name of the directory the file or directory is in.
)� __class__r r
�dirname��selfr
r
r �parent% s zpath.parentc C � t j�| �S �N)r r
�basenamer r
r
r r , s z
path.basenamec C r )z,
Returns the absolute path.
)r r r
�abspathr r
r
r r / s zpath.abspathc C r )z;
Returns ``True`` if the path is absolute.
)r r
�isabsr r
r
r r 5 � z
path.isabsc C r )z>
Returns ``True`` if the path is a directory.
)r r
�isdirr r
r
r r ; r z
path.isdirc C r )z9
Returns ``True`` if the path is a file.
)r r
�isfiler r
r
r r A r zpath.isfilec C r )zB
Returns ``True`` if the path is a symbolic link.
)r r
�islinkr r
r
r r G r zpath.islinkc C r )z@
Returns ``True`` if the path is a mount point.
)r r
�ismountr r
r
r r M r zpath.ismountFN�
ignore_errors�onerrorc C � t j| ||d� dS )al
Removes the file or directory and any files or directories it may
contain.
:param ignore_errors:
If ``True`` errors are silently ignored, otherwise an exception
is raised in case an error occurs.
:param onerror:
A callback which gets called with the arguments `func`, `path` and
`exc_info`. `func` is one of :func:`os.listdir`, :func:`os.remove`
or :func:`os.rmdir`. `path` is the argument to the function which
caused it to fail and `exc_info` is a tuple as returned by
:func:`sys.exc_info`.
)r r N)�shutil�rmtree)r r r r
r
r r"