Your IP : 3.144.89.197


Current Path : /opt/alt/python312/lib64/python3.12/curses/__pycache__/
Upload File :
Current File : //opt/alt/python312/lib64/python3.12/curses/__pycache__/textpad.cpython-312.opt-2.pyc

�

�Q�fJ���	ddlZddlZd�ZGd�d�Zedk(r%d�Zeje�Zede	e��yy)�Nc�f�	|j|dz|tj||z
dz
�|j||dztj||z
dz
�|j||dztj||z
dz
�|j|dz|tj||z
dz
�|j||tj�|j||tj�|j||tj�|j||tj�y�N�)
�vline�curses�	ACS_VLINE�hline�	ACS_HLINE�addch�ACS_ULCORNER�ACS_URCORNER�ACS_LRCORNER�ACS_LLCORNER)�win�uly�ulx�lry�lrxs     �5/opt/alt/python312/lib64/python3.12/curses/textpad.py�	rectanglers�����I�I�c�!�e�S�&�*�*�C�#�I��M�:��I�I�c�3�q�5�&�*�*�C�#�I��M�:��I�I�c�3�q�5�&�*�*�C�#�I��M�:��I�I�c�!�e�S�&�*�*�C�#�I��M�:��I�I�c�3��+�+�,��I�I�c�3��+�+�,��I�I�c�3��+�+�,��I�I�c�3��+�+�,�c�<�eZdZ	d	d�Zd�Zd�Zd�Zd�Zd�Zd
d�Z	y)�Textboxc�~�||_||_|j�d|_d|_|jd�yr)r�insert_mode�_update_max_yx�stripspaces�lastcmd�keypad)�selfrrs   r�__init__zTextbox.__init__+s7�����&��������������
�
�1�
rc�f�|jj�\}}|dz
|_|dz
|_yr)r�getmaxyx�maxy�maxx)r r$r%s   rrzTextbox._update_max_yx3s.���X�X�&�&�(�
��d��1�H��	��1�H��	rc�:�	|j�|j}	tjj|jj||��tjjk7rt|j|dz�}	|S|dk(r	|S|dz
}�~)Nrr)rr%r�asciir�inch�SP�min)r �y�lasts   r�_end_of_linezTextbox._end_of_line8s���	@������y�y����|�|�!�!�$�(�(�-�-��4�"8�9�V�\�\�_�_�L��4�9�9�d�1�f�-������������!�8�D�
rc�n�|j�|jj�\}}d}||jks||jkr�|j
r|jj
�}	|jj|�|j
rtjj�snE|}|jj�\}}|�||f}||jkr��||jkr��|�|jj|�yy#tj$rY��wxYw�N)
rr�getyxr$r%rr(rr�errorr'�isprint�move)r �chr+�x�backyx�oldchs      r�_insert_printable_charzTextbox._insert_printable_charFs������������!���A����$�)�)�m�q�4�9�9�}�������
�
���
������r�"��#�#�6�<�<�+?�+?��+F���B��X�X�^�^�%�F�Q���~��A���!�$�)�)�m�q�4�9�9�}�$���D�H�H�M�M�6�"����<�<�
��
�s�5D�D4�3D4c��	|j�|jj�\}}||_tj
j
|�r0||jks||jkr|j|�y|tj
jk(r|jj|d�y|tj
jtjtj
jtjtj
j fvr�|dkDr |jj||dz
�nm|dk(rng|j"r2|jj|dz
|j%|dz
��n)|jj|dz
|j�|tj
jtjtj
j fvr|jj'�y|tj
j(k(r|jj'�y|tj
j*k(r_|j"r,|jj||j%|��y|jj||j�y|tj
j,tj.fvr`||jkr |jj||dz�y||jk(r	y|jj|dzd�y|tj
j0k(ry|tj
j2k(r?|jdk(ry||jkr|jj|dzd�y|tj
j4k(rk|dk(r/|j%|�dk(r|jj7�y|jj||�|jj9�y|tj
j:k(r|jj=�y|tj
j>tj@fvrw||jkrg|jj|dz|�||j%|dz�kDr1|jj|dz|j%|dz��y|tj
jBk(r|jjE�y|tj
jFtjHfvrl|dkDrg|jj|dz
|�||j%|dz
�kDr1|jj|dz
|j%|dz
��y)Nrr)%rrr0rrr'r2r$r%r8�SOHr3�STX�KEY_LEFT�BS�
KEY_BACKSPACE�DELrr-�delch�EOT�ENQ�ACK�	KEY_RIGHT�BEL�NL�VT�deleteln�clrtoeol�FF�refresh�SO�KEY_DOWN�SI�insertln�DLE�KEY_UP)r r4r+r5s    r�
do_commandzTextbox.do_command_s���+����������!���A�����<�<����#��4�9�9�}��D�I�I�
��+�+�B�/�v�u�6�<�<�#�#�
#��H�H�M�M�!�Q��r�q�F�L�L�$�$�V�_�_��L�L�O�O��(�(��L�L�$�$�&�&��1�u����
�
�a��1��%��a����!�!����
�
�a��c�4�#4�#4�Q�q�S�#9�:����
�
�a��c�4�9�9�-��f�l�l�o�o�v�';�';�V�\�\�=M�=M�N�N������ �V�U�6�<�<�#�#�
#��H�H�N�N��R�Q�6�<�<�#�#�
#�������
�
�a��!2�!2�1�!5�6�L�I���
�
�a����+�H�G�F�L�L�$�$�f�&6�&6�7�
7��4�9�9�}����
�
�a��1��%�B�A�d�i�i���>�;���
�
�a��c�1�%�:�9�6�<�<�#�#�
#��
�6�<�<�?�?�
"��y�y�A�~���T�Y�Y�����
�
�a��c�1�%�,�+�6�<�<�?�?�
"��A�v�$�+�+�A�.�!�3����!�!�#�&�!���
�
�a��#����!�!�#���6�<�<�?�?�
"��H�H������F�L�L�O�O�V�_�_�5�
5��4�9�9�}����
�
�a��c�1�%��t�(�(��1��-�-��H�H�M�M�!�A�#�t�'8�'8��1��'=�>���6�<�<�?�?�
"��H�H������F�L�L�$�$�f�m�m�4�
4��1�u����
�
�a��c�1�%��t�(�(��1��-�-��H�H�M�M�!�A�#�t�'8�'8��1��'=�>�rc��	d}|j�t|jdz�D]�}|jj	|d�|j|�}|dk(r
|jr�Bt|jdz�D]Z}|jr||kDrnG|ttjj|jj||���z}�\|jdkDs��|dz}��|S)N�rr�
)r�ranger$rr3r-rr%�chrrr'r()r �resultr+�stopr5s     r�gatherzTextbox.gather�s���8��������t�y�y��{�#�A��H�H�M�M�!�Q���$�$�Q�'�D��q�y�T�-�-���4�9�9�Q�;�'���#�#��D����#�f�l�l�&8�&8������q�!�9L�&M�"N�N��(��y�y�1�}��$���$��
rNc���		|jj�}|r||�}|s�(|j|�s	|j	�S|jj��dr/)r�getchrRrKrZ)r �validater4s   r�editzTextbox.edit�s\��<�������!�B���b�\�����?�?�2�&���{�{�}��
�H�H����r)Fr/)
�__name__�
__module__�__qualname__r!rr-r8rRrZr^�rrrrs,���.��
�#�2B�H�"rr�__main__c��d\}}d\}}|j|dz
|d�tj||||�}t||dz
|dz
||z||z�|j	�t|�j
�S)N)�	�)���zUse Ctrl-G to end editing.r)�addstrr�newwinrrKrr^)�stdscr�ncols�nlinesrrrs      r�test_editboxro�sz���
��v����S��
�
�c�!�e�S�">�?��m�m�F�E�3��4���&�#�a�%��Q���f��c�E�k�B������s�|� � �"�"rzContents of text box:)
r�curses.asciirrr_ro�wrapper�str�print�reprrbrr�<module>rusU��@�
��-�l�l�\�z��#��&�.�.��
&�C�	�
!�4��9�-�r

?>