ó
    F\hÒ  ã                  óò   • S SK Jr  S SKrS SKJrJr  S SKrS SKrS SKrS SK	J
r
Jr  S SKrS SKrSr\(       a  S SKJr  S SKJr  \
 " S S	5      5       r\
 " S
 S\5      5       r " S S\R*                  5      rg)é    )ÚannotationsN)ÚABCÚabstractmethod)Ú	dataclassÚfieldF)ÚIO)ÚCallablec                  ó8   • \ rS rSr% S\S'   S\S'   SrS\S'   Srg	)
ÚEventé(   ÚstrÚevtÚdataó    ÚbytesÚraw© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__annotations__r   Ú__static_attributes__r   r   Ú&/usr/lib/python3.13/_pyrepl/console.pyr   r   (   s   ‡ à	ƒHØ
ƒIØ€CˆÖr   r   c                  óÎ  • \ rS rSr% S\S'   \" \S9rS\S'   SrS\S	'   S
r	S\S'       S        S!S jjr
\S"S j5       r\S#S j5       r\S#S j5       r\S$S j5       r\S%S j5       r\S&S j5       r\S'S(S jj5       r\S)S j5       r\S#S j5       r\S#S j5       r\S#S j5       r\S#S j5       r\S#S j5       r\S*S j5       r\S+S j5       r\S,S j5       r\S#S j5       rSrg)-ÚConsoleé/   útuple[int, int]Úposxy)Údefault_factoryú	list[str]Úscreené   ÚintÚheightéP   Úwidthc                ó  • U=(       d    [         R                  " 5       U l        [        U[        5      (       a  Xl        OUR                  5       U l        [        U[        5      (       a  X l        g UR                  5       U l        g ©N)ÚsysÚgetdefaultencodingÚencodingÚ
isinstancer$   Úinput_fdÚfilenoÚ	output_fd)ÚselfÚf_inÚf_outÚtermr,   s        r   Ú__init__ÚConsole.__init__6   sW   € ð !×<¤C×$:Ò$:Ó$<ˆŒä�dœC× Ñ Ø �Mà ŸK™K›MˆDŒMä�eœS×!Ñ!Ø"�Nà"Ÿ\™\›^ˆD�Nr   c                ó   • g r)   r   )r1   r"   Úxys      r   ÚrefreshÚConsole.refreshI   s   € ØGJr   c                ó   • g r)   r   ©r1   s    r   ÚprepareÚConsole.prepareL   ó   € Ø"r   c                ó   • g r)   r   r<   s    r   ÚrestoreÚConsole.restoreO   r?   r   c                ó   • g r)   r   )r1   ÚxÚys      r   Úmove_cursorÚConsole.move_cursorR   s   € Ø36r   c                ó   • g r)   r   )r1   Úvisibles     r   Úset_cursor_visÚConsole.set_cursor_visU   s   € Ø58r   c                ó   • g)zlReturn (height, width) where height and width are the height
and width of the terminal window in characters.Nr   r<   s    r   ÚgetheightwidthÚConsole.getheightwidthX   ó   € ð 	r   c                ó   • g)zŠReturn an Event instance.  Returns None if |block| is false
and there is no event pending, otherwise waits for the
completion of an event.Nr   )r1   Úblocks     r   Ú	get_eventÚConsole.get_event^   ó   € ð
 	r   c                ó   • g)z.
