Your IP : 3.143.24.110
�
��f� c @ s~ d Z d d l Z d d l Z d d � Z Gd d � d � Z e d k rz d d � Z e j e � Z e d
e
e � � n d S( u: Simple textbox editing widget with Emacs-like keybindings.i Nc C s� | j | d | t j | | d � | j | | d t j | | d � | j | | d t j | | d � | j | d | t j | | d � | j | | t j � | j | | t j � | j | | t j � | j | | t j � d S( u^ Draw a rectangle with corners at the provided upper-left
and lower-right coordinates.
i N(
u vlineu cursesu ACS_VLINEu hlineu ACS_HLINEu addchu ACS_ULCORNERu ACS_URCORNERu ACS_LRCORNERu ACS_LLCORNER( u winu ulyu ulxu lryu lrx( ( u3 /opt/alt/python33/lib64/python3.3/curses/textpad.pyu rectangle s %%%%u rectanglec B sh | Ee Z d Z d Z d d d � Z d d � Z d d � Z d d � Z d
d � Z d d d
� Z d S( u Textboxud 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
c C sm | | _ | | _ | j � \ | _ | _ | j d | _ | j d | _ d | _ d | _ | j d � d S( Ni ( u winu insert_modeu getmaxyxu maxyu maxxu stripspacesu Noneu lastcmdu keypad( u selfu winu insert_mode( ( u3 /opt/alt/python33/lib64/python3.3/curses/textpad.pyu __init__+ s u Textbox.__init__c C st | j } xd t j j | j j | | � � t j j k rS t | j | d � } Pn | d k rc Pn | d } q | S( uu Go to the location of the first blank on the given line,
returning the index of the last non-blank character.i i ( u maxxu cursesu asciiu winu inchu SPu min( u selfu yu last( ( u3 /opt/alt/python33/lib64/python3.3/curses/textpad.pyu _end_of_line5 s -
u Textbox._end_of_linec C s� | j j � \ } } | | j k s3 | | j k r� | j rN | j j � } n y | j j | � Wn t j k
ry Yn X| j r� | j j � \ } } t j j
| � r� | j | � | j j | | � q� q� n d S( N(
u winu getyxu maxyu maxxu insert_modeu inchu addchu cursesu erroru asciiu isprintu _insert_printable_charu move( u selfu chu yu xu oldchu backyu backx( ( u3 /opt/alt/python33/lib64/python3.3/curses/textpad.pyu _insert_printable_charB s
u Textbox._insert_printable_charc C se | j j � \ } } | | _ t j j | � ra | | j k sN | | j k ra| j | � qan | t j j k r� | j j
| d � n�| t j j t j t j j
t j f k r`| d k r� | j j
| | d � nY | d k r� nJ | j r| j j
| d | j | d � � n | j j
| d | j � | t j j
t j f k ra| j j � qan| t j j k r�| j j � n�| t j j k r�| j r�| j j
| | j | � � qa| j j
| | j � n�| t j j t j f k rE| | j k r| j j
| | d � qa| | j k r+qa| j j
| d d � n| t j j k r[d S| t j j k r�| j d k r�d S| | j k ra| j j
| d d � qan�| t j j k r| d k r�| j | � d k r�| j j � qa| j j
| | � | j j � nO| t j j k r4| j j � n-| t j j t j f k r�| | j k ra| j j
| d | � | | j | d � k r�| j j
| d | j | d � � q�qan� | t j j k r�| j j � n� | t j j! t j"