ó
    ¡7�j;Y  ã                   óÈ  • S SK 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JrJrJ	r	J
r
JrJrJr  SSKJrJrJrJrJrJrJr  SSKJr  SSKJrJrJr  \R8                  " \5      r\R>                  (       a$  \R@                  " S5      r!\RD                  " S5      r# " S	 S
\5      r$ " S S\5      r% " S S\5      r& " S S\&\ RN                  5      r( " S S\&5      r) " S S\&5      r*g)é    N)ÚBinaryIOÚCallableÚClassVarÚ
CollectionÚ	GeneratorÚMappingÚSequenceÚTypeé   )Ú	JsonErrorÚ
JsonObjectÚ	JsonValueÚcreate_objectÚget_boolÚget_enumÚget_str)ÚCockpitProblem)ÚEndpointÚRouterÚRoutingRuleÚ_TÚ_Pc                   ó|   ^ • \ rS rSr% S\S'   S\SS4U 4S jjrS\4S	 jrS
SS\S\	4S jr
S\SS4S jrS rSrU =r$ )ÚChannelRoutingRuleé&   zdict[str, list[Type[Channel]]]ÚtableÚrouterÚchannel_typeszCollection[Type[Channel]]c                 ó  >• [         TU ]  U5        0 U l        U H:  nU R                  R                  UR                  / 5      nUR                  U5        M<     U R                  R                  5        H  nUR                  S SS9  M     g )Nc                 ó,   • [        U R                  5      $ ©N)ÚlenÚrestrictions)Úclss    Ú1/usr/lib/python3/dist-packages/cockpit/channel.pyÚ<lambda>Ú-ChannelRoutingRule.__init__.<locals>.<lambda>5   s   € ¤s¨3×+;Ñ+;Ô'<ó    T)ÚkeyÚreverse)ÚsuperÚ__init__r   Ú
setdefaultÚpayloadÚappendÚvaluesÚsort)Úselfr   r   r$   ÚentryÚ	__class__s        €r%   r,   ÚChannelRoutingRule.__init__)   ss   ø€ Ü‰Ñ˜Ô ØˆŒ
ó !ˆCØ—J‘J×)Ñ)¨#¯+©+°rÓ:ˆEØ�L‰L˜Öñ !ð —Z‘Z×&Ñ&Ö(ˆEØ�J‰JÑ<ÀdˆJÓKò )r(   Úreturnc                 ó¤   • 0 nU R                   R                  5        H/  u  p#/ nU H  nUR                  UR                  5        M      XAU'   M1     U$ r!   )r   ÚitemsÚextendÚcapabilities)r2   Úresultr.   ÚimplsÚcapsÚimpls         r%   r:   ÚChannelRoutingRule.capabilities7   sO   € Ø)+ˆà"Ÿj™j×.Ñ.Ö0‰NˆGØ "ˆDÛ�Ø—‘˜D×-Ñ-Ö.ñ à"�7‹Oñ	 1ð
 ˆr(   r#   zCollection[tuple[str, object]]Úoptionsc                 ó^   • U H'  u  p4UR                  U5      nUc    gUc  M   XT:w  d  M'    g   g)NFT)Úget)r2   r#   r@   r)   Úexpected_valueÚ	our_values         r%   Úcheck_restrictionsÚ%ChannelRoutingRule.check_restrictionsA   s=   € Û#/ÑˆCØŸ™ CÓ(ˆIð Ñ Ùð Ó)¨iÕ.IÙñ $0ð r(   zChannel | Nonec                 ó   • U R                   c   eUR                  S5      n[        U[        5      (       d  g U R                  R                  U/ 5       H8  nU R                  UR                  U5      (       d  M&  U" U R                   5      s  $    g )Nr.   )r   rB   Ú
isinstanceÚstrr   rE   r#   )r2   r@   r.   r$   s       r%   Ú
apply_ruleÚChannelRoutingRule.apply_ruleR   sv   € Ø�{‰{Ñ&Ð&Ð&à—+‘+˜iÓ(ˆÜ˜'¤3×'Ñ'Øà—:‘:—>‘> '¨2Ö.ˆCØ×&Ñ& s×'7Ñ'7¸×AÓAÙ˜4Ÿ;™;Ó'Ò'ñ /ð r(   c                 ó   • g r!   © ©r2   s    r%   ÚshutdownÚChannelRoutingRule.shutdown_   ó   € Ør(   )r   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__annotations__r   r,   r   r:   ÚboolrE   rJ   rO   Ú__static_attributes__Ú__classcell__)r4   s   @r%   r   r   &   sg   ø‡ Ø+Ó+ðL˜vð LÐ6Q÷ Lð˜jô ðÐ/Oð ÐZdð Ðimô ð" *ð Ð1Aô ÷ð r(   r   c                   ó   • \ rS rSrSrg)ÚChannelErroréc   rM   N)rR   rS   rT   rU   rX   rM   r(   r%   r[   r[   c   s   † Úr(   r[   c                   ó¦  • \ rS rSr% SrSrSr\\S'   Sr	\
\S'   \r\
\S'   \\S	'   S
\S'   SrS\S'   S\S'   SrS\S'   SrS\S'   SrSr\\S'   S\S'   S\S\SS4S jrS\S\S\SS4S jrS S!S"S!S#\SS4S$ jrS%\SS4S& jrSJS' jrSJS( jrSJS) jrS\SS4S* jrS\SS4S+ jrS,\SS4S- jrS\S,\SS4S. jrS,\SS/4S0 jrS1\ SS4S2 jr!SS3.S,\S4\S\4S5 jjr"SJS6 jr#S\4S7 jr$SJS8 jr%S9 r&SKS: jr'SKSLS; jjr(S,\S\4S< jr)S,\S\4S= jr*S,\S\4S> jr+SKS?SS1\ S\4S@ jjr,SA r-SJSB jr.\/R`                  " SCSD9r1SE\SF'   S\S1\ SS4SG jr2S\SS4SH jr3SIr4g)MÚChannelég   i @  i    FÚ_send_pingsr   Ú_out_sequenceÚ_out_windowÚ
_ack_byteszset[asyncio.Task]Ú_tasksNúJsonObject | NoneÚ_close_argszClassVar[str]r.   rM   z&ClassVar[Sequence[tuple[str, object]]]r#   zClassVar[Sequence[str]]r:   Ú Ú	is_binaryz codecs.IncrementalDecoder | NoneÚdecoderÚcommandÚmessager6   c                 óf  • US:X  až  [        5       U l        [        US5      U l        [	        USSS9(       a  SU l        [        USS/S 5      S LU l        [        US	S
5      U l        [        USS/S 5      S LU l	        S U l
        U R                  5         U R                  U5        g US:X  a  U R                  5         g US:X  a  U R                  5         g US:X  a  U R                  5         g US:X  a  U R!                  U5        g US:X  a  U R#                  U5        g US:X  a  U R%                  U5        g g )NÚopenÚchannelzflow-controlF)ÚdefaultTz	send-acksÚbytesÚgroupro   ÚbinaryÚrawÚreadyÚdoneÚcloseÚpingÚpongr@   )Úsetrd   r   rn   r   r`   r   rc   rq   rh   ri   Úfreeze_endpointÚdo_openÚdo_readyÚdo_doneÚdo_closeÚdo_pingÚdo_pongÚ
do_options)r2   rj   rk   s      r%   Ú
do_controlÚChannel.do_control‚   s  € ð �fÓÜ›%ˆDŒKÜ" 7¨IÓ6ˆDŒLÜ˜ ¸×?Ø#'�Ô Ü& w°¸g¸YÈÓMÐUYÐYˆDŒOÜ  ¨'°9Ó=ˆDŒJÜ% g¨x¸%¸À$ÓGÈtÐSˆDŒNØˆDŒLØ× Ñ Ô"Ø�L‰L˜Õ!Ø˜ÓØ�M‰M�OØ˜ÓØ�L‰L�NØ˜ÓØ�M‰M�OØ˜ÓØ�L‰L˜Õ!Ø˜ÓØ�L‰L˜Õ!Ø˜	Ó!Ø�O‰O˜GÕ$ð "r(   rn   c                 óþ   • U R                   b  g   U R                  X#5        g ! [         a  n[        S[	        U5      S9UeS nAff = f! [         a)  nU R                  UR                  5       5         S nAg S nAff = f)Núprotocol-error©rk   )rf   r‚   r   r[   rI   rv   Ú	get_attrs)r2   rn   rj   rk   Úexcs        r%   Údo_channel_controlÚChannel.do_channel_controlž   sr   € à×ÑÑ'Øð	(ðPØ—‘ Õ1øÜó PÜ"Ð#3¼SÀ»XÑFÈCÐOûðPûäó 	(Ø�J‰J�s—}‘}“×'Ñ'ûð	(ús,   ‘# £
A­AÁAÁA	 Á	
A<ÁA7Á7A<Úhostz
str | Nonerq   Ú_messagec                 óp   • U R                   b  g Ub  g Ub  U R                  U:w  a  g U R                  5         g r!   )rf   rq   r~   )r2   r‹   rq   rŒ   s       r%   Údo_killÚChannel.do_kill¬   s7   € à×ÑÑ'ØàÑØØÑ §¡¨uÓ!4ØØ�‰�r(   r@   c                 ó   • [         er!   ©ÚNotImplementedError©r2   r@   s     r%   r{   ÚChannel.do_open¸   ó   € Ü!Ð!r(   c                 ó   • g r!   rM   rN   s    r%   r|   ÚChannel.do_ready¼   rQ   r(   c                 ó   • g r!   rM   rN   s    r%   r}   ÚChannel.do_done¿   rQ   r(   c                 ó$   • U R                  5         g r!   ©rv   rN   s    r%   r~   ÚChannel.do_closeÂ   s   € Ø�
‰
�r(   c                 ó   • [        SSS9e)Nznot-supportedz)This channel does not implement "options"r†   )r[   ©r2   rk   s     r%   r�   ÚChannel.do_optionsÅ   s   € Ü˜?Ð4_Ñ`Ð`r(   c                 ó&   • U R                  U5        g r!   )Ú	send_pongrž   s     r%   r   ÚChannel.do_pingÉ   s   € Ø�‰�wÕr(   Údatac                 óZ   • U R                   (       a  U R                  S[        U5      S9  g g )NÚack)rp   )rc   Úsend_controlr"   ©r2   r£   s     r%   Úsend_ackÚChannel.send_ackÌ   s%   € Ø�?�?Ø×Ñ˜e¬3¨t«9ÐÒ5ð r(   c                 óÞ   • U R                   b  g  U R                  U5      (       d  U R                  U5        g g ! [         a)  nU R	                  UR                  5       5         S nAg S nAff = fr!   )rf   Údo_datar¨   r[   rv   r‡   )r2   rn   r£   rˆ   s       r%   Údo_channel_dataÚChannel.do_channel_dataÐ   s[   € à×ÑÑ'Øð	(Ø—<‘< ×%Ñ%Ø—‘˜dÕ#ð &øäó 	(Ø�J‰J�s—}‘}“×'Ñ'ûð	(ús   �'9 ¹
A,ÁA'Á'A,zbool | Nonec                 ó&   • AU R                  5         g)zøHandles incoming data to the channel.

Return value is True if the channel takes care of send acks on its own,
in which case it should call self.send_ack() on `data` at some point.
None or False means that the acknowledgement is sent automatically.Tr›   r§   s     r%   r«   ÚChannel.do_dataÜ   s   € ð Ø�
‰
ŒØr(   Úkwargsc                 óL   • U R                  5         U R                  " SSS0UD6  g )Nrj   rt   rM   )Úthaw_endpointr¦   )r2   r°   s     r%   rt   ÚChannel.readyè   s$   € Ø×ÑÔØ×ÒÑ4 'Ð4¨VÓ4r(   ©Úfinalrµ   c                ó    • U R                   c   e U R                   R                  XS9$ ! [         a  n[        S[	        U5      S9UeS nAff = f)Nr´   r…   r†   )ri   ÚdecodeÚUnicodeDecodeErrorr[   rI   )r2   r£   rµ   rˆ   s       r%   Ú__decode_frameÚChannel.__decode_frameì   sV   € Ø�|‰|Ñ'Ð'Ð'ð	LØ—<‘<×&Ñ& tÐ&Ð9Ð9øÜ!ó 	LÜÐ/¼¸S»ÑBÈÐKûð	Lús   ‘* ª
A´AÁAc                 ó\   • U R                   b  U R                  SSS9  U R                  SS9  g )Nr(   Tr´   ru   )rj   )ri   Ú_Channel__decode_framer¦   rN   s    r%   ru   ÚChannel.doneó   s0   € à�<‰<Ñ#Ø×Ñ ¨4ÐÑ0Ø×Ñ &ÐÒ)r(   c                 ó   • U R                   S L$ r!   )rf   rN   s    r%   Ú
is_closingÚChannel.is_closingú   s   € Ø×Ñ tÐ+Ð+r(   c                 ó:   • U R                  U R                  5        g r!   )Úshutdown_endpointrf   rN   s    r%   Ú
_close_nowÚChannel._close_nowý   s   € Ø×Ñ˜t×/Ñ/Õ0r(   c                 óš   • U R                   R                  U5        U R                  b#  U R                   (       d  U R                  5         g g g r!   )rd   Úremoverf   rÃ   )r2   Útasks     r%   Ú
_task_doneÚChannel._task_done   s:   € ð
 	�‰×Ñ˜4Ô Ø×ÑÑ'°··Ø�O‰OÕð 1<Ð'r(   c                 ó¼   • U R                   b   e[        R                  " U5      nU R                  R	                  U5        UR                  U R                  5        U$ )z”Create a task associated with the channel.

All tasks must exit before the channel can close.  You may not create
new tasks after calling .close().
)rf   ÚasyncioÚcreate_taskrd   ÚaddÚadd_done_callbackrÈ   )r2   Ú	coroutineÚnamerÇ   s       r%   rÌ   ÚChannel.create_task	  sM   € ð ×ÑÑ'Ð'Ð'Ü×"Ò" 9Ó-ˆØ�‰�‰˜ÔØ×Ñ˜tŸ™Ô/Øˆr(   c                 ó„   • U R                   b  gU=(       d    0 U l         U R                  (       d  U R                  5         gg)z»Requests the channel to be closed.

After you call this method, you won't get anymore `.do_*()` calls.

This will wait for any running tasks to complete before sending the
close message.
N)rf   rd   rÃ   )r2   Ú
close_argss     r%   rv   ÚChannel.close  s6   € ð ×ÑÑ'àØ%×+¨ˆÔØ�{�{Ø�O‰OÕð r(   c                 óN  • U R                  U R                  U5        U R                  (       a`  U R                  [	        U5      -   nU R                  [
        R                  -  U[
        R                  -  :w  a  U R                  SUS9  X l        U R                  U R                  :  $ )a[  Send binary data and handle book-keeping for flow control.

The flow control is "advisory".  The data is sent immediately, even if
it's larger than the window.  In general you should try to send packets
which are approximately Channel.BLOCK_SIZE in size.

Returns True if there is still room in the window, or False if you
should stop writing for now.  In that case, `.do_resume_send()` will be
called later when there is more room.

Be careful with text channels (i.e. without binary="raw"): you are responsible
for ensuring that @data is valid UTF-8. This isn't validated here for
efficiency reasons.
rw   )rj   Úsequence)	Úsend_channel_datarn   r`   ra   r"   r^   Ú
BLOCK_SIZEr¦   rb   )r2   r£   Úout_sequences      r%   Ú
send_bytesÚChannel.send_bytes$  s‰   € ð 	×Ñ˜tŸ|™|¨TÔ2à××Ø×-Ñ-´°D³	Ñ9ˆLØ×!Ñ!¤W×%7Ñ%7Ñ7¸<Ì7×K]ÑK]Ñ;]Ó]Ø×!Ñ!¨&¸<Ð!ÑHØ!-Ôà×!Ñ! D×$4Ñ$4Ñ4Ð4r(   c                 óÞ   • U R                   (       a  U R                  U5      $ U R                  c  [        R                  " S5      " SS9U l        U R                  U R                  U5      5      $ )a  Send data and transparently handle UTF-8 for text channels

Use this for channels which can be text, but are not guaranteed to get
valid UTF-8 frames -- i.e. multi-byte characters may be split across
frames. This is expensive, so prefer send_text() or send_bytes() wherever
possible.
zutf-8Ústrict)Úerrors)rh   rÚ   ri   ÚcodecsÚgetincrementaldecoderÚ	send_textr¼   r§   s     r%   Ú	send_dataÚChannel.send_data=  sW   € ð �>�>Ø—?‘? 4Ó(Ð(ð �<‰<ÑÜ!×7Ò7¸Ô@ÈÑQˆDŒLØ�~‰~˜d×1Ñ1°$Ó7Ó8Ð8r(   c                 ó@   • U R                  UR                  5       5      $ )z˜Send UTF-8 string data and handle book-keeping for flow control.

Similar to `send_bytes`, but for text data.  The data is sent as UTF-8 encoded bytes.
)rÚ   Úencoder§   s     r%   rá   ÚChannel.send_textN  s   € ð
 �‰˜tŸ{™{›}Ó-Ð-r(   Úmsgc                 ór   • U R                   R                  [        X5      5      S-   nU R                  U5      $ )NÚ
)Újson_encoderrå   r   rá   )r2   rç   r°   Úprettys       r%   Ú	send_jsonÚChannel.send_jsonU  s1   € Ø×"Ñ"×)Ñ)¬-¸Ó*DÓEÈÑLˆØ�~‰~˜fÓ%Ð%r(   c                 óô   • U R                   (       d!  [        R                  SU R                  5        g US   [        R
                  -   U l        U R                  U R                  :  a  U R                  5         g g )NzGot wild pong on channel %srÖ   )	r`   ÚloggerÚwarningrn   r^   ÚSEND_WINDOWrb   ra   Údo_resume_sendrž   s     r%   r€   ÚChannel.do_pongY  s^   € Ø××Ü�N‰NÐ8¸$¿,¹,ÔGØà" :Ñ.´×1DÑ1DÑDˆÔØ×Ñ × 0Ñ 0Ó0Ø×ÑÕ!ð 1r(   c                 ó   • g)z<Called to indicate that the channel may start sending again.NrM   rN   s    r%   rò   ÚChannel.do_resume_sendb  s   � r(   é   )ÚindentzClassVar[json.JSONEncoder]rê   c                 óB   • U R                   " U R                  US 40 UD6  g r!   ©Úsend_channel_controlrn   )r2   rj   r°   s      r%   r¦   ÚChannel.send_controlh  s   € Ø×!Ò! $§,¡,°¸ÑHÀÓHr(   c                 ó>   • U R                  U R                  SU5        g )Nrx   rù   rž   s     r%   r¡   ÚChannel.send_pongk  s   € Ø×!Ñ! $§,¡,°¸Õ@r(   )
