
    ,i+%                       d dl mZ d dlZd dlZd dlZd dlmZmZ d dlm	Z	 d dl
mZmZmZmZmZmZmZmZmZ d dlmZmZ d dlmZ d dlmZ erHd d	lmZmZmZ d d
lm Z m!Z!m"Z"m#Z#m$Z$ d dl%m&Z&m'Z'm(Z(m)Z)m*Z* d dl+m,Z,m-Z-  e,d      Z. edd      Z/ ed      Z0	 	 	 	 ddZ1	 	 	 	 ddZ2	 	 	 	 ddZ3	 	 	 	 d dZ4 G d dejj                        Z6e6jn                  jp                  r5e6jn                  jp                  js                  dd      e6jn                  _8        e G d de6ejt                               Z;e G d de6ejx                               Z=y)!    )annotationsN)partialupdate_wrapper)cleandoc)	IOTYPE_CHECKINGAnyBinaryIOClassVarConcatenateLiteralTypeVaroverload)AsyncIOWrapper	wrap_file)final)run_sync)	AwaitableCallableIterable)BufferedRandomBufferedReaderBufferedWriterFileIOTextIOWrapper)OpenBinaryModeOpenBinaryModeReadingOpenBinaryModeUpdatingOpenBinaryModeWritingOpenTextMode)	ParamSpecSelfPPathTPath)boundTc                     d fd}|S )Nc                *    d fd}t        |       j                  rrj                  }|j                  dd      }|j                  dd      }j                  }|j                  dd      }d| d| d	t        j                         d
|_        |S )Nc                 P   K   t        t        g| i |       d {   S 7 wN)r   r   )argskwargsfns     Y/var/www/system.tvplus.app.br/jogos/scrap/venv/lib/python3.12/site-packages/trio/_path.pywrapperz0_wraps_async.<locals>.decorator.<locals>.wrapper/   s'     !'"">t">v">????s   &$&zpathlib._localpathlibzpathlib._abcPathBaser%   zLike :meth:`~.z`, but async.


)r,   P.argsr-   P.kwargsreturnr'   )r   __doc__
__module__replace__qualname__r   )r.   r0   modulenamewrappeds   `   r/   	decoratorz_wraps_async.<locals>.decorator.   s    	@ 	w(??''F^^$4i@F^^NI>F''D<<FD
  xq /GOO,-R1 O
     )r.   zCallable[P, T]r7   zCallable[P, Awaitable[T]] )r>   r?   s   ` r/   _wraps_asyncrB   +   s    . r@   c                0     t               d fd       }|S )Nc               :     | j                  |       g|i |S r+   )_wrapped_clsselfr,   r-   r.   s      r/   r0   z_wrap_method.<locals>.wrapperK   s#    $##D);D;F;;r@   )rG   r%   r,   r5   r-   r6   r7   r'   rB   r.   r0   s   ` r/   _wrap_methodrJ   H   s#     "< < Nr@   c                0     t               d fd       }|S )Nc               X    | j                   | j                  |       g|i |      S r+   )	__class__rE   rF   s      r/   r0   z"_wrap_method_path.<locals>.wrapperU   s,    ~~b!2!24!8J4J6JKKr@   )rG   r$   r,   r5   r-   r6   r7   r$   rH   rI   s   ` r/   _wrap_method_pathrN   R   s%     "L L Nr@   c                     t               d fd       }|j                  r#|xj                  d j                   dz  c_        |S )Nc          	     f    t        | j                  g  | j                  |       g|i |      S r+   )maprM   rE   rF   s      r/   r0   z+_wrap_method_path_iterable.<locals>.wrapper_   s4    4>>#RR(9(9$(?%Q$%Q&%Q#RSSr@   z
This is an async method that returns a synchronous iterator, so you
use it like:

.. code:: python

    for subpath in await mypath.z():
        ...

