
    -PhF                       d dl mZ d dlZd dlZd dlZd dlZd dlmZ d dlm	Z	 erd dl
Z
d dlmZ d dlmZmZ  ej        de	d	            ej                    p ej                    ZddZ e            Z G d de          ZdS )    )annotationsN)TYPE_CHECKING)RemovedInSphinx90Warning)Callable)IOAnyzH'sphinx.testing.path' is deprecated. Use 'os.path' or 'pathlib' instead.   )
stacklevelreturnintc                 V    t          j        d          } t          j        |            | S )zGet current umask valuer   )osumask)r   s    S/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/sphinx/testing/path.pygetumaskr      s!    HQKKEHUOOOL    c                  &    e Zd ZdZdZed8d            Zd9dZd8dZd:d	Z	d:d
Z
e
Zd:dZeZd:dZeZd:dZeZ	 	 d;d<dZd=d>dZd?dZeZd@dZdAdZdBdZdCdDd"ZdEdFd&ZdEdGd'ZdHd)Zd=dId,Zd:d-Zd:d.ZdJdKd2Z dLd4Z!dMd6Z"e!xZ#Z$d9 fd7Z% xZ&S )Npathz.Represents a path which behaves like a string. r   c                f    |                      t          j                            |                     S )z6The name of the directory the file or directory is in.)	__class__r   r   dirnameselfs    r   parentzpath.parent)   s$     ~~bgood33444r   strc                @    t           j                            |           S N)r   r   basenamer   s    r   r   zpath.basename.   s    w%%%r   c                f    |                      t          j                            |                     S )zReturns the absolute path.)r   r   r   abspathr   s    r   r!   zpath.abspath1   s"    ~~bgood33444r   boolc                @    t           j                            |           S )z)Returns ``True`` if the path is absolute.)r   r   isabsr   s    r   r$   z
path.isabs5       w}}T"""r   c                @    t           j                            |           S )z,Returns ``True`` if the path is a directory.)r   r   isdirr   s    r   r'   z
path.isdir9   r%   r   c                @    t           j                            |           S )z'Returns ``True`` if the path is a file.)r   r   isfiler   s    r   r)   zpath.isfile?       w~~d###r   c                @    t           j                            |           S )z0Returns ``True`` if the path is a symbolic link.)r   r   islinkr   s    r   r,   zpath.islinkE   r*   r   c                @    t           j                            |           S )z.Returns ``True`` if the path is a mount point.)r   r   ismountr   s    r   r.   zpath.ismountK   s    wt$$$r   FNignore_errorsonerror7Callable[[Callable[..., Any], str, Any], object] | NoneNonec                4    t          j        | ||           dS )ac  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/   r0   N)shutilrmtree)r   r/   r0   s      r   r5   zpath.rmtreeQ   s!    & 	d-IIIIIIr   destinationsymlinksc                j   t          j        | ||           t          j                            d          rzt          j        |          D ]g\  }}}t          j        |dt           z             |D ]>}t          j        t          j        	                    ||          dt           z             ?fdS dS )au  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.
        )r7   SPHINX_READONLY_TESTDIRi  i  N)
r4   copytreer   environgetwalkchmodUMASKr   join)r   r6   r7   root_dirsfilesnames          r   r:   zpath.copytreef   s     	kH====:>>344 		G ')gk&:&: G G"eUuv~...! G GDHRW\\$55uv~FFFFG		G 		GG Gr   c                0    t          j        | |           dS )zRecursively move the file or directory to the given `destination`
        similar to the  Unix "mv" command.

        If the `destination` is a file it may be overwritten depending on the
        :func:`os.rename` semantics.
        N)r4   move)r   r6   s     r   movetreezpath.movetree{   s     	D+&&&&&r   c                .    t          j        |            dS )zRemoves a file.N)r   unlinkr   s    r   rI   zpath.unlink   s    
	$r   r   c                *    t          j        |           S )zReturns a stat of the file.)r   statr   s    r   rK   z	path.stat   s    wt}}r   argc                0    t          j        | |           d S r   )r   utime)r   rL   s     r   rN   z
path.utime   s    
sr   rmodekwargsIO[str]c                    t          | |fi |S r   )open)r   rP   rQ   s      r   rT   z	path.open   s    D$))&)))r   utf-8textencodingc                    t          | dfd|i|5 }|                    |           ddd           dS # 1 swxY w Y   dS )z$Writes the given `text` to the file.wrW   NrT   write)r   rV   rW   rQ   fs        r   
write_textzpath.write_text   s    $99h9&99 	QGGDMMM	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   488c                |    t          | fd|i|5 }|                                cddd           S # 1 swxY w Y   dS )zReturns the text in the file.rW   NrT   read)r   rW   rQ   r\   s       r   	read_textzpath.read_text   s    $444V44 	6688	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   155builtins.bytesc                    t          | d          5 }|                                cddd           S # 1 swxY w Y   dS )zReturns the bytes in the file.rbrP   Nr_   )r   r\   s     r   
read_byteszpath.read_bytes   s    $T""" 	a6688	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   377bytesappendc                    |rd}nd}t          | |          5 }|                    |           ddd           dS # 1 swxY w Y   dS )zWrites the given `bytes` to the file.

        :param append:
            If ``True`` given `bytes` are added at the end of the file.
        abwbre   NrZ   )r   rg   rh   rP   r\   s        r   write_byteszpath.write_bytes   s      	DDD$T""" 	aGGENNN	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   <A A c                @    t           j                            |           S )z#Returns ``True`` if the path exist.)r   r   existsr   s    r   rn   zpath.exists   r*   r   c                @    t           j                            |           S )zYReturns ``True`` if the path exists unless it is a broken symbolic
        link.
        )r   r   lexistsr   s    r   rp   zpath.lexists   s     wt$$$r     r   exist_okc                4    t          j        | ||           dS )zRecursively create directories.)rr   N)r   makedirs)r   rP   rr   s      r   rt   zpath.makedirs   s    
D$222222r   argsc           	     |    |                      t          j        j        | gt	          | j         |          R            S )z>Joins the path with the argument given and returns the result.)r   r   r   r@   map)r   ru   s     r   joinpathzpath.joinpath   s4    ~~bgl4L#dnd2K2KLLLMMMr   	list[str]c                *    t          j        |           S r   )r   listdirr   s    r   r{   zpath.listdir   s    z$r   c                d    | j         j         dt                                                       dS )N())r   __name__super__repr__)r   r   s    r   r   zpath.__repr__   s/    .)AAEGG,<,<,>,>AAAAr   )r   r   )r   r   )r   r"   )FN)r/   r"   r0   r1   r   r2   )F)r6   r   r7   r"   r   r2   )r6   r   r   r2   )r   r2   )r   r   )rL   r   r   r2   )rO   )rP   r   rQ   r   r   rR   )rU   )rV   r   rW   r   rQ   r   r   r2   )rW   r   rQ   r   r   r   )r   rb   )rg   rg   rh   r"   r   r2   )rq   F)rP   r   rr   r"   r   r2   )ru   r   r   r   )r   ry   )'r   
__module____qualname____doc__	__slots__propertyr   r   r!   r$   r'   is_dirr)   is_filer,   
is_symlinkr.   is_mountr5   r:   rG   rF   rI   rK   rN   rT   r]   ra   rf   rl   rn   rp   rt   rx   r{   __div____truediv__r   __classcell__)r   s   @r   r   r   $   s       88I5 5 5 X5& & & &5 5 5 5# # # ## # # # F$ $ $ $ G$ $ $ $ J% % % % H $KOJ J J J J*G G G G G*' ' ' ' D         * * * * *    
    
   
    $ $ $ $% % % %3 3 3 3 3N N N N        %$GkB B B B B B B B B Br   r   )r   r   )
__future__r   r   r4   syswarningstypingr   sphinx.deprecationr   builtinscollections.abcr   r   r   warngetfilesystemencodinggetdefaultencodingFILESYSTEMENCODINGr   r?   r   r   r   r   r   <module>r      sK   " " " " " " 				  



              7 7 7 7 7 7 OOO(((((( N    /S.00L4JC4J4L4L     	

dB dB dB dB dB3 dB dB dB dB dBr   