ok

Mini Shell

Direktori : /proc/self/root/opt/alt/python37/lib64/python3.7/curses/__pycache__/
Upload File :
Current File : //proc/self/root/opt/alt/python37/lib64/python3.7/curses/__pycache__/textpad.cpython-37.opt-2.pyc

B

0��c��@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/python37/lib64/python3.7/curses/textpad.py�	rectanglesr
c@sHeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zddd�Z	dS)�TextboxFcCs.||_||_|��d|_d|_|�d�dS)Nr)r�insert_mode�_update_max_yx�stripspaces�lastcmdZkeypad)�selfrrrrr	�__init__+szTextbox.__init__cCs&|j��\}}|d|_|d|_dS)Nr)rZgetmaxyx�maxy�maxx)rrrrrr	r
3s
zTextbox._update_max_yxcCs\|��|j}xHtj�|j�||��tjjkrBt|j|d�}Pn
|dkrLP|d}qW|S)Nrr)r
rr�asciir�inchZSP�min)r�yZlastrrr	�_end_of_line8szTextbox._end_of_linecCs�|��|j��\}}d}x�||jks0||jkr�|jr@|j��}y|j�|�Wntj	k
rfYnX|jrztj
�|�s|P|}|j��\}}|dkr||f}qW|dk	r�|jj|�dS)N)
r
r�getyxrrrrrr�errorr�isprint�move)r�chr�xZbackyxZoldchrrr	�_insert_printable_charFs$
zTextbox._insert_printable_charcCsV|��|j��\}}||_tj�|�rJ||jks<||jkrF|�	|��n|tjj
krh|j�|d��n�|tjjtj
tjjtjfk�r|dkr�|j�||d�nB|dkr�n8|jr�|j�|d|�|d��n|j�|d|j�|tjjtjfk�rR|j���nL|tjjk�r"|j���n0|tjjk�rb|j�rN|j�||�|��n|j�||j��n�|tjjtjfk�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�|tjjtjfk�r�||jk�rR|j�|d|�||�|d�k�rR|j�|d|�|d��nz|tjj k�r�|j�!�n`|tjj"tj#fk�rR|dk�rR|j�|d|�||�|d�k�rR|j�|d|�|d��dS)Nrr)$r
rrrrrrrrrZSOHrZSTXZKEY_LEFTZBSZ
KEY_BACKSPACErrZdelchZEOTZENQZACKZ	KEY_RIGHTZBEL�NLZVTZdeletelnZclrtoeolZFF�refreshZSOZKEY_DOWNZSIZinsertlnZDLEZKEY_UP)rrrrrrr	�
do_command_sr
zTextbox.do_commandc
Cs�d}|��x�t|jd�D]�}|j�|d�|�|�}|dkrH|jrHqxDt|jd�D]2}|jrl||krlP|tt	j
�
|j�||���}qXW|jdkr|d}qW|S)N�rr�
)r
�rangerrrrrr�chrrrr)r�resultr�stoprrrr	�gather�s
"
zTextbox.gatherNcCs@x6|j��}|r||�}|sq|�|�s*P|j��qW|��S)N)rZgetchr"r!r))rZvalidaterrrr	�edit�s

zTextbox.edit)F)N)
�__name__�
__module__�__qualname__rr
rrr"r)r*rrrr	rs
Ar�__main__cCsfd\}}d\}}|�|d|d�t�||||�}t||d|d||||�|��t|���S)N)�	�)���zUse Ctrl-G to end editing.r)ZaddstrrZnewwinr
r!rr*)ZstdscrZncolsZnlinesrrrrrr	�test_editbox�s r4zContents of text box:)
rZcurses.asciir
rr+r4�wrapper�str�print�reprrrrr	�<module>s
,	


Zerion Mini Shell 1.0