b374k
m1n1 1.01
Apache/2.2.15 (CentOS)
Linux obd60-6c49958d75-2q7cw 5.4.0-174-generic #193-Ubuntu SMP Thu Mar 7 14:29:28 UTC 2024 x86_64
uid=48(apache) gid=48(apache) groups=48(apache)
server ip : 104.21.65.202 | your ip : 10.244.126.0
safemode OFF
 >  / usr / lib64 / python2.6 / curses /
Filename/usr/lib64/python2.6/curses/textpad.pyo
Size6.8 kb
Permissionrw-r--r--
Ownerapache
Create time23-Dec-2025 17:41
Last modified20-Jun-2019 19:45
Last accessed22-Apr-2026 09:41
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
Ñò
§ÚêLc@svdZddkZddkZd�Zdd d��YZedjo+d�Zeie�ZdGe e�GHndS(
s:Simple textbox editing widget with Emacs-like keybindings.iÿÿÿÿNcCsð|i|d|ti||d�|i||dti||d�|i||dti||d�|i|d|ti||d�|i||ti�|i||ti�|i||ti�|i||ti �dS(s^Draw a rectangle with corners at the provided upper-left
and lower-right coordinates.
iN(
tvlinetcursest ACS_VLINEthlinet ACS_HLINEtaddcht ACS_ULCORNERt ACS_URCORNERt ACS_LRCORNERt ACS_LLCORNER(twintulytulxtlrytlrx((s&/usr/lib64/python2.6/curses/textpad.pyt rectangles%%%%tTextboxcBsJeZdZed�Zd�Zd�Zd�Zd�Zdd�Z
RS(sdEditing 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
cCsm||_||_|i�\|_|_|id|_|id|_d|_d|_|id�dS(Ni( R
t insert_modetgetmaxyxtmaxytmaxxt stripspacestNonetlastcmdtkeypad(tselfR
R((s&/usr/lib64/python2.6/curses/textpad.pyt__init__+s    cCs�|i}xqtoitii|ii||��tiijot|i|d�}Pn|djoPn|d}q W|S(suGo to the location of the first blank on the given line,
returning the index of the last non-blank character.ii(RtTrueRtasciiR
tinchtSPtmin(Rtytlast((s&/usr/lib64/python2.6/curses/textpad.pyt _end_of_line5s .
cCsá|ii�\}}||ijp||ijo¨|io|ii�}ny|ii|�Wntij
onX|ioP|ii�\}}ti i
|�o$|i |�|ii ||�qÙqÝndS(N(
R
tgetyxRRRRRRterrorRtisprintt_insert_printable_chartmove(RtchR txtoldchtbackytbackx((s&/usr/lib64/python2.6/curses/textpad.pyR&Bs 


cCs�|ii�\}}||_tii|�o5||ijp||ijo|i|�q�n6|tii jo|ii
|d�n |tii ti tii
tifjo¶|djo|ii
||d�n^|djonM|io(|ii
|d|i|d��n|ii
|d|i�|tii
tifjo|ii�q�n+|tiijo|ii�n|tiijoD|io |ii
||i|��q�|ii
||i�n°|tiitifjoZ||ijo|ii
||d�q�||ijoq�|ii
|dd�n:|tiijodS|tiijoD|idjodS||ijo|ii
|dd�q�nË|tiijoX|djo'|i|�djo|ii�q�|ii
||�|ii�n`|tiijo|ii�n<|tiitifjoq||ijo]|ii
|d|�||i|d�jo(|ii
|d|i|d��qéq�n¯|tiijo|ii �n�|tii!ti"fjon|djo]|ii
|d|�||i|d�jo(|ii
|d|i|d��q�q�ndS(s!Process a single editing command.ii(#R
R#RRRR%RRR&tSOHR'tSTXtKEY_LEFTtBSt
KEY_BACKSPACERR"tdelchtEOTtENQtACKt KEY_RIGHTtBELtNLtVTtdeletelntclrtoeoltFFtrefreshtSOtKEY_DOWNtSItinsertlntDLEtKEY_UP(RR(R R)((s&/usr/lib64/python2.6/curses/textpad.pyt
do_commandTsp  +


(
 #0
0cCsëd}xÞt|id�D]É}|ii|d�|i|�}|djo|ioqnxbt|id�D]M}|io||joPn|tti i |ii
||���}qtW|idjo|d}qqW|S(s.Collect and return the contents of the window.tiis
( trangeRR
R'R"RRtchrRRR(RtresultR tstopR)((s&/usr/lib64/python2.6/curses/textpad.pytgather�s/cCsfxY|ii�}|o||�}n|pqn|i|�pPn|ii�q|i�S(s2Edit in the widget window and collect the results.(R
tgetchRDR=RJ(RtvalidateR(((s&/usr/lib64/python2.6/curses/textpad.pytedit¤sN( t__name__t
__module__t__doc__tFalseRR"R&RDRJRRM(((s&/usr/lib64/python2.6/curses/textpad.pyRs

 @ t__main__cCs�d\}}d \}}|i|d|d�ti||||�}t||d|d||||�|i�t|�i�S(
Ni iiiisUse Ctrl-G to end editing.i(i i(ii(taddstrRtnewwinRR=RRM(tstdscrtncolstnlinesR R R
((s&/usr/lib64/python2.6/curses/textpad.pyt test_editbox²s  &
sContents of text box:((
RPRt curses.asciiRRRNRXtwrappertstrtrepr(((s&/usr/lib64/python2.6/curses/textpad.pyt<module>s  
