AlkantarClanX12

Your IP : 18.117.168.71


Current Path : /proc/self/root/opt/alt/python39/lib64/python3.9/curses/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python39/lib64/python3.9/curses/__pycache__/textpad.cpython-39.opt-2.pyc

a

R�f��@sRddlZddlZdd�ZGdd�d�ZedkrNdd�Ze�e�Zed	e	e��dS)
�NcCs�|�|d|tj||d�|�||dtj||d�|�||dtj||d�|�|d|tj||d�|�||tj�|�||tj�|�||tj�|�||tj	�dS�N�)
Zvline�cursesZ	ACS_VLINEZhlineZ	ACS_HLINE�addchZACS_ULCORNERZACS_URCORNERZACS_LRCORNERZACS_LLCORNER)�win�uly�ulxZlryZlrx�r	�3/opt/alt/python39/lib64/python3.9/curses/textpad.py�	rectanglesrc@sHeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zddd�Z	dS)�TextboxFcCs.||_||_|��d|_d|_|�d�dSr)r�insert_mode�_update_max_yx�stripspaces�lastcmdZkeypad)�selfrr
r	r	r
�__init__+szTextbox.__init__cCs&|j��\}}|d|_|d|_dSr)rZgetmaxyx�maxy�maxx)rrrr	r	r
r3s
zTextbox._update_max_yxcCsX|��|j}tj�|j�||��tjjkr@t|j|d�}qTn
|dkrJqT|d}q|S)Nrr)rrr�asciir�inchZSP�min)r�yZlastr	r	r
�_end_of_line8s
zTextbox._end_of_linecCs�|��|j��\}}d}||jks.||jkr�|jr>|j��}z|j�|�Wntj	ybYn0|jr�tj
�|�sxq�|}|j��\}}|dur||f}q|dur�|jj|�dS�N)
rr�getyxrrr
rrr�errorr�isprint�move)r�chr�xZbackyxZoldchr	r	r
�_insert_printable_charFs$

zTextbox._insert_printable_charcCsV|��|j��\}}||_tj�|�rJ||jks<||jkrF|�	|��n|tjj
krh|j�|d��n�|tjjtj
tjjtjfv�r|dkr�|j�||d�nB|dkr�n8|jr�|j�|d|�|d��n|j�|d|j�|tjjtjfv�rR|j���nL|tjjk�r"|j���n0|tjjk�rb|j�rN|j�||�|��n|j�||j��n�|tjjtjfv�r�||jk�r�|j�||d�n ||jk�r�n|j�|dd��n�|tjjk�r�dS|tjjk�r|jdk�r�dS||jk�rR|j�|dd��nF|tjjk�rZ|dk�r@|�|�dk�r@|j��n|j�||�|j��n�|tjjk�rt|j��n�|tjjtjfv�r�||jk�rR|j�|d|�||�|d�k�rR|j�|d|�|d��nz|tjj k�r�|j�!�n`|tjj"tj#fv�rR|dk�rR|j�|d|�||�|d�k�rR|j�|d|�|d��dS)Nrr)$rrrrrrrrrr!ZSOHrZSTXZKEY_LEFTZBSZ
KEY_BACKSPACErrZdelchZEOTZENQZACKZ	KEY_RIGHTZBEL�NL�VTZdeletelnZclrtoeolZFF�refreshZSOZKEY_DOWNZSIZinsertlnZDLEZKEY_UP)rrrr r	r	r
�
do_command_sr
zTextbox.do_commandc
Cs�d}|��t|jd�D]�}|j�|d�|�|�}|dkrF|jrFqt|jd�D]4}|jrj||krjq�|tt	j
�
|j�||���}qT|jdkr|d}q|S)N�rr�
)r�rangerrrrrr�chrrrr)r�resultr�stopr r	r	r
�gather�s
 

zTextbox.gatherNcCs<|j��}|r||�}|sq|�|�s(q4|j��q|��Sr)rZgetchr%r$r,)rZvalidaterr	r	r
�edit�s

zTextbox.edit)F)N)
�__name__�
__module__�__qualname__rrrr!r%r,r-r	r	r	r
rs
Ar�__main__cCsfd\}}d\}}|�|d|d�t�||||�}t||d|d||||�|��t|���S)N)�	�)���zUse Ctrl-G to end editing.r)ZaddstrrZnewwinrr$rr-)ZstdscrZncolsZnlinesrrrr	r	r
�test_editbox�s r7zContents of text box:)
rZcurses.asciirrr.r7�wrapper�str�print�reprr	r	r	r
�<module>s
,