ó
    ¸®i^-  ã                  óv  • S r SSKJr  SSKrSSKrSSKrSSKrSSKrSSKJ	r	  SSK
Jr  SSKJrJr  SSKr\(       a  SSKJrJr  SSKrSrS	rS
r\R.                   " S S5      5       rSS jrSS jr    SS jrS S jrS!S jrS!S jrS"S jrS#S jr S$S jr!S%S jr"S&S jr#Sr$Sr%Sr&Sr'Sr(\)S:X  a  \#" 5         gg)'zG
Code generation script for class methods
to be exported as public API
é    )ÚannotationsN)ÚPath)Úindent)ÚTYPE_CHECKINGÚ	TypeGuard)ÚIterableÚIteratorÚ
_generateda9  # ***********************************************************
# ******* WARNING: AUTOGENERATED! ALL EDITS WILL BE LOST ******
# *************************************************************
from __future__ import annotations

import sys

from ._ki import enable_ki_protection
from ._run import GLOBAL_RUN_CONTEXT
z‡try:
    return{}GLOBAL_RUN_CONTEXT.{}.{}
except AttributeError:
    raise RuntimeError("must be called from async context") from None
c                  ó‚   • \ rS rSr% S\S'   S\S'   \R                  " SSS9rS\S	'   \R                  " SSS9rS\S
'   Sr	g)ÚFileé.   r   ÚpathÚstrÚmodnameÚ T)ÚdefaultÚkw_onlyÚplatformÚimports© N)
Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__annotations__ÚattrsÚfieldr   r   Ú__static_attributes__r   ó    ÚDC:\des-py\RoboSAPF\venv\Lib\site-packages\trio/_tools/gen_exports.pyr   r   .   s6   ‡ à
ƒJØƒLØ—K’K¨°DÑ9€HˆcÓ9Ø—;’; r°4Ñ8€GˆSÖ8r   r   c                óV   • [        U [        R                  [        R                  45      $ )z@Check if the AST node is either a function
or an async function
)Ú
isinstanceÚastÚFunctionDefÚAsyncFunctionDef)Únodes    r    Úis_functionr'   6   s    € ô �dœSŸ_™_¬c×.BÑ.BÐCÓDÐDr   c                ó°   • [        U 5      (       aF  U R                   H6  n[        U[        R                  5      (       d  M$  UR
                  S:X  d  M6    g   g)z-Check if the AST node has a _public decoratorÚ_publicTF)r'   Údecorator_listr"   r#   ÚNameÚid)r&   Ú	decorators     r    Ú	is_publicr.   =   sA   € ä�4×ÑØ×,Ô,ˆIÜ˜)¤S§X¡X×.Ó.°9·<±<À9Õ3LÙñ -ð r   c              #  ór   #   • [         R                  " U 5       H  n[        U5      (       d  M  Uv •  M     g7f)z’Return a list of methods marked as public.
The function walks the given tree and extracts
all objects that are functions which are marked
public.
N)r#   Úwalkr.   )Útreer&   s     r    Úget_public_methodsr2   F   s'   é € ô —’˜–ˆÜ�T�?‹?ØŒJò ùs   ‚(7®	7c                ón  • U R                   R                    Vs/ s H  oR                  PM     nnU R                   R                  (       a2  UR                  SU R                   R                  R                  -   5        U R                   R                   H.  nUR                  UR                  S-   UR                  -   5        M0     U R                   R
                  (       a2  UR                  SU R                   R
                  R                  -   5        SR                  SR                  U5      5      $ s  snf )zúGiven a function definition, create a string that represents taking all
the arguments from the function, and passing them through to another
invocation of the same function.

Example input: ast.parse("def f(a, *, b): ...")
Example output: "(a, b=b)"
Ú*Ú=z**z({})z, )ÚargsÚargÚvarargÚappendÚ
kwonlyargsÚkwargÚformatÚjoin)Úfuncdefr7   Ú	call_argss      r    Úcreate_passthrough_argsr@   S   sÖ   € ð %,§L¡L×$5Ò$5Ó6Ò$5˜S—”Ñ$5€IÐ6Ø‡|�|××Ø×Ñ˜˜wŸ|™|×2Ñ2×6Ñ6Ñ6Ô7Ø�|‰|×&Ô&ˆØ×Ñ˜Ÿ™ 3™¨¯©Ñ0Ö1ñ 'à‡|�|××Ø×Ñ˜ §¡× 2Ñ 2× 6Ñ 6Ñ6Ô7Ø�=‰=˜Ÿ™ 9Ó-Ó.Ð.ùò 7s   ™D2c                óÒ   • SSK n[        R                  " [        R                  SSSU R
                  S/USSS	9nUR                  S:w  a  S
