ó {fc@scdZddlZddlZdd d„ƒYZedkr_ddlZejdddƒndS( s[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. iÿÿÿÿNt AutoExpandcBsReZddgfgZejejdZd„Zd„Zd„Z d„Z RS( tedits E_xpand Words<>t_cCs|j|_d|_dS(N(ttexttNonetstate(tselfteditwin((s*/usr/lib64/python2.7/idlelib/AutoExpand.pyt__init__ s c CsT|jjdƒ}|jjddƒ}|jsE|jƒ}d}nB|j\}}}}||ksr||kr‡|jƒ}d}n|sž|jjƒdS|jƒ}|jjdt|ƒdƒ||} |dt|ƒ}|dkr|jjƒn|jj d| ƒ|jjdƒ}|jjddƒ}||||f|_dS(s1Replace the current word with the next expansion.tinsertsinsert linestartsinsert lineenditbreaksinsert - %d charsi( RtindextgetRtgetwordstbellt getprevwordtdeletetlenR ( Rteventt curinserttcurlinetwordsR R tlinetwordtnewword((s*/usr/lib64/python2.7/idlelib/AutoExpand.pytexpand_word_event$s.         c Cs-|jƒ}|sgS|jjddƒ}tjd|d|ƒ}~|jjddƒ}tjd|d|ƒ}~| rŒ| rŒgSg}i}|jƒx:|D]2}|j|ƒrÄq©n|j|ƒ|||>( t__name__t __module__tmenudefststringt ascii_letterstdigitsR%RRR R(((s*/usr/lib64/python2.7/idlelib/AutoExpand.pyRs   t__main__s!idlelib.idle_test.test_autoexpandt verbosityi((t__doc__R*RRR'tunittesttmain(((s*/usr/lib64/python2.7/idlelib/AutoExpand.pyts   P