
    7 f                        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mZm	Z	m
Z
 d dlmZ erd dl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)IOTYPE_CHECKINGAnyCallable)RemovedInSphinx90WarningzH'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    I/var/www/equiseq/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
d:dZd:dZd:d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pathz8
    Represents a path which behaves like a string.
     r   c                f    |                      t          j                            |                     S )zH
        The 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.isabs7        w}}T"""r   c                @    t           j                            |           S )z>
        Returns ``True`` if the path is a directory.
        )r   r   isdirr   s    r   r'   z
path.isdir=   r%   r   c                @    t           j                            |           S )z9
        Returns ``True`` if the path is a file.
        )r   r   isfiler   s    r   r)   zpath.isfileC        w~~d###r   c                @    t           j                            |           S )zB
        Returns ``True`` if the path is a symbolic link.
        )r   r   islinkr   s    r   r,   zpath.islinkI   r*   r   c                @    t           j                            |           S )z@
        Returns ``True`` if the path is a mount point.
        )r   r   ismountr   s    r   r.   zpath.ismountO   s     wt$$$r   FNignore_errorsonerrorCallable | NoneNonec                4    t          j        | ||           dS )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/   r0   N)shutilrmtree)r   r/   r0   s      r   r5   zpath.rmtreeU   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 )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.
        )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.copytreeg   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 )z
        Recursively 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kwargsr   c                    t          | |fi |S r   )open)r   rP   rQ   s      r   rS   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 )z6
        Writes the given `text` to the file.
        wrV   NrS   write)r   rU   rV   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.
        rV   NrS   read)r   rV   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 )z0
        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 )z
        Writes the given `bytes` to the file.

        :param append:
            If ``True`` given `bytes` are added at the end of the file.
        abwbrd   NrY   )r   rf   rg   rP   r[   s        r   write_byteszpath.write_bytes   s      	DDD$T""" 	aGGENNN	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   <A A c                @    t           j                            |           S )z5
        Returns ``True`` if the path exist.
        )r   r   existsr   s    r   rm   zpath.exists   r*   r   c                @    t           j                            |           S )zb
        Returns ``True`` if the path exists unless it is a broken symbolic
        link.
        )r   r   lexistsr   s    r   ro   zpath.lexists   s    
 wt$$$r     r   exist_okc                4    t          j        | ||           dS )z1
        Recursively create directories.
        )rq   N)r   makedirs)r   rP   rq   s      r   rs   zpath.makedirs   s!     	D$222222r   argsc           	     |    |                      t          j        j        | gt	          | j         |          R            S )zP
        Joins the path with the argument given and returns the result.
        )r   r   r   r@   map)r   rt   s     r   joinpathzpath.joinpath   s6     ~~bgl4L#dnd2K2KLLLMMMr   	list[str]c                *    t          j        |           S r   )r   listdirr   s    r   rz   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   r   )rT   )rU   r   rV   r   rQ   r   r   r2   )rV   r   rQ   r   r   r   )r   ra   )rf   r   rg   r"   r   r2   )rp   F)rP   r   rq   r"   r   r2   )rt   r   r   r   )r   rx   )#r~   
__module____qualname____doc__	__slots__propertyr   r   r!   r$   r'   r)   r,   r.   r5   r:   rG   rF   rI   rK   rN   rS   r\   r`   re   rk   rm   ro   rs   rw   rz   __div____truediv__r   __classcell__)r   s   @r   r   r       s         I5 5 5 X5& & & &5 5 5 5# # # ## # # #$ $ $ $$ $ $ $% % % %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   r   r   r   sphinx.deprecationr   builtinswarngetfilesystemencodinggetdefaultencodingFILESYSTEMENCODINGr   r?   r   r   r   r   r   <module>r      s4   " " " " " " 				  



  3 3 3 3 3 3 3 3 3 3 3 3 7 7 7 7 7 7 OOO  4&16 6 6 6 /S.00L4JC4J4L4L     	

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