Push a character to the console event queue.
Nr   )r1   Úchars     r   Ú	push_charÚConsole.push_chare   rT   r   c                ó   • g r)   r   r<   s    r   ÚbeepÚConsole.beepl   s   € Ør   c                ó   • g)zWipe the screenNr   r<   s    r   ÚclearÚConsole.clearo   ó   € ð 	r   c                ó   • g)zsMove the cursor to the end of the display and otherwise get
ready for end.  XXX could be merged with restore?  Hmm.Nr   r<   s    r   ÚfinishÚConsole.finisht   rO   r   c                ó   • g)zTFlush all output to the screen (assuming there's some
buffering going on somewhere).Nr   r<   s    r   ÚflushoutputÚConsole.flushoutputz   rO   r   c                ó   • g)z0Forget all pending, but not yet processed input.Nr   r<   s    r   ÚforgetinputÚConsole.forgetinput€   r_   r   c                ó   • g)zAReturn the characters that have been typed but not yet
processed.Nr   r<   s    r   Ú
getpendingÚConsole.getpending…   rO   r   c                ó   • g)z®Wait for an event. The return value is True if an event is
available, False if the timeout has been reached. If timeout is
None, wait forever. The timeout is in milliseconds.Nr   )r1   Útimeouts     r   ÚwaitÚConsole.wait‹   rT   r   c                ó   • g)zReturns the current input hook.Nr   r<   s    r   Ú
input_hookÚConsole.input_hook’   r_   r   c                ó   • g r)   r   r<   s    r   ÚrepaintÚConsole.repaint—   r?   r   )r,   r.   r0   N)r   é   Ú rw   )r2   úIO[bytes] | intr3   rx   r4   r   r,   r   )r"   r!   r8   r   ÚreturnÚNone)ry   rz   )rD   r$   rE   r$   ry   rz   )rI   Úboolry   rz   )ry   r   )T)rQ   r{   ry   zEvent | None)rV   zint | bytesry   rz   )ry   r   )rm   zfloat | Nonery   r{   )ry   zCallable[[], int] | None)r   r   r   r   r   r   Úlistr"   r%   r'   r5   r   r9   r=   rA   rF   rJ   rM   rR   rW   rZ   r]   ra   rd   rg   rj   rn   Úpropertyrq   rt   r   r   r   r   r   r   /   s�  ‡ àÓÙ¨dÑ3€FˆIÓ3Ø€FˆCÓØ€Eˆ3ƒOð !"Ø!"ØØð,àð,ð ð,ð ð	,ð
 õ,ð& ÛJó ØJàÛ"ó Ø"àÛ"ó Ø"àÛ6ó Ø6àÛ8ó Ø8àóó ðð
 õó ðð óó ðð Ûó Øàóó ðð óó ðð
 óó ðð
 óó ðð óó ðð
 óó ðð óó ðð Û"ó Û"r   r   c                  ó~   ^ • \ rS rSr\" 5       r  S
SS.       SU 4S jjjjrSU 4S jjrS rS r	SS jr
S	rU =r$ )ÚInteractiveColoredConsoleé›   F)Ú
local_exitc               óV   >• [         TU ]  XUS9  [        R                  " 5       U l        g )N)ÚlocalsÚfilenamer�   )Úsuperr5   Ú	_colorizeÚcan_colorize)r1   rƒ   r„   r�   Ú	__class__s       €r   r5   Ú"InteractiveColoredConsole.__init__ž   s(   ø€ ô 	‰Ñ ÀjÐÑQÜ%×2Ò2Ó4ˆÕr   c                ó*   >• [         TU ]  " SSU0UD6  g )Nr„   r   )r…   Úshowsyntaxerror)r1   r„   Úkwargsrˆ   s      €r   r‹   Ú)InteractiveColoredConsole.showsyntaxerror¨   s   ø€ Ü‰ÒÑ<¨Ð<°VÓ<r   c                ó˜   • SS K nUR                  XUU R                  UR                  S9nU R	                  SR                  U5      5        g )Nr   )ÚcolorizeÚlimitrw   )Ú	tracebackÚformat_exceptionr‡   ÚBUILTIN_EXCEPTION_LIMITÚwriteÚjoin)r1   ÚtypÚvalueÚtbr‘   Úliness         r   Ú_excepthookÚ%InteractiveColoredConsole._excepthook«   sG   € ÛØ×*Ñ*Ø˜BØ×*Ñ*Ø×7Ñ7ð +ð 9ˆð 	�
‰
�2—7‘7˜5“>Õ"r   c                óœ   •  [        XR                  5        g ! [         a    e [         a    U R	                  5         U R
                  s $ f = fr)   )Úexecrƒ   Ú