rc   rf   ra   rb   r`   rd   rn   ri   rq   rh   ©r6   Nr!   )rÓ   re   r6   N)5rR   rS   rT   rU   rØ   rñ   r`   rW   rV   ra   Úintrb   rf   r#   r:   rn   rq   rI   r   r‚   r‰   rŽ   r{   r|   r}   r~   r�   r   rp   r¨   r¬   r«   r   rt   r¼   ru   r¿   rÃ   rÈ   rÌ   rv   rÚ   râ   rá   rì   r€   rò   ÚjsonÚJSONEncoderrê   r¦   r¡   rX   rM   r(   r%   r^   r^   g   sk  ‡ à€JØ!€Kð €K�ÓØ€M�3ÓØ"€K�Ó"ØÓð  ÓØ'+€KÐ$Ó+ð ÓØ=?€LÐ:Ó?Ø.0€LÐ+Ó0ð €GØ€EØƒOØ/Ó/ð% #ð %°
ð %¸tô %ð8(¨#ð (¸ð (Àjð (ÐUYô (ð	˜Lð 	°ð 	Èð 	ÐX\ô 	ð"˜zð "¨dô "ôôôða *ð a°ô að ˜zð  ¨dô  ð6˜Uð 6 tô 6ð
( sð 
(°%ð 
(¸Dô 
(ð	˜Eð 	 mô 	ð5˜ið 5¨Dô 5ð <Aò L 5ð L°Dð LÀSõ Lô*ð,˜Dô ,ô1òô
öð5˜uð 5¨ô 5ð29˜eð 9¨ô 9ð".˜cð . dô .ñ&Ð0ð &À9ð &ÐQUõ &ò"ôKð 26×1AÒ1AÈÑ1K€LÐ.ÓKðI Cð I°9ð IÀô IðA ð A°÷ Ar(   r^   c                   óˆ  • \ rS rSr% SrSrS\S'   Sr\\S'   Sr	S\S	'   Sr
S
\S'   SrS\S'   Sr\\S'   Sr\\S'   S\R                  S\S\R"                  4S jrS\SS4S jrS&S jrS\R*                  SS4S jrS\4S jrS'S jrS\SS4S jrS(S jrS(S jrS\SS4S jrS(S jrS(S  jrS\4S! jr S" r!S(S# jr"S(S$ jr#S%r$g))ÚProtocolChannelio  a  A channel subclass that implements the asyncio Protocol interface.

In effect, data sent to this channel will be written to the connected
transport, and vice-versa.  Flow control is supported.

The default implementation of the .do_open() method calls the
.create_transport() abstract method.  This method should return a transport
which will be used for communication on the channel.

Otherwise, if the subclass implements .do_open() itself, it is responsible
for setting up the connection and ensuring that .connection_made() is called.
Nzasyncio.Transport | NoneÚ
_transportTÚ_send_pongsre   Ú
_last_pingz&asyncio.Task[asyncio.Transport] | NoneÚ_create_transport_taskÚ_ready_infoFÚ_close_on_eofÚ_eofÚloopr@   r6   c              ƒ   ó   #   • [         e7f)zðCreates the transport for this channel, according to options.

The event loop for the transport is passed to the function.  The
protocol for the transport is the channel object, itself (self).

This needs to be implemented by the subclass.
r‘   )r2   r  r@   s      r%   Úcreate_transportÚ ProtocolChannel.create_transport†  s   é € ô "Ð!ùó   ‚	c                 óÌ   • [         R                  " 5       n[         R                  " U R                  X!5      5      U l        U R                  R                  U R                  5        g r!   )rË   Úget_running_looprÌ   r  r  rÎ   Úcreate_transport_done)r2   r@   r  s      r%   r{   ÚProtocolChannel.do_open�  sI   € Ü×'Ò'Ó)ˆÜ&-×&9Ò&9¸$×:OÑ:OÐPTÓ:^Ó&_ˆÔ#Ø×#Ñ#×5Ñ5°d×6PÑ6PÕQr(   c                 óV  • XR                   L d   eS U l          UR                  5       nU R                  U5        U R                  b  U R                  " S0 U R                  D6  g U R                  5         g ! [         a)  nU R                  UR	                  5       5         S nAg S nAff = f)NrM   )r  r;   r[   rv   r‡   Úconnection_mader  rt   )r2   rÇ   Ú	transportrˆ   s       r%   r  Ú%ProtocolChannel.create_transport_done•  s�   € Ø×2Ñ2Ò2Ð2Ð2Ø&*ˆÔ#ð	ØŸ™›ˆIð
 	×Ñ˜YÔ'Ø×ÑÑ'Ø�JŠJÑ*˜×)Ñ)Ó*à�J‰J�Løô ó 	Ø�J‰J�s—}‘}“Ô'Üûð	ús   ™A5 Á5
B(Á?B#Â#B(r  c                 óR   • [        U[        R                  5      (       d   eXl        g r!   )rH   rË   Ú	Transportr  )r2   r  s     r%   r  ÚProtocolChannel.connection_made¤  s    € Ü˜)¤W×%6Ñ%6×7Ñ7Ð7Ð7Ø#�r(   c                 ó   • 0 $ r!   rM   rN   s    r%   Ú_get_close_argsÚProtocolChannel._get_close_args¨  s   € Øˆ	r(   c                 óB   • U R                  U R                  5       5        g r!   )rv   r  )r2   rˆ   s     r%   Úconnection_lostÚProtocolChannel.connection_lost«  s   € Ø�
‰
�4×'Ñ'Ó)Õ*r(   r£   c                 óX   • U R                   c   eU R                   R                  U5        g r!   )r  Úwriter§   s     r%   r«   ÚProtocolChannel.do_data®  s$   € Ø�‰Ñ*Ð*Ð*Ø�‰×Ñ˜dÕ#r(   c                 ó–   • U R                   c   eU R                   R                  5       (       a  U R                   R                  5         g g r!   )r  Úcan_write_eofÚ	write_eofrN   s    r%   r}   ÚProtocolChannel.do_done²  s:   € Ø�‰Ñ*Ð*Ð*Ø�?‰?×(Ñ(×*Ñ*Ø�O‰O×%Ñ%Õ'ð +r(   c                 óT   • U R                   b  U R                   R                  5         g g r!   )r  rv   rN   s    r%   r~   ÚProtocolChannel.do_close·  s!   € Ø�?‰?Ñ&Ø�O‰O×!Ñ!Õ#ð 'r(   c                 óò   • U R                   c   e U R                  U5      (       d  U R                   R                  5         g g ! [         a)  nU R	                  UR                  5       5         S nAg S nAff = fr!   )r  râ   Úpause_readingr[   rv   r‡   )r2   r£   rˆ   s      r%   Údata_receivedÚProtocolChannel.data_received»  s`   € Ø�‰Ñ*Ð*Ð*ð	(Ø—>‘> $×'Ñ'Ø—‘×-Ñ-Õ/ð (øäó 	(Ø�J‰J�s—}‘}“×'Ñ'ûð	(ús   ‘0A Á
A6ÁA1Á1A6c                 óV   • U R                   c   eU R                   R                  5         g r!   )r  Úresume_readingrN   s    r%   rò   ÚProtocolChannel.do_resume_sendÃ  s"   € Ø�‰Ñ*Ð*Ð*Ø�‰×&Ñ&Õ(r(   c                 óˆ   • SU l         U R                  (       a*  U R                  c   eU R                  R                  5         gg)a|  Mark the channel to be closed on EOF.