.. note::

    The iterator is loaded into memory immediately during the initial
    call (see `issue #501
    <https://github.com/python-trio/trio/issues/501>`__ for discussion).
)rG   r$   r,   r5   r-   r6   r7   zIterable[PathT])rB   r8   __name__rI   s   ` r/   _wrap_method_path_iterablerS   \   sX     "T T / 02{{m <YZ	
  Nr@   c                      e Zd ZU dZdZded<   d fdZe ee	j                  j                        dd              Ze ee	j                  j                        dd              Ze	 	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd       Ze	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd	       Ze	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd
       Ze	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd       Ze	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd       Ze	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 dd       Ze	 	 	 	 d	 	 	 	 	 	 	 	 	 	 	 d d       Z ee	j                  j                        d!d       Zd"dZ ee	j                  j"                        Z ee	j                  j$                        Z ee	j                  j&                        Z ee	j                  j*                        Z ee	j                  j,                        Z ee	j                  j.                        Z ee	j                  j0                        Z ee	j                  j2                        Z ee	j                  j4                        Z ee	j                  j6                        Z ee	j                  j8                        Z ee	j                  j:                        Zej>                  dk\  r ee	j                  j@                        Z  ee	j                  jB                        Z! ee	j                  jD                        Z" ee	j                  jF                        Z# ee	j                  jH                        Z$ejJ                  dk7  r8 ee	j                  jL                        Z& ee	j                  jN                        Z'ejJ                  dk7  sej>                  dk\  r ee	j                  jP                        Z( e)e	j                  jT                        Z* e)e	j                  jV                        Z+ e)e	j                  jX                        Z, e)e	j                  jZ                        Z- ee	j                  j\                        Z. ee	j                  j^                        Z/ ee	j                  j`                        Z0 ee	j                  jb                        Z1 ee	j                  jd                        Z2 e)e	j                  jf                        Z3 e)e	j                  jh                        Z4 ee	j                  jj                        Z5 ee	j                  jl                        Z6 ee	j                  jn                        Z7 ee	j                  jp                        Z8 ee	j                  jr                        Z9ej>                  dk  r ee	j                  jt                        Z:ej>                  dk\  r ee	j                  jv                        Z;d"dZ< xZ=S )#r%   zAn async :class:`pathlib.Path` that executes blocking methods in :meth:`trio.to_thread.run_sync`.

    Instantiating :class:`Path` returns a concrete platform-specific subclass, one of :class:`PosixPath` or
    :class:`WindowsPath`.
    rA   ClassVar[type[pathlib.Path]]rE   c                r    | t         u rt        j                  dk(  rt        nt        } t        |   | g| S )Nnt)r%   osr=   WindowsPath	PosixPathsuper__new__)clsr,   rM   s     r/   r\   zPath.__new__   s/    $;!#D+iCws*T**r@   c                J     | t         j                  j                               S r+   )r1   r%   cwdr]   s    r/   r_   zPath.cwd   s     7<<##%&&r@   c                J     | t         j                  j                               S r+   )r1   r%   homer`   s    r/   rb   z	Path.home   s     7<<$$&''r@   c                   K   y wr+   rA   rG   mode	bufferingencodingerrorsnewlines         r/   openz	Path.open   s      ),   c                   K   y wr+   rA   rd   s         r/   rj   z	Path.open   s      "%rk   c                   K   y wr+   rA   rd   s         r/   rj   z	Path.open         *-rk   c                   K   y wr+   rA   rd   s         r/   rj   z	Path.open   rn   rk   c                   K   y wr+   rA   rd   s         r/   rj   z	Path.open   rn   rk   c                   K   y wr+   rA   rd   s         r/   rj   z	Path.open   s      $'rk   c                   K   y wr+   rA   rd   s         r/   rj   z	Path.open   s      #&rk   c                V    t         | j                  |       j                  |i |      S r+   )r   rE   rj   )rG   r,   r-   s      r/   rj   z	Path.open   s+    5**4055tFvFGGr@   c                     dt        |       dS )Nz
trio.Path())strrG   s    r/   __repr__zPath.__repr__   s    CI=**r@   )      win32)ry      c                @    t         j                  j                  |       S r+   )r1   r%   as_urirw   s    r/   r~   zPath.as_uri
  s    ||""4((r@   )r,   zstr | os.PathLike[str]r7   r"   )r7   r"   )rNNN)re   r    rf   intrg   
