ok

Mini Shell

Direktori : /proc/self/root/proc/self/root/usr/lib64/python3.6/curses/__pycache__/
Upload File :
Current File : //proc/self/root/proc/self/root/usr/lib64/python3.6/curses/__pycache__/textpad.cpython-36.opt-2.pyc

3


 \��@sRddlZddlZdd�ZGdd�d�ZedkrNdd�Zeje�Zed	e	e��dS)
�NcCs�|j|d|tj||d�|j||dtj||d�|j||dtj||d�|j|d|tj||d�|j||tj�|j||tj�|j||tj�|j||tj	�dS)N�)
Zvline�cursesZ	ACS_VLINEZhlineZ	ACS_HLINE�addchZACS_ULCORNERZACS_URCORNERZACS_LRCORNERZACS_LLCORNER)�win�uly�ulxZlryZlrx�r�&/usr/lib64/python3.6/curses/textpad.py�	rectanglesr
c@sHeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zddd�Z	dS)�TextboxFcCs.||_||_|j�d|_d|_|jd�dS)Nr)r�insert_mode�_update_max_yx�stripspaces�lastcmdZkeypad)�selfrrrrr	�__init__+szTextbox.__init__cCs&|jj�\}}|d|_|d|_dS)Nr)rZgetmaxyx�maxy�maxx)rrrrrr	r
3s
zTextbox._update_max_yxcCs\|j�|j}xHtjj|jj||��tjjkrBt|j|d�}Pn
|dkrLP|d}qW|S)Nrr)r
rr�asciir�inchZSP�min)r�yZlastrrr	�_end_of_line8szTextbox._end_of_linecCs�|j�|jj�\}}d}x�||jks0||jkr�|jr@|jj�}y|jj|�Wntj	k
rfYnX|js~tj
j|�r�P|}|jj�\}}|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�|jj�\}}||_tjj|�rJ||jks<||jkrF|j	|��n|tjj
krh|jj|d��n�|tjjtj
tjjtjfk�r|dkr�|jj||d�nB|dkr�n8|jr�|jj|d|j|d��n|jj|d|j�|tjjtjfk�rR|jj��nL|tjjk�r"|jj��n0|tjjk�rb|j�rN|jj||j|��n|jj||j��n�|tjjtjfk�r�||jk�r�|jj||d�n ||jk�r�n|jj|dd��n�|tjjk�r�dS|tjjk�r|jdk�r�dS||jk�rR|jj|dd��nF|tjjk�rZ|dk�r@|j|�dk�r@|jj�n|jj||�|jj�n�|tjjk�rt|jj�n�|tjjtjfk�r�||jk�rR|jj|d|�||j|d�k�rR|jj|d|j|d��nz|tjj k�r�|jj!�n`|tjj"tj#fk�rR|dk�rR|jj|d|�||j|d�k�rR|jj|d|j|d��dS)Nrr)$r
rrrrrrrrrZSOHrZSTXZKEY_LEFTZBSZ
KEY_BACKSPACErrZdelchZEOTZENQZACKZ	KEY_RIGHTZBEL�NLZVTZdeletelnZclrtoeolZFF�refresh�SOZKEY_DOWNZSIZinsertlnZDLEZKEY_UP)rrrrrrr	�
do_command_sr
zTextbox.do_commandcCs�d}|j�x�t|jd�D]�}|jj|d�|j|�}|dkrH|jrHqxDt|jd�D]2}|jrl||krlP|tt	j
j
|jj||���}qXW|jdkr|d}qW|S)N�rr�
)r
�rangerrrrrr�chrrrr)r�resultr�stoprrrr	�gather�s
"
zTextbox.gatherNcCs@x6|jj�}|r||�}|sq|j|�s*P|jj�qW|j�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	\}}|j|d|d�tj||||�}t||d|d||||�|j�t|�j�S)
N�	����zUse Ctrl-G to end editing.r)r0r1)r2r3)ZaddstrrZnewwinr
r!rr+)ZstdscrZncolsZnlinesrrrrrr	�test_editbox�s r5zContents of text box:)
rZcurses.asciir
rr,r5�wrapper�str�print�reprrrrr	�<module>s
,	


Zerion Mini Shell 1.0