Normally, ProtocolChannel tries to keep the channel half-open after
receiving EOF from the transport.  This instructs that the channel
should be closed on EOF.

If EOF was already received, then calling this function will close the
channel immediately.

If you don't call this function, you are responsible for closing the
channel yourself.
TN)r	  r
  r  rv   rN   s    r%   Úclose_on_eofÚProtocolChannel.close_on_eofÇ  s8   € ð "ˆÔØ�9�9Ø—?‘?Ñ.Ð.Ð.Ø�O‰O×!Ñ!Õ#ð r(   c                 óR   • SU l         U R                  5         U R                  (       + $ ©NT)r
  ru   r	  rN   s    r%   Úeof_receivedÚProtocolChannel.eof_receivedÙ  s!   € ØˆŒ	Ø�	‰	ŒØ×%Ñ%Ô%Ð%r(   c                 óV   • U R                   (       a  U R                  U5        g Xl        g r!   )r  r¡   r  rž   s     r%   r   ÚProtocolChannel.do_pingß  s   € Ø××Ø�N‰N˜7Õ#ð &�Or(   c                 ó   • SU l         g )NF)r  rN   s    r%   Úpause_writingÚProtocolChannel.pause_writingæ  s
   € à ˆÕr(   c                 ór   • SU l         U R                  b#  U R                  U R                  5        S U l        g g r5  )r  r  r¡   rN   s    r%   Úresume_writingÚProtocolChannel.resume_writingê  s0   € ØˆÔØ�?‰?Ñ&Ø�N‰N˜4Ÿ?™?Ô+Ø"ˆD�Oð 'r(   )r	  r  r
  r  r  r  )rÇ   zasyncio.Task[asyncio.Transport]r6   N)rˆ   zException | Noner6   Nrþ   )%rR   rS   rT   rU   Ú__doc__r  rV   r  rW   r  r  r  r	  r
  rË   ÚAbstractEventLoopr   r  r  r{   r  ÚBaseTransportr  r  r  rp   r«   r}   r~   r,  rò   r2  r6  r   r;  r>  rX   rM   r(   r%   r  r  o  s  ‡ ñð .2€JÐ*Ó1Ø€K�ÓØ&*€JÐ#Ó*ØGKÐÐDÓKØ'+€KÐ$Ó+ð  €M�4ÓØ€Dˆ$Óð"¨7×+DÑ+Dð "Èzð "Ð^e×^oÑ^oô "ðR˜zð R¨dô Rô
ð$¨×)>Ñ)>ð $À4ô $ð ô ô+ð$˜Eð $ dô $ô(ô
$ð( %ð (¨Dô (ô)ô$ð$&˜dô &ò&ô!÷#r(   r  c                   óö   • \ rS rSr% SrS\S'   \R                  \S'   SrS\	SS	4S
 jr
S\	SS4S jrSS jrS\SS4S jrSS jrS\SS4S jrSS jrS\	SS4S jrSS jrSS jrS\	SS4S jrS\S\4S jrSrg)ÚAsyncChanneliñ  a  A subclass for async/await-style implementation of channels, with flow control

This subclass provides asynchronous `read()` and `write()` calls for
subclasses, with familiar semantics.  `write()` doesn't buffer, so the
`done()` method on the base channel class can be used in a way similar to
`shutdown()`.  A high-level `sendfile()` method is available to send the
entire contents of a binary-mode file-like object.

The subclass must provide an async `run()` function, which will be spawned
as a task.  The task is cancelled when the channel is closed.

On the receiving side, the channel will respond to flow control pings to
indicate that it has received the data, but only after it has been consumed
by `read()`.

On the sending side, write() will block if the channel backs up.
z(asyncio.Queue[bytes | JsonObject | None]Úreceive_queuer  Nr@   r6   re   c              ƒ   ó   #   • [         e7fr!   r‘   r“   s     r%   ÚrunÚAsyncChannel.run  s   é € Ü!Ð!ùr  c              ƒ   ó  #   •  [         R                  " 5       U l        U R                  U R	                  U5      I S h  v•N 5        g  N	! [         R
                   a    U R                  5          g [         a)  nU R                  UR                  5       5         S nAg S nAf[         a'  nU R                  S[        U5      S.5         S nAg S nAf[         a)    U R                  S[        R                  " 5       S.5        e f = f7f)Nr…   )Úproblemrk   zinternal-error)rJ  Úcause)rË   r  r  rv   rG  ÚCancelledErrorr[   r‡   r   rI   ÚBaseExceptionÚ	tracebackÚ
format_exc)r2   r@   rˆ   s      r%   Úrun_wrapperÚAsyncChannel.run_wrapper  s¹   é € ð	Ü×0Ò0Ó2ˆDŒIØ�J‰J˜TŸX™X gÓ.×.Õ/Ñ.øÜ×%Ñ%ó 	Ø�J‰JŽLÜó 	(Ø�J‰J�s—}‘}“×'Ñ'ûÜó 	KØ�J‰JÐ#3ÄÀCÃÑI×JÑJûÜó 	Ø�J‰JÐ#3¼i×>RÒ>RÓ>TÑUÔVØð	üs\   ‚D„9A	 ½A¾A	 ÁDÁA	 Á	$DÁ-DÁ/	DÁ8BÂDÂDÂ)CÃDÃ6DÄDc              ƒ   óÔ   #   •  U R                   R                  5       I S h  v•N nUc  g [        U[        5      (       a  U R	                  U5        OU R                  U5        U$ Mb   ND7fr!   )rE  rB   rH   r   r¡   r¨   )r2   Úitems     r%   ÚreadÚAsyncChannel.read  s[   é € ð
 Ø×+Ñ+×/Ñ/Ó1×1ˆDØ‰|ØÜ˜$¤×(Ñ(Ø—‘˜tÕ$à—‘˜dÔ#Ø�ñ Ù1ùs   ‚A(¡A&¢AA(r£   c              ƒ   ó¤   #   • U R                  U5      (       d4  U R                  R                  5       U l        U R                  I S h  v•N   g g  N7fr!   )râ   r  Úcreate_futureÚwrite_waiterr§   s     r%   r"  ÚAsyncChannel.write-  s@   é € Ø�~‰~˜d×#Ñ#Ø $§	¡	× 7Ñ 7Ó 9ˆDÔØ×#Ñ#×#Ñ#ð $á#ùs   ‚AAÁAÁAc              �   ó`   #   • U R                   R                  " S U/UQ70 UD6I S h  v•N $  N7fr!   )r  Úrun_in_executor)r2   ÚfnÚargsr°   s       r%   Ú	in_threadÚAsyncChannel.in_thread2  s,   é € Ø—Y‘Y×.Ò.¨t°RÐI¸$ÒIÀ&ÑI×IÐIÑIùs   ‚%.§,¨.Ústreamc              ƒ   ó,  #   • U    U R                   R                  S UR                  [        R                  5      I S h  v•N nUS:X  a  OU R                  U5      I S h  v•N   M_  U R                  5         S S S 5        g  N? N!! , (       d  f       g = f7f)Nr(   )r  r[  rT  r^   rØ   r"  ru   )r2   r`  r£   s      r%   ÚsendfileÚAsyncChannel.sendfile5  sr   é € ÚØØ!ŸY™Y×6Ñ6°t¸V¿[¹[Ì'×J\ÑJ\Ó]×]�Ø˜3“;ØØ—j‘j Ó&×&Ð&ñ	 ð �I‰IŒK÷ ˆVá]ñ '÷ �Vüs?   ‚B…:B¿A?Á BÁBÁ BÁ6	BÁ?BÂBÂ
BÂBc                 ód   • U R                   b#  U R                   R                  S 5        S U l         g g r!   )rX  Ú
set_resultrN   s    r%   rò   ÚAsyncChannel.do_resume_send?  s/   € Ø×ÑÑ(Ø×Ñ×(Ñ(¨Ô.Ø $ˆDÕð )r(   c                 ó´   • [         R                  " 5       U l        U R                  U R	                  U5      U R
                  R                   SU S3S9U l        g )Nz.run_wrapper(Ú))rÐ   )rË   ÚQueuerE  rÌ   rP  r4   rR   Ú	_run_taskr“   s     r%   r{   ÚAsyncChannel.do_openD  sS   € Ü$Ÿ]š]›_ˆÔØ×)Ñ)¨$×*:Ñ*:¸7Ó*CØ26·.±.×2IÑ2IÐ1JÈ-ÐX_ÐW`Ð`aÐ/bð *ð dˆ�r(   c                 ó:   • U R                   R                  S 5        g r!   ©rE  Ú
put_nowaitrN   s    r%   r}   ÚAsyncChannel.do_doneI  s   € Ø×Ñ×%Ñ% dÕ+r(   c                 ó8   • U R                   R                  5         g r!   )rj  ÚcancelrN   s    r%   r~   ÚAsyncChannel.do_closeL  s   € Ø�‰×ÑÕr(   rk   c                 ó:   • U R                   R                  U5        g r!   rm  rž   s     r%   r   ÚAsyncChannel.do_pingO  s   € Ø×Ñ×%Ñ% gÕ.r(   c                 ó:   • U R                   R                  U5        gr5  rm  r§   s     r%   r«   ÚAsyncChannel.do_dataR  s   € Ø×Ñ×%Ñ% dÔ+Ør(   )rj  r  rE  rX  )r6   zbytes | None)r\  zCallable[_P, _T]r]  z_P.argsr°   z	_P.kwargsr6   r   rþ   )rR   rS   rT   rU   r@  rV   rË   rA  rX  r   rG  rP  rT  rp   r"  r^  r   rb  rò   r{   r}   r~   r   rW   r«   rX   rM   r(   r%   rD  rD  ñ  sÅ   ‡ ñð* >Ó=Ø
×
#Ñ
#Ó#ð €Lð" ð "Ð0Cô "ð¨ð ¸ô ôð$ ð $¨$ô $ô
Jð Xð °$ô ô%ð
d˜zð d¨dô dô
,ô ð/˜zð /¨dô /ð˜Eð  d÷ r(   rD  c                   óR   • \ rS rSr% SrS\S'   S\SS4S jrS\SS4S	 jrSS
 jr	Sr
g)ÚGeneratorChanneliW  a
  A trivial Channel subclass for sending data from a generator with flow control.

