| Server IP : 127.0.0.1 / Your IP : 216.73.216.109 Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10 System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64 User : SERVERWEB ( 0) PHP Version : 8.1.10 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : C:/cygwin64/lib/python3.9/site-packages/sphinx/testing/__pycache__/ |
Upload File : |
a
�ab� � @ s� d Z ddlZddlZddlZddlZddlZddlmZmZm Z m
Z
ddlmZ e�
� p^e�� Zed�dd�Ze� ZG dd � d e�ZdS )
z�
sphinx.testing.path
~~~~~~~~~~~~~~~~~~~
:copyright: Copyright 2007-2022 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 �7/usr/lib/python3.9/site-packages/sphinx/testing/path.py�getumask s
r
c s� e Zd ZdZed d�dd��Zed�dd�Zd d�dd�Ze d�d d
�Z
e d�dd�Ze d�d
d�Ze d�dd�Z
e d�dd�ZdHe edd�dd�ZdIee dd�dd�Zedd�dd�ZeZdd�dd�Zed�d d!�Zedd"�d#d$�ZdJeeed&�d'd(�ZdKeeedd*�d+d,�ZdLeeed-�d.d/�ZdMeeed-�d0d1�Zejd�d2d3�Zejd�d4d5�ZdNee dd6�d7d8�Z e d�d9d:�Z!e d�d;d<�Z"dOe#e dd>�d?d@�Z$ed dA�dBdC�Z%e&e d�dDdE�Z'e% Z(Z)ed�� fdFdG�Z*� Z+S )P�pathz8
Represents a path which behaves like a string.
r c C s | � 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 s t j�| �S �N)r r �basenamer r r r r , s z
path.basenamec C s | � tj�| ��S )z,
Returns the absolute path.
)r r r �abspathr r r r r / s zpath.abspathc C s t j�| �S )z;
Returns ``True`` if the path is absolute.
)r r �isabsr r r r r 5 s z
path.isabsc C s t j�| �S )z>
Returns ``True`` if the path is a directory.
)r r �isdirr r r r r ; s z
path.isdirc C s t j�| �S )z9
Returns ``True`` if the path is a file.
)r r �isfiler r r r r A s zpath.isfilec C s t j�| �S )zB
Returns ``True`` if the path is a symbolic link.
)r r �islinkr r r r r G s zpath.islinkc C s t j�| �S )z@
Returns ``True`` if the path is a mount point.
)r r �ismountr r r r r M s zpath.ismountFN)�
ignore_errors�onerrorr c C s 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 S s zpath.rmtree)�destination�symlinksr c C sn t j| ||d� tj�d�rjt�|�D ]B\}}}t�|dt @ � |D ] }t�tj� ||�dt @ � qFq&dS )a~
Recursively copy a directory to the given `destination`. If the given
`destination` does not exist it will be created.
:param symlinks:
If ``True`` symbolic links in the source tree result in symbolic
links in the destination tree otherwise the contents of the files
pointed to by the symbolic links are copied.
)r! ZSPHINX_READONLY_TESTDIRi� i� N)
r �copytreer �environ�get�walk�chmod�UMASKr �join)r r r! �rootZ_dirs�files�namer r r r"