Uname: Linux business55.web-hosting.com 4.18.0-553.lve.el8.x86_64 #1 SMP Mon May 27 15:27:34 UTC 2024 x86_64
Software: LiteSpeed
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.213.251.212
Your Ip: 3.137.211.240
User: allssztx (535) | Group: allssztx (533)
Safe Mode: OFF
Disable Function:
NONE

name : AutoExpand.cpython-34.pyo
�
e fC
�@scdZddlZddlZGdd�d�Zedkr_ddlZejddd�ndS)	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@sfeZdZddgfgZejejdZdd�Zdd�Z	d	d
�Z
dd�Zd
S)�
AutoExpandZedit�E_xpand Word�<<expand-word>>�_cCs|j|_d|_dS)N)�text�state)�selfZeditwin�r	�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�|jj�dS|j�}|jjdt|�d�||}	|dt|�}|dkr|jj�n|jj	d|	�|jjd�}|jjdd�}||||f|_dS)z1Replace the current word with the next expansion.�insertzinsert linestartzinsert lineendr�breakzinsert - %d chars�)
r�index�getr�getwordsZbell�getprevwordZdelete�lenr)
rZeventZ	curinsertZcurline�wordsrr�line�wordZnewwordr	r	r
�expand_word_event$s.			

zAutoExpand.expand_word_eventc	Cs-|j�}|sgS|jjdd�}tjd|d|�}~|jjdd�}tjd|d|�}~|r�|r�gSg}i}|j�x:|D]2}|j|�r�q�n|j|�|||<q�Wx:|D]2}|j|�rq�n|j|�|||<q�W|j|�|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)	rrZbeforeZwbefore�afterZwafterr�dict�wr	r	r
r?s4





zAutoExpand.getwordscCsc|jjdd�}t|�}x1|dkrT||d|jkrT|d}q$W||d�S)z)Return the word prefix before the cursor.zinsert linestartrrrN)rrr�	wordchars)rr�ir	r	r
r^s
&zAutoExpand.getprevwordN)rr)�__name__�
__module__�__qualname__Zmenudefs�stringZ
ascii_lettersZdigitsr rrrrr	r	r	r
rsr�__main__z!idlelib.idle_test.test_autoexpand�	verbosity�)�__doc__r%rrr"Zunittest�mainr	r	r	r
�<module>sP
© 2025 GrazzMean-Shell