SystemExitÚBaseExceptionÚshowtracebackÚSTATEMENT_FAILED)r1   Úcodes     r   ÚruncodeÚ!InteractiveColoredConsole.runcode³   sL   € ð	)Ü�—{‘{Ô#ð øô ó 	ØÜó 	)Ø×ÑÔ Ø×(Ñ(Ò(ð	)ús   ‚ ˜0AÁ
Ac                ón  •  U R                   R                  UUS[        R                  SS9nUR                  (       a  UR                  Gt pVUR                   H“  nUWL a  [        R                  O[        R                  nXvL a  UOSn	U" U/5      n
 U R                   R                  X¢U	5      n[        R                  " X±U5        Uc    g	U R)                  U5      nXàR*                  L d  M“    g   g! [        [
        [        4 a    U R                  X!S9   gf = f! [         ao  nUR                  S   S:X  aB  [        R                  R!                  ["        R$                  5      nUR'                  SU S35        U R                  X!S9   S nA  gS nAf[
        [        4 a    U R                  X!S9     gf = f)
Nr�   F)Úincomplete_input)Úsourcer   z'await' outside functionzTry the asyncio REPL (zG -m asyncio) to use top-level 'await' and run background asyncio tasks.T)ÚcompileÚcompilerÚastÚPyCF_ONLY_ASTÚSyntaxErrorÚOverflowErrorÚ
ValueErrorr‹   ÚbodyÚInteractiveÚModuleÚ	linecacheÚ_register_codeÚargsÚosÚpathÚbasenamer*   Ú
executableÚadd_noter£   r¡   )r1   r§   r„   ÚsymbolÚtreeÚ_Ú	last_stmtÚstmtÚwrapperÚ
the_symbolÚitemr¢   ÚeÚpythonÚresults                  r   Ú	runsourceÚ#InteractiveColoredConsole.runsource½   sš  € ð
	Ø—<‘<×(Ñ(ØØØÜ×!Ñ!Ø!&ð )ð ˆDð �9�9Ø ŸI™I‰MˆQØ—I”IˆDØ)-°Ò):”c—o’oÄÇ
Á
ˆGØ#'Ò#4™¸&ˆJÙ˜D˜6“?ˆDðØ—|‘|×,Ñ,¨T¸ZÓH�Ü×(Ò(¨°xÔ@ð ‰|Ùà—\‘\ $Ó'ˆFØ×.Ñ.Ô.ØØñ5 ð4 øô? œ]¬JÐ7ó 	Ø× Ñ  Ð Ñ9Ùð	ûô ó Ø—6‘6˜!‘9Ð :Ó:ÜŸW™W×-Ñ-¬c¯n©nÓ=�FØ—J‘JØ0°°ð 9Oð Pôð ×$Ñ$ XÐ$Ñ=ÝûÜ!¤:Ð.ó Ø×$Ñ$ XÐ$Ñ=Úðús0   ‚+C0 Â3DÃ0$DÄDÄ
F4Ä$A$FÆ"F4Æ3F4)r‡   )Nz	<console>)rƒ   zdict[str, object] | Noner„   r   r�   r{   ry   rz   r)   )z<input>Úsingle)r   r   r   r   Úobjectr¡   r5   r‹   rš   r£   rÅ   r   Ú__classcell__)rˆ   s   @r   r   r   ›   sf   ø† Ù“xÐð ,0Ø#ð5ð
 !ñ5à(ð5ð ð5ð
 ð5ð 
÷5ñ 5÷=ò#ò÷(ò (r   r   )Ú
__future__r   r†   Úabcr   r   rª   r¢   r²   Údataclassesr   r   Úos.pathrµ   r*   ÚTYPE_CHECKINGÚtypingr   r	   r   r   ÚInteractiveConsoler   r   r   r   Ú<module>rÑ      s~   ðõ( #ã ç #Û 
Û Û ß (Û Û 
ð €æÝÝð ÷ð ó ðð ôh#ˆcó h#ó ðh#ôVJ × 7Ñ 7õ Jr   