%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python3.8/idlelib/__pycache__/
Upload File :
Create Path :
Current File : //usr/local/lib/python3.8/idlelib/__pycache__/autoexpand.cpython-38.pyc

U

q©ßaã@sFdZddlZddlZGdd„dƒZedkrBddlmZeddd	dS)
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.

There is only one instance of Autoexpand.
éNc@s<eZdZejejdZdd„Zdd„Zdd„Z	dd	„Z
d
S)Ú
AutoExpandÚ_cCs|j|_|jj|_d|_dS)N)ÚtextÚbellÚstate)ÚselfZeditwin©rú./usr/local/lib/python3.8/idlelib/autoexpand.pyÚ__init__s
zAutoExpand.__init__c
Csè|j d¡}|j dd¡}|js.| ¡}d}n*|j\}}}}||ksL||krX| ¡}d}|sh| ¡dS| ¡}|j dt|ƒd¡||}	|dt|ƒ}|dkr®| ¡|j 	d|	¡|j d¡}|j dd¡}||||f|_dS)z1Replace the current word with the next expansion.Úinsertúinsert linestartzinsert lineendrÚbreakzinsert - %d charsé)
rÚindexÚgetrÚgetwordsrÚgetprevwordÚdeleteÚlenr)
rÚeventZ	curinsertZcurlineÚwordsrrÚlineÚwordZnewwordrrr	Úexpand_word_events.zAutoExpand.expand_word_eventc	CsÒ| ¡}|sgS|j dd¡}t d|d|¡}~|j dd¡}t d|d|¡}~|sd|sdgSg}i}| ¡|D]"}| |¡rˆqx| |¡|||<qx|D]"}| |¡r°q | |¡|||<q | |¡|S)z?Return a list of words that match the prefix before the cursor.z1.0zinsert wordstartz\bz\w+\bzinsert wordendÚend)rrrÚreÚfindallÚreverseÚappend)	rrÚbeforeZwbeforeZafterZwafterrÚdictÚwrrr	r6s4






zAutoExpand.getwordscCsF|j dd¡}t|ƒ}|dkr:||d|jkr:|d}q||d…S)z)Return the word prefix before the cursor.rrrrN)rrrÚ	wordchars)rrÚirrr	rUs

zAutoExpand.getprevwordN)Ú__name__Ú
__module__Ú__qualname__ÚstringÚ
ascii_lettersÚdigitsr"r
rrrrrrr	rs
rÚ__main__)Úmainz!idlelib.idle_test.test_autoexpandé)Ú	verbosity)Ú__doc__rr'rr$Zunittestr+rrrr	Ú<module>sK

Zerion Mini Shell 1.0