Calls the .do_yield_data() generator with the options from the open message
and sends the data which it yields.  If the generator returns a value it
will be used for the close message.
z"Generator[bytes, None, JsonObject]Ú_GeneratorChannel__generatorr@   r6   c                 ó   • [         er!   r‘   r“   s     r%   Údo_yield_dataÚGeneratorChannel.do_yield_data`  r•   r(   Nc                 óP   • U R                  U5      U l        U R                  5         g r!   )r{  ry  rò   r“   s     r%   r{   ÚGeneratorChannel.do_openc  s!   € Ø×-Ñ-¨gÓ6ˆÔØ×ÑÕr(   c                 ó6  •  U R                  [        U R                  5      5      (       a-   U R                  [        U R                  5      5      (       a  M,  g g ! [         a5  nU R	                  5         U R                  UR                  5         S nAg S nAff = fr!   )râ   Únextry  ÚStopIterationru   rv   Úvalue)r2   Ústops     r%   rò   ÚGeneratorChannel.do_resume_sendg  sl   € ð	#Ø—.‘.¤ d×&6Ñ&6Ó!7×8Ñ8Øð —.‘.¤ d×&6Ñ&6Ó!7×8Õ8øäó 	#Ø�I‰IŒKØ�J‰J�t—z‘z×"Ñ"ûð	#ús   ‚AA Á
BÁ#+BÂB)Ú__generatorrþ   )rR   rS   rT   rU   r@  rV   r   r{  r{   rò   rX   rM   r(   r%   rx  rx  W  s;   ‡ ñð 6Ó5ð" Zð "Ð4Xô "ð˜zð ¨dô ÷#r(   rx  )+rË   rß   r   ÚloggingrN  Útypingr   r   r   r   r   r   r	   r
   Újsonutilr   r   r   r   r   r   r   Úprotocolr   r   r   r   r   Ú	getLoggerrR   rï   ÚTYPE_CHECKINGÚTypeVarr   Ú	ParamSpecr   r   r[   r^   ÚProtocolr  rD  rx  rM   r(   r%   Ú<module>r�     sÉ   ðó$ Û Û Û Û Û ß _× _Ó _ç b× bÑ bÝ $ß 1Ñ 1à	×	Ò	˜8Ó	$€ð 
××Ø	�Š˜Ó	€BØ	×	Ò	˜$Ó	€Bô:˜ô :ôz	�>ô 	ôEAˆhô EAôP#�g˜w×/Ñ/ô #ôDc�7ô côL#�wõ #r(   