SUR                   34$ SUR                  4$ )a	  Run black on the specified file.

    Returns:
      Tuple of success and result string.
      ex.:
        (False, "Failed to run black!
error: cannot format ...")
        (True, "<formatted source>")

    Raises:
      ImportError: If black is not installed.
    r   Nú-mÚblackú--stdin-filenameÚ-TÚutf8©ÚinputÚcapture_outputÚencodingFzFailed to run black!
)	rC   Ú
subprocessÚrunÚsysÚ
executabler   Ú
returncodeÚstderrÚstdout)ÚfileÚsourcerC   Úresults       r    Ú	run_blackrU   e   so   € ó ô
 �^Š^ä	�‰˜˜wÐ(:¸D¿I¹IÀsÐKØØØñ€Fð ×Ñ˜AÓØÐ.¨v¯}©}¨oÐ>Ð>Ð>Ø�—‘ÐÐr   c                óØ   • SSK n[        R                  " [        R                  SSSSSSU R
                  S	/	US
SS9nUR                  S:w  a  SSUR                   34$ S
UR                  4$ )a  Run ruff on the specified file.

    Returns:
      Tuple of success and result string.
      ex.:
        (False, "Failed to run ruff!
error: Failed to parse ...")
        (True, "<formatted source>")

    Raises:
      ImportError: If ruff is not installed.
    r   NrB   ÚruffÚcheckz--fixz--unsafe-fixesrD   rE   TrF   rG   FzFailed to run ruff!
)	rW   rK   rL   rM   rN   r   rO   rP   rQ   )rR   rS   rW   rT   s       r    Úrun_ruffrY   „   s€   € ó ä�^Š^ô �N‰NØØØØØØØ�I‰IØð
	
