File "AutoExpand.cpython-34.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python34/lib64/python3.4/idlelib/__pycache__/AutoExpand.cpython-34.pyc
File size: 3.11 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit


e fC
@scdZddlZddlZGdddZedkr_ddlZejdddndS)	a[Complete the current word before the cursor with words in the editor.

Each menu selection or shortcut key selection replaces the word with a
different word with the same prefix. The search for matches begins
before the target and moves toward the top of the editor. It then starts
after the cursor and moves down. It then returns to the original word and
the cycle starts again.

Changing the current text line or leaving the cursor in a different
place before requesting the next selection causes AutoExpand to reset
its state.

This is an extension file and there is only one instance of AutoExpand.
Nc@sfeZdZddgfgZejejdZddZddZ	d	d
Z
ddZd
S)
AutoExpandZeditE_xpand Word<<expand-word>>_cCs|j|_d|_dS)N)textstate)selfZeditwinr	7/opt/alt/python34/lib64/python3.4/idlelib/AutoExpand.py__init__ szAutoExpand.__init__c
CsT|jjd}|jjdd}|jsE|j}d}nB|j\}}}}||ksr||kr|j}d}n|s|jjdS|j}|jjdt|d||}	|dt|}|dkr|jjn|jj	d|	|jjd}|jjdd}||||f|_dS)z1Replace the current word with the next expansion.insertzinsert linestartzinsert lineendrbreakzinsert - %d chars)
rindexgetrgetwordsZbellgetprevwordZdeletelenr)
rZeventZ	curinsertZcurlinewordsrrlinewordZnewwordr	r	r
expand_word_event$s.			

zAutoExpand.expand_word_eventc	Cs-|j}|sgS|jjdd}tjd|d|}~|jjdd}tjd|d|}~|r|rgSg}i}|jx:|D]2}|j|rqn|j||||<qWx:|D]2}|j|rqn|j||||<qW|j||S)z?Return a list of words that match the prefix before the cursor.z1.0zinsert wordstartz\bz\w+\bzinsert wordendend)rrrrefindallreverseappend)	rrZbeforeZwbeforeafterZwafterrdictwr	r	r
r?s4





zAutoExpand.getwordscCsc|jjdd}t|}x1|dkrT||d|jkrT|d}q$W||dS)z)Return the word prefix before the cursor.zinsert linestartrrrN)rrr	wordchars)rrir	r	r
r^s
&zAutoExpand.getprevwordN)rr)__name__
__module____qualname__ZmenudefsstringZ
ascii_lettersZdigitsr rrrrr	r	r	r
rsr__main__z!idlelib.idle_test.test_autoexpand	verbosity)__doc__r%rrr"Zunittestmainr	r	r	r
<module>sP