str | Nonerh   r   ri   r   r7   zAsyncIOWrapper[TextIOWrapper])NNN)re   r   rf   z
Literal[0]rg   Nonerh   r   ri   r   r7   zAsyncIOWrapper[FileIO])r   NNN)re   r   rf   Literal[-1, 1]rg   r   rh   r   ri   r   r7   zAsyncIOWrapper[BufferedRandom])re   r   rf   r   rg   r   rh   r   ri   r   r7   zAsyncIOWrapper[BufferedWriter])re   r   rf   r   rg   r   rh   r   ri   r   r7   zAsyncIOWrapper[BufferedReader])re   r   rf   r   rg   r   rh   r   ri   r   r7   zAsyncIOWrapper[BinaryIO])re   rv   rf   r   rg   r   rh   r   ri   r   r7   AsyncIOWrapper[IO[Any]])r,   r	   r-   r	   r7   r   )r7   rv   )>rR   r9   r;   r8   	__slots____annotations__r\   classmethodrB   r1   r%   r_   rb   r   rj   rx   rJ   statchmodexistsrS   globrglobis_diris_file
is_symlink	is_socketis_fifois_block_deviceis_char_devicesysversion_infois_junctioniterdirlchmodlstatmkdirplatformownergroupis_mountrN   readlinkrenamer:   resolvermdir
symlink_tohardlink_totouchunlinkabsolute
expanduser
read_bytes	read_textsamefilewrite_bytes
write_textlink_to
full_matchr~   __classcell__)rM   s   @r/   r%   r%   w   sl    I..+
 ',,""#' $ ' ',,##$( % (  !#!",, , 	,
 , , 
', , 
 %% % 	%
 % % 
 % %  %'-$- "- 	-
 - - 
(- -  %'-#- "- 	-
 - - 
(- -  %'-#- "- 	-
 - - 
(- -  '' ' 	'
 ' ' 
"' '  #!"&& & 	&
 & & 
!& & ',,##$H %H+ ))*D++,E',,--.F%gll&7&78D&w||'9'9:E',,--.F7<<//0Ggll556JW\\334I7<<//0G"7<<#?#?@O!',,"="=>N
7""7<<#;#;<()=)=>G',,--.F++,E++,E
||wW\\//0W\\//0
||w#"2"2g"= 5 56 !6!67Hw||223F 4 45G 4 45G++,Egll556Jw||778K++,E',,--.F !6!67H"7<<#:#:;Jgll556JW\\334IGLL112Hw||778Kgll556J
'!w||334
7"!',,"9"9:
)r@   z `..` z ``..`` c                  8    e Zd ZU dZdZej                  Zded<   y)rZ   zfAn async :class:`pathlib.PosixPath` that executes blocking methods in :meth:`trio.to_thread.run_sync`.rA   rU   rE   N)	rR   r9   r;   r8   r   r1   rZ   rE   r   rA   r@   r/   rZ   rZ     s    pI181B1BL.Br@   rZ   c                  8    e Zd ZU dZdZej                  Zded<   y)rY   zhAn async :class:`pathlib.WindowsPath` that executes blocking methods in :meth:`trio.to_thread.run_sync`.rA   rU   rE   N)	rR   r9   r;   r8   r   r1   rY   rE   r   rA   r@   r/   rY   rY     s    rI181D1DL.Dr@   rY   )r>   zCallable[..., object]r7   z5Callable[[Callable[P, T]], Callable[P, Awaitable[T]]])r.   z)Callable[Concatenate[pathlib.Path, P], T]r7   z,Callable[Concatenate[Path, P], Awaitable[T]])r.   z4Callable[Concatenate[pathlib.Path, P], pathlib.Path]r7   z1Callable[Concatenate[PathT, P], Awaitable[PathT]])r.   z>Callable[Concatenate[pathlib.Path, P], Iterable[pathlib.Path]]r7   z;Callable[Concatenate[PathT, P], Awaitable[Iterable[PathT]]])>
__future__r   rX   r1   r   	functoolsr   r   inspectr   typingr   r   r	   r
   r   r   r   r   r   trio._file_ior   r   
trio._utilr   trio.to_threadr   collections.abcr   r   r   ior   r   r   r   r   	_typeshedr   r   r   r   r    typing_extensionsr!   r"   r#   r$   r'   rB   rJ   rN   rS   PurePathr%   relative_tor8   r:   PurePosixPathrZ   PureWindowsPathrY   rA   r@   r/   <module>r      sZ   " 	  
 - 
 
 
 4  #==XX  2#AG6*EA"::11<6F@6T)7 T)n #//77??*UD Cg++ C C E$// E Er@   