Your IP : 18.225.55.104


Current Path : /opt/alt/python313/lib64/python3.13/_pyrepl/__pycache__/
Upload File :
Current File : //opt/alt/python313/lib64/python3.13/_pyrepl/__pycache__/reader.cpython-313.pyc

�

1}goq�
���%SSKJr SSKrSSKJr SSKJrJrJr SSK	r	SSK
JrJr SSK
JrJrJr SSKJrJrJr SS	KJr \R,rSS
KJrJrJrJr SISjr\"S5urrr SJS
jr!SKSjr"\#"/SPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPSPS P\RHS!:XaS"OS#QS$PS%PS&PS'PS(PS)PS*PS+PS,PS-PS.PS/PS0PS1PS2PS3PS4PS5PS6PS7PS8PS9PS:PS;P\%"\&\"S<S=55Vs/sHoS>:wdM
US?4PM sn-\%"\&\"S@SA55Vs/sHoRO5(dMUS?4PM sn-/SBQ-5r(SC\)SD'\"SESF9"SGSH55r*gs snfs snf)L�)�annotationsN)�contextmanager)�	dataclass�field�fields)�can_colorize�
ANSIColors�)�commands�console�input)�ANSI_ESCAPE_SEQUENCE�wlen�	str_width)�trace)�Callback�SimpleContextManager�KeySpec�CommandNamec�*�/n/nUH�nUS:Xa$URU5 URS5 M-[U5S:a$URU5 URS5 M`[R"U5R	S5(aBS[U5-nURU5 URS/[
U5S-
-5 M�URU5 UR[U55 M� SRU5U4$)	z�disp_str(buffer:string) -> (string, [int])

Return the string that should be the printed representation of
|buffer| and a list detailing where the characters of |buffer|
get used up.  E.g.:

>>> disp_str(chr(3))
('^C', [1, 0])

���r
�Cz\u%04xr�)	�append�ord�unicodedata�category�
startswith�extend�lenr�join)�buffer�b�s�cs    �5/opt/alt/python313/lib64/python3.13/_pyrepl/reader.py�disp_strr)*s����A��A�
����;�
�H�H�Q�K�
�H�H�Q�K�
��V�c�\�
�H�H�Q�K�
�H�H�Q�K�
�
!�
!�!�
$�
/�
/��
4�
4��C��F�"�A�
�H�H�Q�K�
�H�H�a�S�C��F�Q�J�'�(�
�H�H�Q�K�
�H�H�Y�q�\�"���7�7�1�:�q�=���c��0n[[[S55Hn[X'M
 [[[S55Vs/sHo"R	5(dMUPM snHn[
X'M
 [=US'US'U$s snf)N��
� )�map�chr�range�
SYNTAX_SYMBOL�isalnum�SYNTAX_WORD�SYNTAX_WHITESPACE)�str'�as   r(�make_default_syntax_tabler9Msr���B�
��e�C�j�
!�����"��S�%��*�-�
=�-�A����a�-�
=�����>�*�*�B�t�H�r�#�w�
�I��>s�B
�"B
c�N�0n[[5R5H�n[U[5(dM[U[5(dM1URSR5(dMUXUR'XURRSS5'M� U$)Nr�_�-)
�varsr�values�
isinstance�type�
issubclass�Command�__name__�islower�replace)�result�vs  r(�make_default_commandsrHXsy��/1�F�
�(�^�
"�
"�
$���a����:�a��#9�#9�a�j�j��m�>S�>S�>U�>U�!"�1�:�:��34�1�:�:�%�%�c�3�/�0�%��Mr*)z\C-a�beginning-of-line)z\C-b�left)z\C-c�	interrupt)z\C-d�delete)z\C-e�end-of-line)z\C-f�right)z\C-g�cancel)z\C-h�	backspace)z\C-j�accept)z	\<return>rQ)z\C-kz	kill-line)z\C-lzclear-screen)z\C-mrQ)z\C-tztranspose-characters)z\C-uzunix-line-discard)z\C-wzunix-word-rubout)z\C-x\C-uz
upcase-region)z\C-y�yank�win32�))z\C-z�suspend)z\M-b�
backward-word)z\M-czcapitalize-word)z\M-dz	kill-word)z\M-f�forward-word)z\M-lz
downcase-word)z\M-tztranspose-words)z\M-uzupcase-word)z\M-yzyank-pop)z\M--�	digit-arg)z\M-0rX)z\M-1rX)z\M-2rX)z\M-3rX)z\M-4rX)z\M-5rX)z\M-6rX)z\M-7rX)z\M-8rX)z\M-9rX)z\M-\nrQ)z\\�self-insert)z	\x1b[200~�enable_bracketed_paste)z	\x1b[201~�disable_bracketed_paste)z\x03zctrl-c� ��\rYrr-))z\<up>�up)z\<down>�down)z\<left>rJ)z
\C-\<left>rV)z\<right>rN)z\C-\<right>rW)z	\<delete>rL)z\x1b[3~rL)z\<backspace>rP)z\M-\<backspace>zbackward-kill-word)z\<end>rM)z\<home>rI)z\<f1>�help)z\<f2>zshow-history)z\<f3>z
paste-mode)z\EOF�end)z\EOH�home�'tuple[tuple[KeySpec, CommandName], ...]�default_keymapT)�slotsc��\rSrSr%SrS\S'\"\S9rS\S'Sr	S	\S
'Sr
S\S
'SrS\S'SrS\S'Sr
S\S'\"\S9rS\S'SrS\S'SrS\S'SrS\S'SrS\S'SrS\S'SrS\S '\"\S9rS!\S"'SrS#\S$'\"\S9rS%\S&'S'rS(\S)'\"SS*9rS+\S,'\"\S9rS-\S.'\"\S9rS\S/'\"SS*9rS0\S1'\"SS*9rS2\S3'\"SS*9r S2\S4'\"\S9r!S\S5'Sr"S\S6'Sr#S7\S8'\$"S9S:55r%\"\%S9r&S:\S;'S_S<jr'S`S=jr(SaS>jr)\*SbS?j5r+ScSdS@jjr,ScSdSAjjr-ScSdSBjjr.ScSdSCjjr/SeSDjr0SfSEjr1SgShSFjjr2SiSGjr3SjSHjr4S_SIjr5SkSJjr6SlSKjr7SmSLjr8S_SMjr9SnSNjr:S_SOjr;SoSPjr<S_SQjr=\>SpSRj5r?S_SSjr@SqSrSTjjrAS_SUjrBS_SVjrCSsSWjrDS_SXjrEStSuSYjjrFSvSZjrGScSwS[jjrHSxS\jrISyS]jrJS^rKg)z�Reader�a`The Reader class implements the bare bones of a command reader,
handling such details as editing and cursor motion.  What it does
not support are such things as completion or history support -
these are implemented elsewhere.

Instance variables of note include:

  * buffer:
    A *list* (*not* a string at the moment :-) containing all the
    characters that have been entered.
  * console:
    Hopefully encapsulates the OS dependent stuff.
  * pos:
    A 0-based index into `buffer' for where the insertion point
    is.
  * screeninfo:
    Ahem.  This list contains some info needed to move the
    insertion point around reasonably efficiently.
  * cxy, lxy:
    the position of the insertion point in screen ...
  * syntax_table:
    Dictionary mapping characters to `syntax class'; read the
    emacs docs to see what this means :-)
  * commands:
    Dictionary mapping command names to command classes.
  * arg:
    The emacs-style prefix argument.  It will be None if no such
    argument has been provided.
  * dirty:
    True if we need to refresh the display.
  * kill_ring:
    The emacs-style kill-ring; manipulated with yank & yank-pop
  * ps1, ps2, ps3, ps4:
    prompts.  ps1 is the prompt for a one-line input; for a
    multiline input it looks like:
        ps2> first line of input goes here
        ps3> second and further
        ps3> lines get ps3
        ...
        ps4> and the last one gets ps4
    As with the usual top-level, you can set these to instances if
    you like; str() will be called on them (once) at the beginning
    of each command.  Don't put really long or newline containing
    strings here, please!
    This is just the default policy; you can change it freely by
    overriding get_prompt() (and indeed some standard subclasses
    do).
  * finished:
    handle1 will set this to a true value if a command signals
    that we're done.
zconsole.Consoler��default_factory�	list[str]r$r�int�posz->> �str�ps1z/>> �ps2z|.. �ps3z\__ �ps4zlist[list[str]]�	kill_ringr�msgN�
int | None�argF�bool�dirty�finished�
paste_mode�in_bracketed_pastezdict[str, type[Command]]rztype[Command] | None�last_command�dict[str, int]�syntax_tablerTztuple[tuple[str, str], ...]�keymap��init�input.KeymapTranslator�input_transzlist[input.KeymapTranslator]�input_trans_stack�screen�list[tuple[int, list[int]]]�
screeninfo�tuple[int, int]�cxy�lxy�scheduled_commandsr�Callback | None�threading_hookc���\rSrSr%SrS\S'\"\S9rS\S'\"SS9r	S	\S
'\"\S9r
S\S'\"SS9rS
\S'\"SS9rS\S'\"SS9r
S\S'SrS\S'SSjrSSjrSSjrSrg)�Reader.RefreshCache�Frxr|rjrlr�r�r�r�z	list[int]�line_end_offsetsrmrnr�r��
dimensions�invalidatedc�.�URUlUR5UlUR5UlURUlUR
UlURRURR4Ul	SUl
g�NF)r|�copyr�r�rnr�r�width�heightr�r�)�self�readerr�r�s    r(�update_cache� Reader.RefreshCache.update_cachesk��
'-�&?�&?�D�#� �+�+�-�D�K�(�o�o�/�D�O��z�z�D�H��z�z�D�H�$�n�n�2�2�F�N�N�4I�4I�I�D�O�$�D�r*c���UR(agURRURR4nX R:gnUR
UR
:gnU=(d U(+$r�)r�rr�r�r�r|)r�r�r��dimensions_changed�
paste_changeds     r(�valid�Reader.RefreshCache.valids]���������-�-�v�~�~�/D�/D�D�J�!+���!>��"�5�5��9P�9P�P�M�*�;�m�<�<r*c��UR(a[S5eSn[URUR5n[	UR
5nUS:�a(UR
US-
nX2:�aX$4$US-nUS:�aM(SnX$4$)NzCache is invalidatedrr
)r��
ValueError�minrnr"r�)r�r��offset�earliest_common_pos�num_common_liness     r(�get_cached_location�'Reader.RefreshCache.get_cached_locations������ �!7�8�8��F�"%�f�j�j�$�(�(�";��"�4�#8�#8�9��"�Q�&��.�.�/?�!�/C�D��&�/���+�+�!�A�%� �	#�Q�&����+�+r*)r�r�r|r�rnr�r�N)r�rhr�rlr�r��return�None)r�rhr�rx)r�rhr�r�)rC�
__module__�__qualname__�__firstlineno__r|�__annotations__r�listr�r�r�rnr�r�r�r�r�r��__static_attributes__rTr*r(�RefreshCacher��s���#(��D�(�!�$�7��	�7�27�U�2C�
�/�C�&+�D�&A��)�A��e�$��S�$�$�%�0��_�0�&+��&7�
�O�7�!��T�!�	%�!'�	%�!*�	%�&A�	%��		%�	=�
	,r*r��last_refresh_cachec��UR5Ul[R"URSSS9UlS/4/UlUR
5UlURS4Ul	[5Ul
UR
URlURURlURURlSURlg)N�invalid-keyrY��invalid_cls�
character_clsr)rr)
�collect_keymapr�r
�KeymapTranslatorr�r��pos2xyr�rnr�rr�r��r�s r(�
__post_init__�Reader.__post_init__.s����)�)�+��� �1�1��K�K�]�-�
����r�7�)����;�;�=����H�H�a�=���(�N���-1�_�_����*�&*�h�h����#�&*�h�h����#�-3����*r*c��[$�N)rer�s r(r��Reader.collect_keymap@s���r*c��SnSnURRU5(aURRU5up!URRnX1S2	URRnXAS2	URR
nXQS2	URnXb-nU=(a URUS-
S:gnSRURUS5RS5nSn	Sn
[X�5GHMup�[U5n
SUs=::aU
::aO OXk4UlSn	O(U	(a!U
S-
n
X�RR:�a GO�U(aSnSnO$URX�Us=:�=(a S:�Os 5nSU;aRUR!S5unnnUR#U5 UR#U5 UR#S/45 SU;aMRXmS--nUR%U5unn['U5unn[)U5U-URR*-nUS:XaBX-S--
nUR#U5 UR#UU-5 UR#UU45 GMrSnU(dGM~US:XaUOSnSnSnUH/nUU-URR*U-
:�a OUS-
nUU-
nM1 US:XaUOSn[U5U:�aUU-
nSnS/nOUUS--
nSn/nUR#U5 UR#UUSU-U-5 UR#UUSUU-45 UUSnUUSnUS-
nU(aM�GMP X@lUR-5UlUR0(aFUR0RS5H'nUR#U5 UR#S/45 M) URR3XU5 U$)	zETranslate changes in self.buffer into changes in self.console.screen.rNr
r.rFTr^)r�r�r�r�r�r�rnr$r#�split�	enumerater"r�rr��
get_prompt�	partitionr�process_promptr)rr�r�r�rur�)r�r�r�r�r��last_refresh_line_end_offsetsrn�prompt_from_cache�lines�cursor_found�lines_beyond_cursor�ln�line�ll�prompt�
pre_promptr;�lp�l�l2�	wrapcount�i�prelen�index_to_wrap_before�column�character_width�pre�post�after�mlines                              r(�calc_screen�Reader.calc_screenCs��������"�"�(�(��.�.�'+�'>�'>�'R�'R�SW�'X�$�F��(�(�/�/���$�%��,�,�7�7�
��(�)�(,�(?�(?�(P�(P�%�)�*;�<��h�h���
��#�G����F�Q�J�(?�4�(G��������F�G�,�-�3�3�D�9������!�%�:�H�B��T��B��C�~�2�~��7���#���#�q�(�#�&���)<�)<�<�� �$)�!�������3�^�^�!�^�<���&�.�(.�(8�(8��(>�%�
�A�v�-�4�4�V�<��
�
�j�)��!�!�1�b�'�*�	�&�.�

��6�M�C��,�,�V�4�J�F�B��T�N�E�A�r��a��2��$�,�,�*<�*<�<�I��A�~��q�&� ��-�4�4�V�<��
�
�f�q�j�)��!�!�2�r�(�+����a�#$��6�R�q�F�+,�(��F�+-��!�O�3�t�|�|�7I�7I�F�7R�R�!�,��1�,��/�1��	,.�
%&��F�&��C��1�v� 4�4��"6�6��#��!"����"6��":�:��!�� "��1�8�8��@��M�M�#��*?�+?�(@�"@�4�"G�H��%�%�v�r�2G�3G�/H�5�/P�&Q�R��.�/�0�A��0�1�2�B���F�A�/�a�C;�r%���;�;�=����8�8�������-���
�
�e�$��!�!�1�b�'�*�.�	
���,�,�T�:�F��
r*c	��S	SjnSnU"U5nSnURSU5nUS:XaOfURSU5nUS:XaOMX6U-
S--
nXUnU[[U[R"U555-nX'XS-U--
nUS-nMXSnU[[U[R"U555-nX'-
nX#4$)
a
Process the prompt.

This means calculate the length of the prompt. The character 
and  are used to bracket ANSI control sequences and need to be
excluded from the length calculation.  So also a copy of the prompt
is returned with these control characters removed.c�&�[SU55$)Nc3�8# �UHn[U5v� M g7fr�)r)�.0r�s  r(�	<genexpr>�6Reader.process_prompt.<locals>.wlen.<locals>.<genexpr>�s���/�Q��y��|�|�Q�s�)�sum)r&s r(r�#Reader.process_prompt.<locals>.wlen�s���/�Q�/�/�/r*rr�����r
N)r&ror�rm)�findr�r0r�findall)r�r�
out_promptr�rnr&�e�keeps        r(r��Reader.process_prompt�s���	0��
���L��������F�C�(�A��B�w�����F�A�&�A��B�w����U�Q�Y��A��a�=�D�
��S��3�;�;�D�A�B�C�C�A���A���!2�2�2�J��a�%�C���d�|��	�S��T�/�7�7��=�>�
?�?����
��}�r*c��UcURnURnURnUS-nUS:�aMURX1[5[:wa-US-nUS:�a"URX1[5[:waM-US:�aMURX1[5[:Xa-US-nUS:�a"URX1[5[:XaM-US-$)z�Return the 0-based index of the word break preceding p most
immediately.

p defaults to self.pos; word boundaries are determined using
self.syntax_table.r
r)rnrr$�getr5�r��pr7r%s    r(�bow�
Reader.bow�s���
�9����A�
�
�
���K�K��	�Q����1�f������k�2�k�A�
��F�A��1�f������k�2�k�A��1�f������k�2�k�A�
��F�A��1�f������k�2�k�A��1�u�r*c���UcURnURnURnU[U5:aVUR	X1[
5[
:wa6US-
nU[U5:a"UR	X1[
5[
:waM6U[U5:aVUR	X1[
5[
:Xa6US-
nU[U5:a"UR	X1[
5[
:XaM6U$)z�Return the 0-based index of the word break following p most
immediately.

p defaults to self.pos; word boundaries are determined using
self.syntax_table.r
)rnrr$r"r�r5r�s    r(�eow�
Reader.eow�s���
�9����A�
�
�
���K�K���#�a�&�j�R�V�V�A�D�+�6�+�E�
��F�A��#�a�&�j�R�V�V�A�D�+�6�+�E��#�a�&�j�R�V�V�A�D�+�6�+�E�
��F�A��#�a�&�j�R�V�V�A�D�+�6�+�E��r*c��UcURnURnUS-nUS:�aX!S:waUS-nUS:�a
X!S:waMUS-$)zaReturn the 0-based index of the line break preceding p most
immediately.

p defaults to self.pos.r
rr.)rnr$�r�r�r%s   r(�bol�
Reader.bol�sV��

�9����A��K�K��	�Q����1�f�����
��F�A��1�f������1�u�r*c��UcURnURnU[U5:a&X!S:waUS-
nU[U5:a
X!S:waMU$)zaReturn the 0-based index of the line break following p most
immediately.

p defaults to self.pos.r.r
)rnr$r"r�s   r(�eol�
Reader.eol�sQ��

�9����A��K�K���#�a�&�j�Q�T�T�\�
��F�A��#�a�&�j�Q�T�T�\��r*c�^�URUS[URUS5-$)z#Return the last x-offset for line yrr
)r�r�)r��ys  r(�
max_column�Reader.max_columns.�����q�!�!�$�s�4�?�?�1�+=�a�+@�'A�A�Ar*c�2�[UR5S-
$)Nr
)r"r�r�s r(�max_row�Reader.max_rows���4�?�?�#�a�'�'r*c�8�URcU$UR$)zmReturn any prefix argument that the user has supplied,
returning `default' if there is None.  Defaults to 1.
)rw)r��defaults  r(�get_arg�Reader.get_args���8�8���N��x�x�r*c���URbU(aSURS3nO�UR(aUR(dSnOxSUR;a\US:Xa
URnOUUR
(a+XRR
S5:Xa
UR
nOURnOURnUR(a$[RU[R3nU$)z@Return what should be in the left-hand margin for line
`lineno'.z(arg: z) z(paste) r.r)
rwr{r|r$rqrs�countrrrprr	�BOLD_MAGENTA�RESET)r��lineno�cursor_on_liner�s    r(r��Reader.get_prompts����8�8��N��d�h�h�Z�r�*�F�
�_�_�T�%<�%<��F�
�T�[�[�
 ���{��������f���(9�(9�$�(?�?����������X�X�F����"�/�/�0����9I�9I�8J�K�F��
r*c�Z�URRUR5 Xlgr�)r�rr�)r��itranss  r(�push_input_trans�Reader.push_input_trans+s"�����%�%�d�&6�&6�7�!�r*c�B�URR5Ulgr�)r��popr�r�s r(�pop_input_trans�Reader.pop_input_trans/s���1�1�5�5�7��r*c���SnSnXB:auURUupV[U5URS5-
nU[U5-URR
:�nU(aX7S-
-
nOX7S--
nUS-
nXB:aMuSn	URUSn
X�:aCURUSU	S:XaM X�RUSU	-
n
U	S-
n	US-
nX�:aMCX0lg)z%Set pos according to coordinates x, yrr
N)r�r"rr�rr�rn)r��xrrnr��
prompt_len�character_widthsr��in_wrapped_line�j�cur_xs           r(�setpos_from_xy�Reader.setpos_from_xy2s����
���e�+/�?�?�1�+=�(�J��)�*�-=�-C�-C�A�-F�F�F�(�3�/?�+@�@�D�L�L�DV�DV�V�O����z�!����z�!��
��F�A��e�
������"�1�%���i����q�!�!�$�Q�'�1�,���_�_�Q�'��*�1�-�-�E�
��F�A��1�H�C��i��r*c��SnURnSUs=::a[UR5::de eU[UR5:XaK[UR5S-
nURUup4U[	U5-URS5-U4$URH�up4[U5URS5-
nU[	U5-URR:�nU(aUS-
OUnXr:�a O>U[	U5-URR:�aX%S-
-nOX%S--nUS-
nM� W[	WSU5-U4$)z.Return the x, y coordinates of position 'pos'.rr
N)rnr"r$r�r�rrr�)r�rrnr�r�r�r!r�s        r(r��
Reader.pos2xyKs4��
���h�h���C�+�3�t�{�{�+�+�+�+�+�+��#�d�k�k�"�"��D�O�O�$�q�(�A��O�O�A�&�E�A��s�2�w�;����!��,�a�/�/��_�_�E�A��B��"�(�(�1�+�%�A��#�b�'�k�T�\�\�-?�-?�?�O�-�Q��U�1�F��}���3�r�7�{�d�l�l�0�0�0��1�u����1�u���
��F�A�%��3�r�$�3�x�=� �!�#�#r*c��[U5URURUR&U=R[U5-
slSUlg)z%Insert 'text' at the insertion point.TN)r�r$rnr"ry)r��texts  r(�insert�
Reader.insertds7��+/��:����D�H�H�t�x�x�(����C��I�����
r*c�t�UR5UlURR"UR6 g)z.Move the cursor to reflect changes in self.posN)r�r�r�move_cursorr�s r(�
update_cursor�Reader.update_cursorjs%���;�;�=������ � �$�(�(�+r*c�`�[USS5(aURbSUlSUlgg)z6This function is called to allow post command cleanup.�kills_digit_argTN)�getattrrwry�r��cmds  r(�
after_command�Reader.after_commandos/���3�)�4�0�0��x�x�#�!��
��D�H�1r*c��URR5 SUlSUlURSS2	SUlSUlSUlUR5 UR(aAURR5nURU/45 UR(aM@gg![a UR5 ef=f)z~Get ready to run.  Call restore when finished.  You must not
write to the console in between the calls to prepare and
restore.NFrT)r�preparerwrzr$rnryr}r��
BaseException�restorer�r�do_cmdr3s  r(r8�Reader.preparevs���	��L�L� � �"��D�H�!�D�M����A���D�H��D�J� $�D������
�%�%��)�)�-�-�/�C��K�K��b�	�"��%�%�%��	�	��L�L�N��	�s�AB1�1C
c�P�UR(dg[XR5$r�)r}rA)r��clss  r(�last_command_is�Reader.last_command_is�s��� � ���#�0�0�1�1r*c�8�URR5 g)zClean up after a run.N)rr:r�s r(r:�Reader.restore�s�������r*c	#�V# �[U5Vs0sH"oR[XR5_M$ nnUR5 Sv� SHn[	XX#5 M UR5 gs snf!SHn[	XX#5 M UR5 f=f7f)z0A context manager to delegate to another reader.N)rurprqrrrsr{)r�namer2r:�setattrr8)r��f�
prev_staterws    r(rU�Reader.suspend�s����>D�D�\�J�\��f�f�g�d�F�F�3�3�\�
�J�	��L�L�N��H����:�?�3�I��L�L�N��K��
I����:�?�3�I��L�L�N�s&�B)�)A8�B)�A=�-B)�=)B&�&B)c��g)z2Called when a command signals that we're finished.NrTr�s r(�finish�
Reader.finish�s��r*c�`�SU-S-UlSUlURR5 g)Nz! r/T)ruryr�beep)r�rus  r(�error�Reader.error�s)���#�:��#�����
������r*c�H�UR(aUR5 ggr�)ry�refreshr�s r(�
update_screen�Reader.update_screen�s���:�:��L�L�N�r*c��UR(a%UR(aURSS:XdgUR5UlURRURUR5 SUlg)z#Recalculate and refresh the screen.r�r.NF)r|r$r�r�rrQr�ryr�s r(rQ�Reader.refresh�sX���"�"�t�{�{�4�;�;�r�?�d�;R���&�&�(��������T�[�[�$�(�(�3���
r*c��[SUS9 [US[5(a.URR	US[R
5nO[US[5(aUSnOgU"U/UQ76nUR5 URU5 UR(aUR5 OUR5 [U[R5(dX l
[UR5UlUR (a+UR"R5 UR5 gg)z�`cmd` is a tuple of "event_name" and "event", which in the current
implementation is always just the "buffer" which happens to be a list
of single-character strings.zreceived command {cmd})r4rN)rr?rorr��invalid_commandr@�dor5ryrQr.�	digit_argr}rxrJrzr)r�r4�command_type�commands    r(r;�
Reader.do_cmd�s���
	�&�C�0��c�!�f�c�"�"��=�=�,�,�S��V�X�5M�5M�N�L�
��A���
%�
%��q�6�L���t�*�c�*���
�
�����7�#��:�:��L�L�N���� ��#�x�1�1�2�2� ,���W�^�^�,��
��=�=��L�L���!��K�K�M�r*c��URnUc"S[R;aSSKJn U"U5 UbU"5 URRnU(a	U"5 gg![
a N3f=f![
a gf=f)N�	threadingr
)�install_threading_hook)r��sys�modules�_threading_handlerr_�	Exceptionr�
input_hook)r�r�r_rds    r(�	run_hooks�Reader.run_hooks�s����,�,���!�k�S�[�[�&@�B�"�4�(��%�
�� ��\�\�,�,�
��
�����	�
��
���
��
�s#�A$�A4�$
A1�0A1�4
B�Bc��UR(aSUlSUlUR5 URR	S5 URRSS9nU(d
U(aMUgSnURS:XaURRU5 ODURS:XaUR5 O#URS:XaUR5 OSnU(aURR5nOURUR/nUcU(aGMgURU5 g)	zHandle a single event.  Wait as long as it takes if block
is true (the default), otherwise return False if no event is
pending.rT�dF��block�key�scroll�resize)
ruryrer�wait�	get_event�evtr��pushrQr��datar;)r�rj�event�	translater4s     r(�handle1�Reader.handle1�s���
�8�8��D�H��D�J���N�N���L�L���c�"��L�L�*�*��*�7�E������I��y�y�E�!�� � �%�%�e�,����h�&��������h�&�����!�	���&�&�*�*�,���y�y�%�*�*�-���{�����K�K���r*c�X�URRU5 URSS9 g)NFri)r�	push_charru)r��chars  r(rx�Reader.push_chars"�������t�$����5��!r*c�*�UR5 UbU"5 UR5 UR(d#UR5 UR(dM#UR	5UR5 $!UR5 f=f)z|Read a line.  The implementation of this method also shows
how to drive Reader if you want more control over the event
loop.)r8rQrzru�get_unicoder:)r��startup_hooks  r(�readline�Reader.readlinesb��	
����		��'����L�L�N��m�m������m�m�m��#�#�%�
�L�L�N��D�L�L�N�s�AB� B�Bc�z�URX44-Ul[R"URSSS9Ulg)Nr�rYr�)r�r
r�r�)r��specr[s   r(�bind�Reader.bind's5���k�k�d�_�$6�6��� �1�1��K�K�]�-�
��r*c�8�SRUR5$)z.Return the current buffer as a unicode string.r)r#r$r�s r(r|�Reader.get_unicode-s���w�w�t�{�{�#�#r*)
rwrr�ryrzr�r�r}r�rurnr�r�)r�r�)r�rd)r�rl)r�ror�ztuple[str, int]r�)r�rvr�rm)rrmr�rm)r�rm)r
)rrmr�rm)rrmrrxr�ro)rr�r�r�)rrmrrmr�r�)r�r�)r)zstr | list[str]r�r�)r4rBr�r�)r>r@r�rx)r�r)�none)ruror�r�)r4ztuple[str, list[str]]r�r�)T)rjrxr�rx)ryzint | bytesr�r�)r}r�r�ro)r�rr[rr�r�)r�ro)LrCr�r�r��__doc__r�rr�r$rnrprqrrrsrtrurwryrzr{r|rHrr}r9rr�r�r�r�r�r�r�r�rr�rr�r�r�r�r��staticmethodr�r�r�r�rrrrr�rrr$r�r*r.r5r8r?r:rrUrJrNrRrQr;rerurxr~r�r|r�rTr*r(rhrh�sO��2�h���d�3�F�I�3��C��L��C����C����C����C���!&�t�!<�I��<��C��M��C����E�4���H�d���J���$���$�).�?T�)U�H�&�U�)-�L�&�-�#(�9R�#S�L�.�S�*,�F�'�,�*/�U�*;�K�'�;�6;�D�6Q��3�Q��d�3�F�I�3�.3��.?�J�+�?� �e�,�C��,� �e�,�C��,�$)�$�$?��	�?��L�$��&*�N�O�*��,,�,,��,,�\(-�\�'J���J�4�$�a�F�$��$�L�"� �
�B�(���*"�8��2$�2�,�
�#�*2�
��	��	�
��
���>�$)�V"�� 
�$r*rh)r$ror�ztuple[str, list[int]])r�r~)r�z dict[CommandName, type[Command]])+�
__future__rr`�
contextlibr�dataclassesrrrr�	_colorizerr	rrrr
�utilsrrrrrB�typesrrrrr)r2r6r5r3r9rH�tuple�platformr0r1�isalpharer�rh)r's0r(�<module>r�s���,#�
�%�0�0��.�'�&�8�8���
�
��G�G��@16�a��-��;�
���;@�,�&�,��,�	�,�	�	,�
	!�,�	�
,�	�,�	�,�	�,�	!�,�	�,�	"�,�	�,�	*�,�	'�,� 	&�!,�"	'�#,�$	�%,�&����'�"�-E�',�(	#�),�*	%�+,�,	�-,�.	"�/,�0	#�1,�2	%�3,�4	!�5,�6	�7,�8	�9,�:	�;,�<	�=,�>	�?,�@	�A,�B	�C,�D	�E,�F	�G,�H	�I,�J	�K,�L	�M,�N	�O,�P	 �Q,�R	1�S,�T	2�U,�V	�W,�Z$'�s�E�"�c�N�#;�I�#;�a�D�y���=��#;�I�[-J�\$'�s�E�#�s�O�#<�L�#<�a�	�	����=��#<�L�].M�^�_B�D;��7�D�N���F
$�F
$��F
$��5J��Ls�2	E(
�?E(
�E-
�9E-

?>