%PDF- %PDF-
| Direktori : /snap/core/17247/usr/lib/python3.5/curses/__pycache__/ |
| Current File : //snap/core/17247/usr/lib/python3.5/curses/__pycache__/textpad.cpython-35.pyc |
|�g� � @ s{ d Z d d l Z d d l Z d d � Z Gd d � d � Z e d k rw d d � Z e j e � Z e d
e
e � � d S)z:Simple textbox editing widget with Emacs-like keybindings.� 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)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/lib/python3.5/curses/textpad.py� rectangle s %%%%r
c @ sd e 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)�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 sm | | _ | | _ | j � \ | _ | _ | j d | _ | j d | _ d | _ d | _ | j d � d S)Nr )r �insert_modeZgetmaxyx�maxy�maxx�stripspaces�lastcmdZkeypad)�selfr r r r r �__init__+ s zTextbox.__init__c C sr | j } xb t j j | j j | | � � t j j k rS t | j | d � } Pn
| d k r` P| d } q W| 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 �asciir �inchZSP�min)r �yZlastr r r �_end_of_line5 s -zTextbox._end_of_linec C s� | j j � \ } } | | j k s3 | | j k r� | j rK | j j � } y | j j | � Wn t j k
rv Yn X| j r� | j j � \ } } t j j
| � r� | j | � | j j | | � d S)N)
r �getyxr
r r r r r �errorr �isprint�_insert_printable_char�move)r �chr �xZoldchZbackyZbackxr r r r B s
zTextbox._insert_printable_charc C sM | j j � \ } } | | _ t j j | � r^ | | j k sN | | j k rI| j | � n�| t j j k r� | j j
| d � n�| t j j t j t j j
t j f k rZ| 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 rI| j j � n�| t j j k r|| j j � n�| t j j k r�| j r�| j j
| | j | � � qI| j j
| | j � nz| t j j t j f k r?| | j k r| j j
| | d � qI| | j k r%qI| j j
| d d � n
| t j j k rUd S| t j j k r�| j d k rzd S| | j k rI| j j
| d d � n�| t j j k r | d k r�| j | � d k r�| j j � qI| j j
| | � | j j � n@| t j j k r+| j j � n| t j j t j f k r�| | j k rI| j j
| d | � | | j | d � k rI| j j
| d | j | d � � n� | t j j k r�| j j � n{ | t j j! t j"