
    O&i                         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m	Z	  ej
                    p ej                    ZdefdZ e            Z G d de          ZdS )    N)IOAnyCallableListOptionalreturnc                  V    t          j        d          } t          j        |            | S )zGet current umask valuer   )osumask)r   s    `/home/geonatureadmin/si_en_reseau/tutos/venv/lib/python3.11/site-packages/sphinx/testing/path.pygetumaskr   
   s!    HQKKEHUOOOL    c            	           e Zd ZdZed.d            ZdefdZd.dZde	fdZ
de	fdZde	fdZde	fd	Zde	fd
Zd/de	dee         ddfdZd0dede	ddfdZdeddfdZeZd1dZdefdZdeddfdZd2dededefdZd3dedededdfdZd3dededefd Zdej        fd!Zd0d"ed#e	ddfd$Z de	fd%Z!de	fd&Z"d4de#d(e	ddfd)Z$d*edd fd+Z%de&e         fd,Z'e%xZ(Z)def fd-Z* xZ+S )5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   c                 @    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.abspath$   s$     ~~bgood33444r   c                 @    t           j                            |           S )z;
        Returns ``True`` if the path is absolute.
        )r
   r   isabsr   s    r   r   z
path.isabs*        w}}T"""r   c                 @    t           j                            |           S )z>
        Returns ``True`` if the path is a directory.
        )r
   r   isdirr   s    r   r    z
path.isdir0   r   r   c                 @    t           j                            |           S )z9
        Returns ``True`` if the path is a file.
        )r
   r   isfiler   s    r   r"   zpath.isfile6        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.islink<   r#   r   c                 @    t           j                            |           S )z@
        Returns ``True`` if the path is a mount point.
        )r
   r   ismountr   s    r   r'   zpath.ismountB   s     wt$$$r   FNignore_errorsonerrorc                 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(   r)   N)shutilrmtree)r   r(   r)   s      r   r,   zpath.rmtreeH   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.
        )r.   SPHINX_READONLY_TESTDIRi  i  N)
r+   copytreer
   environgetwalkchmodUMASKr   join)r   r-   r.   root_dirsfilesnames          r   r1   zpath.copytreeZ   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)r+   move)r   r-   s     r   movetreezpath.movetreep   s     	D+&&&&&r   c                 .    t          j        |            dS )z!
        Removes a file.
        N)r
   unlinkr   s    r   r@   zpath.unlink|   s     		$r   c                 *    t          j        |           S )z-
        Returns a stat of the file.
        )r
   statr   s    r   rB   z	path.stat   s     wt}}r   argc                 0    t          j        | |           d S r   )r
   utime)r   rC   s     r   rE   z
path.utime   s    
sr   rmodekwargsc                     t          | |fi |S r   )open)r   rG   rH   s      r   rJ   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.
        wrM   NrJ   write)r   rL   rM   rH   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.
        rM   NrJ   read)r   rM   rH   rR   s       r   	read_textzpath.read_text   s     $444V44 	6688	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	s   155c                     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rG   NrU   )r   rR   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wbrZ   NrP   )r   r\   r]   rG   rR   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   rc   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   re   zpath.lexists   s    
 wt$$$r     exist_okc                 4    t          j        | ||           dS )z1
        Recursively create directories.
        )rg   N)r
   makedirs)r   rG   rg   s      r   ri   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   r7   map)r   rj   s     r   joinpathzpath.joinpath   s6     ~~bgl4L#dnd2K2KLLLMMMr   c                 *    t          j        |           S r   )r
   listdirr   s    r   ro   zpath.listdir   s    z$r   c                 d    | j         j        dt                                                      dS )N())r   __name__super__repr__)r   r   s    r   ru   zpath.__repr__   s/    >222EGG4D4D4F4F4F4FGGr   )r   r   )FN)F)r   N)rF   )rK   )rf   F),rs   
__module____qualname____doc__propertyr   strr   r   boolr   r    r"   r%   r'   r   r   r,   r1   r>   r=   r@   r   rB   rE   r   rJ   rS   rW   builtinsr\   r[   ra   rc   re   intri   rm   r   ro   __div____truediv__ru   __classcell__)r   s   @r   r   r      s         5 5 5 X5&# & & & &5 5 5 5#t # # # ##t # # # #$ $ $ $ $$ $ $ $ $% % % % %J JD J8H;M JY] J J J J$G GC G4 GD G G G G,'C 'D ' ' ' ' D   c         * * *c *b * * * * s c s t     # 3 3    HN      d t    $ $ $ $ $% % % % %3 3S 3D 3T 3 3 3 3Nc Nf N N N N c         %$GkH# H H H H H H H H H Hr   r   )r|   r
   r+   systypingr   r   r   r   r   getfilesystemencodinggetdefaultencodingFILESYSTEMENCODINGr}   r   r6   rz   r    r   r   <module>r      s     				  



 4 4 4 4 4 4 4 4 4 4 4 4 4 4.S.00L4JC4J4L4L #     	

{H {H {H {H {H3 {H {H {H {H {Hr   