⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.73
Server IP:
97.74.87.16
Server:
Linux 16.87.74.97.host.secureserver.net 5.14.0-503.38.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Apr 18 08:52:10 EDT 2025 x86_64
Server Software:
Apache
PHP Version:
8.2.28
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib64
/
python3.9
/
curses
/
__pycache__
/
View File Name :
textpad.cpython-39.pyc
a �����DOg�����������������������@���sV���d�Z�ddlZddlZdd��ZG�dd��d�ZedkrRdd ��Ze�e�Ze d e e���dS�)z:Simple textbox editing widget with Emacs-like keybindings.�����Nc�����������������C���s����|���|d�|tj||�d���|��||d�tj||�d���|��||d�tj||�d���|���|d�|tj||�d���|��||tj��|��||tj��|��||tj��|��||tj ��dS�)z^Draw a rectangle with corners at the provided upper-left and lower-right coordinates. ����N) Zvline�cursesZ ACS_VLINEZhlineZ ACS_HLINE�addchZACS_ULCORNERZACS_URCORNERZACS_LRCORNERZACS_LLCORNER)�win�uly�ulxZlryZlrx��r����&/usr/lib64/python3.9/curses/textpad.py� rectangle���s����r ���c�������������������@���sL���e�Zd�ZdZddd�Zdd��Zdd��Zd d ��Zdd��Zd d��Z ddd�Z dS�)�Textboxad��Editing widget using the interior of a window object. Supports the following Emacs-like key bindings: Ctrl-A Go to left edge of window. Ctrl-B Cursor left, wrapping to previous line if appropriate. Ctrl-D Delete character under cursor. Ctrl-E Go to right edge (stripspaces off) or end of line (stripspaces on). Ctrl-F Cursor right, wrapping to next line when appropriate. Ctrl-G Terminate, returning the window contents. Ctrl-H Delete character backward. Ctrl-J Terminate if the window is 1 line, otherwise insert newline. Ctrl-K If line is blank, delete it, otherwise clear to end of line. Ctrl-L Refresh screen. Ctrl-N Cursor down; move down one line. Ctrl-O Insert a blank line at cursor location. Ctrl-P Cursor up; move up one line. Move operations do nothing if the cursor is at an edge where the movement is not possible. The following synonyms are supported where possible: KEY_LEFT = Ctrl-B, KEY_RIGHT = Ctrl-F, KEY_UP = Ctrl-P, KEY_DOWN = Ctrl-N KEY_BACKSPACE = Ctrl-h Fc�����������������C���s.���||�_�||�_|�����d|�_d�|�_|�d��d�S��Nr���)r����insert_mode�_update_max_yx�stripspaces�lastcmdZkeypad)�selfr���r ���r���r���r ����__init__+���s����zTextbox.__init__c�����������������C���s&���|�j����\}}|d�|�_|d�|�_d�S�r���)r���Zgetmaxyx�maxy�maxx)r���r���r���r���r���r ���r���3���s���� zTextbox._update_max_yxc�����������������C���sX���|������|�j}tj�|�j�||��tjjkr@t|�j|d��}qTn |dkrJqT|d�}q|S�)zuGo to the location of the first blank on the given line, returning the index of the last non-blank character.r���r���)r���r���r����asciir����inchZSP�min)r����y�lastr���r���r ����_end_of_line8���s���� zTextbox._end_of_linec�����������������C���s����|������|�j���\}}d�}||�jk�s.||�jk�r�|�jr>|�j���}z|�j�|��W�n�tj yb���Y�n0�|�jr�tj �|�sxq�|}|�j���\}}|d�u�r||f}q|d�ur�|�jj|���d�S�)N) r���r����getyxr���r���r ���r���r���r����errorr����isprint�move)r����chr����xZbackyxZoldchr���r���r ����_insert_printable_charF���s$���� zTextbox._insert_printable_charc�����������������C���sV��|������|�j���\}}||�_tj�|�rJ||�jk�s<||�jk�rF|�� |���n|tjj krh|�j�|d���n�|tjjtj 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�|d�d���n�|tjjk�r�dS�|tjjk�r|�jdk�r�dS�||�jk��rR|�j�|d�d���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�)z!Process a single editing command.r���r���)$r���r���r���r���r���r���r���r���r���r!���ZSOHr���ZSTXZKEY_LEFTZBSZ KEY_BACKSPACEr���r���ZdelchZEOTZENQZACKZ KEY_RIGHTZBEL�NL�VTZdeletelnZclrtoeolZFF�refreshZSOZKEY_DOWNZSIZinsertlnZDLEZKEY_UP)r���r���r���r ���r���r���r ���� do_command_���sr���� zTextbox.do_commandc�������������� ���C���s����d}|������t|�jd��D�]�}|�j�|d��|��|�}|dkrF|�jrFqt|�jd��D�]4}|�jrj||krj�q�|tt j � |�j�||����}qT|�jdkr|d�}q|S�)z.Collect and return the contents of the window.��r���r���� )r����ranger���r���r���r���r���r����chrr���r���r���)r����resultr����stopr ���r���r���r ����gather����s���� zTextbox.gatherNc�����������������C���s<���|�j����}|r||�}|sq�|��|�s(q4|�j�����q�|����S�)z2Edit in the widget window and collect the results.)r���Zgetchr%���r$���r,���)r����validater���r���r���r ����edit����s���� zTextbox.edit)F)N)�__name__� __module__�__qualname__�__doc__r���r���r���r!���r%���r,���r.���r���r���r���r ���r������s��� Ar����__main__c�����������������C���sf���d\}}d\}}|���|d�|d��t�||||�}t|�|d�|d�||�||���|�����t|����S�)N)� �������)������������zUse Ctrl-G to end editing.r���)Zaddstrr���Znewwinr ���r$���r���r.���)ZstdscrZncolsZnlinesr���r���r���r���r���r ����test_editbox����s���� r9���zContents of text box:)r2���r���Zcurses.asciir ���r���r/���r9����wrapper�str�print�reprr���r���r���r ����<module>���s��� �,