%PDF- %PDF-
Direktori : /usr/local/lib/python2.7/curses/ |
Current File : //usr/local/lib/python2.7/curses/textpad.pyo |
ó Pêáac @ st d Z d d l Z d d l Z d „ Z d d d „ ƒ YZ e d k rp d „ Z e j e ƒ Z d Ge e ƒ GHn d S( s: 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( s^ Draw a rectangle with corners at the provided upper-left and lower-right coordinates. i N( t vlinet cursest ACS_VLINEt hlinet ACS_HLINEt addcht ACS_ULCORNERt ACS_URCORNERt ACS_LRCORNERt ACS_LLCORNER( t wint ulyt ulxt lryt lrx( ( s* /usr/local/lib/python2.7/curses/textpad.pyt rectangle s %%%%t Textboxc B sS e Z d Z e d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d d „ Z RS( sd 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 s? | | _ | | _ | j ƒ d | _ d | _ | j d ƒ d S( Ni ( R t insert_modet _update_max_yxt stripspacest Nonet lastcmdt keypad( t selfR R ( ( s* /usr/local/lib/python2.7/curses/textpad.pyt __init__+ s c C s3 | j j ƒ \ } } | d | _ | d | _ d S( Ni ( R t getmaxyxt maxyt maxx( R R R ( ( s* /usr/local/lib/python2.7/curses/textpad.pyR 3 s c C s… | j ƒ | j } xk t r€ t j j | j j | | ƒ ƒ t j j k rc t | j | d ƒ } Pn | d k rs Pn | d } q W| S( su Go to the location of the first blank on the given line, returning the index of the last non-blank character.i i ( R R t TrueR t asciiR t incht SPt min( R t yt last( ( s* /usr/local/lib/python2.7/curses/textpad.pyt _end_of_line8 s -c C s | j ƒ | j j ƒ \ } } d } x¿ | | j k sF | | j k ræ | j ra | j j ƒ } n y | j j | ƒ Wn t j k r‹ n X| j s© t j j | ƒ r Pn | } | j j ƒ \ } } | d k r( | | f } q( q( W| d k r| j j | Œ n d S( N( R R t getyxR R R R R R R t errorR t isprintt move( R t chR! t xt backyxt oldch( ( s* /usr/local/lib/python2.7/curses/textpad.pyt _insert_printable_charF s$ ! c C so | j ƒ | j j ƒ \ } } | | _ t j j | ƒ rk | | j k sX | | j k rk| j | ƒ qkn | t j j k r“ | j j | d ƒ nØ| t j j t j t j j t j f k rj| 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 rk| j j ƒ qkn| t j j k rŒ| j j ƒ nß| t j j k rß| j rÆ| j j | | j | ƒ ƒ qk| j j | | j ƒ nŒ| t j j t j f k rO| | j k r#| j j | | d ƒ qk| | j k r5qk| j j | d d ƒ n| t j j k red S| t j j k r¶| j d k rŠd S| | j k rk| j j | d d ƒ qknµ| t j j k r| d k rù| j | ƒ d k rù| j j ƒ qk| j j | | ƒ | j j ƒ nO| t j j k r>| j j ƒ n-| t j j t j f k rÅ| | j k rk| j j | d | ƒ | | j | d ƒ k rÂ| j j | d | j | d ƒ ƒ qÂqkn¦ | t j j k rç| j j! ƒ n„ | t j j"