ð ØØñ€Fð$ ×Ñ˜AÓØÐ-¨f¯m©m¨_Ð=Ð=Ð=Ø�—‘ÐÐr   c                ó”   • [         [        4 H7  nU" X5      u  p1U(       a  M  [        U5        [        R                  " S5        M9     U$ )z§Format the specified file using black and ruff.

Returns:
  Formatted source code.

Raises:
  ImportError: If either is not installed.
  SystemExit: If either failed.
é   )rU   rY   ÚprintrM   Úexit)rR   rS   ÚfnÚsuccesss       r    Úrun_lintersr`   ª   s=   € ô œ(Ó#ˆÙ˜TÓ*‰ˆßˆwÜ�&ŒMÜ�HŠH�QŽKñ	 $ð €Mr   c                óx  • [         /nUR                  U R                  5        U R                  (       aa  SU R                  ;  a  UR                  S5        SU R                  ;  a  UR                  S5        UR                  SU R                   S35        SR	                  U5      /n[
        R                  R                  U R                  5      n/ n[        U5       GH£  nUR                  R                  S   R                  S	:X  d   eUR                  R                  S	 UR                  UR                  5        UR                   H8  n[        U[        R                   5      (       d  M$  UR"                  S
:X  d  M6  Sn  O   Sn[        R                   " S5      /Ul        [%        U5      n[        R&                  " U5      c  UR(                  SS2	 OUR(                  SS2	 [
        R*                  " USS9n	U(       a  U	R-                  SS5      n	[.        R1                  [        U[        R2                  5      (       a  SOSU R4                  UR                  U-   5      n
U	[7        U
S5      -   nUR                  U5        GM¦     UR9                  5         UR;                  SSU< 35        SR	                  U5      $ )zRScan the given .py file for @_public decorators, and generate wrapper
functions.

r   z!from typing import TYPE_CHECKING
z
import syszimport sys
z,
assert not TYPE_CHECKING or sys.platform=="z"
r   r   ÚselfÚcontextmanagerTFÚenable_ki_protectionNr[   z    )Úindent_withz
->Iteratorz->AbstractContextManagerz await Ú z
__all__ = z

)ÚHEADERr9   r   r   r=   ÚastorÚcode_to_astÚ
parse_filer   r2   r6   r7   Únamer*   r"   r#   r+   r,   r@   Úget_docstringÚbodyÚ	to_sourceÚreplaceÚTEMPLATEr<   r%   r   r   ÚsortÚinsert)rR   ÚheaderÚ	generatedrS   Úmethod_namesÚmethodÚdecÚis_cmÚnew_argsÚfuncÚtemplateÚsnippets               r    Úgen_public_wrappers_sourcer}   ¾   s>  € ô
 ˆX€FØ
‡M�M�$—,‘,ÔØ‡}‡}ð  $§,¡,Ó.Ø�M‰MÐ>Ô?Ø˜tŸ|™|Ó+Ø�M‰M˜.Ô)Ø�‰Ø;¸D¿M¹M¸?È#ÐNô	
ð —‘˜“Ð!€Iä×Ñ×)Ñ)¨$¯)©)Ó4€FØ€LÜ$ V×,ˆà�{‰{×Ñ Ñ"×&Ñ&¨&Ó0Ð0Ð0Ø�K‰K×Ñ˜QÐØ×Ñ˜FŸK™KÔ(à×(Ô(ˆCÜ˜#œsŸx™x×(Ó(¨S¯V©VÐ7GÕ-GØ�Ùñ )ð
 ˆEô "%§¢Ð*@Ó!AÐ BˆÔô +¨6Ó2ˆô ×Ò˜VÓ$Ñ,Ø—‘šA‘ð —‘˜A™B�ô �Š˜v°7Ñ;ˆæØ—<‘< Ð.HÓIˆDô —?‘?Ü# F¬C×,@Ñ,@×AÑA‰IÀsØ�L‰LØ�K‰K˜(Ñ"ó
ˆð œ ¨'Ó2Ñ2ˆð 	×Ñ˜×!ñW -ðZ ×ÑÔà×Ñ�Q˜* \Ñ$4Ð5Ô6Ø�;‰;�yÓ!Ð!r   c                óÀ   • U R                  5        HJ  u  p[        R                  R                  U5      (       d    g[	        U5      R                  SS9nX2:w  d  MJ    g   g)NFúutf-8)rJ   T)ÚitemsÚosr   Úexistsr   Ú	read_text)Ú	new_filesÚnew_pathÚ
new_sourceÚ
old_sources       r    Úmatches_disk_filesrˆ     sQ   € Ø )§¡Ö 1ÑˆÜ�w‰w�~‰~˜h×'Ñ'ÙÜ˜(“^×-Ñ-°wÐ-Ð?ˆ
ØÕ#Ùñ !2ð r   c               ód  • 0 nU  H…  n[        SUR                  5        [        U5      n[        X45      n[        R                  R                  UR                  5      u  pV[        R                  R                  U[        U-   5      nXBU'   M‡     [        U5      nU(       a5  U(       d"  [        S5        [        R                  " S5        g [        S5        g UR                  5        H  u  pt[        U5      R                  USSS9  M!     [        S5        U(       d  [        R                  " S5        g g )	Nz	Scanning:z2Generated sources are outdated. Please regenerate.r[   z!Generated sources are up to date.r   Ú
)rJ   Únewlinez!Regenerated sources successfully.)r\   r   r}   r`   r�   Úsplitr=   ÚPREFIXrˆ   rM   r]   r€   r   Ú
write_text)	ÚfilesÚdo_testr„   rR   r†   ÚdirnameÚbasenamer…   Úmatches_disks	            r    Úprocessr”     så   € Ø€IÛˆÜˆk˜4Ÿ9™9Ô%Ü/°Ó5ˆ
Ü  Ó2ˆ
ÜŸG™GŸM™M¨$¯)©)Ó4ÑˆÜ—7‘7—<‘< ¬°(Ñ):Ó;ˆØ(�(Óñ ô & iÓ0€LÞÞÜÐFÔGÜ�HŠH�Q�KäÐ5Õ6à$-§O¡OÖ$5Ñ ˆHÜ�‹N×%Ñ% j¸7ÈDÐ%ÓQñ %6äÐ1Ô2Þä�HŠH�Q�Kð r   c                 ó²  • [         R                  " SS9n U R                  SSSSS9  U R                  5       n[        R
                  " 5       nUS-  R                  5       (       d   eUS	-  n[        US
-  S[        S9[        US-  S[        S9[        US-  SS[        S9[        US-  SS[        S9[        US-  SS[        S9/n[        XAR                  S9  g )Nz,Generate python code for public api wrappers)Údescriptionz--testz-tÚ
store_truez test if code is still up to date)ÚactionÚhelpÚLICENSEzsrc/trio/_corez_run.pyÚrunner)r   z_instrumentation.pyzrunner.instrumentsz_io_windows.pyzrunner.io_managerÚwin32)r   r   z_io_epoll.pyÚlinuxz_io_kqueue.pyÚdarwin)r�   )ÚargparseÚArgumentParserÚadd_argumentÚ
parse_argsr   Úcwdr‚   r   ÚIMPORTS_RUNÚIMPORTS_INSTRUMENTÚIMPORTS_WINDOWSÚIMPORTS_EPOLLÚIMPORTS_KQUEUEr”   Útest)ÚparserÚparsed_argsÚsource_rootÚcoreÚto_wraps        r    Úmainr¯   ,  s  € Ü×$Ò$ØBñ€Fð ×ÑØØØØ/ð	 ñ ð ×#Ñ#Ó%€Kä—(’(“*€Kà˜)Ñ#×+Ñ+×-Ñ-Ð-Ð-ØÐ)Ñ)€DäˆT�IÑ˜x´Ñ=ÜØÐ(Ñ(Ø Ü&ñ	
ô
 	ØÐ#Ñ#ØØÜ#ñ		
ô 	Ø�>Ñ!ØØÜ!ñ		
ô 	Ø�?Ñ"ØØÜ"ñ		
ð'€Gô6 ˆG×-Ñ-Ó.r   aN  from collections.abc import Awaitable, Callable
from typing import Any, TYPE_CHECKING

from outcome import Outcome
import contextvars

from ._run import _NO_SEND, RunStatistics, Task
from ._entry_queue import TrioToken
from .._abc import Clock

if TYPE_CHECKING:
    from typing_extensions import Unpack
    from ._run import PosArgT
z)from ._instrumentation import Instrument
zZfrom typing import TYPE_CHECKING

if TYPE_CHECKING:
    from .._file_io import _HasFileNo
a  from typing import TYPE_CHECKING

if TYPE_CHECKING:
    import select
    from collections.abc import Callable
    from contextlib import AbstractContextManager

    from .. import _core
    from .._file_io import _HasFileNo
    from ._traps import Abort, RaiseCancelT
a  from typing import TYPE_CHECKING

if TYPE_CHECKING:
    from contextlib import AbstractContextManager

    from typing_extensions import Buffer

    from .._file_io import _HasFileNo
    from ._unbounded_queue import UnboundedQueue
    from ._windows_cffi import Handle, CData
Ú__main__)r&   úast.ASTÚreturnz1TypeGuard[ast.FunctionDef | ast.AsyncFunctionDef])r1   r±   r²   z0Iterator[ast.FunctionDef | ast.AsyncFunctionDef])r>   z&ast.FunctionDef | ast.AsyncFunctionDefr²   r   )rR   r   rS   r   r²   ztuple[bool, str])rR   r   rS   r   r²   r   )rR   r   r²   r   )r„   zdict[str, str]r²   Úbool)r�   zIterable[File]r�   r³   r²   ÚNone)r²   r´   )*Ú__doc__Ú
__future__r   rŸ   r#   r�   rK   rM   Úpathlibr   Útextwrapr   Útypingr   r   r   Úcollections.abcr   r	   rh   r�   rg   rp   Údefiner   r'   r.   r2   r@   rU   rY   r`   r}   rˆ   r”   r¯   r¤   r¥   r§   r¨   r¦   r   r   r   r    Ú<module>r¼      sé   ðñõ #ã Û 
Û 	Û Û 
Ý Ý ß +ã æß2ó à	€ð	
€ð€ð ‡�÷9ð 9ó ð9ôEôð
Ø
ð
à5ô
ô/ô$ô>#ôLô(F"ôRôô6+/ð\€ðÐ ð€ð€ð€ð ˆzÓÙ…Fð r   