Your IP : 13.59.5.179


Current Path : /opt/alt/python35/lib64/python3.5/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/idlelib/__pycache__/AutoExpand.cpython-35.opt-2.pyc



���]C
�@sZddlZddlZGdd�d�ZedkrVddlZejddd�dS)�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	�//opt/alt/python35/lib64/python3.5/AutoExpand.py�__init__ szAutoExpand.__init__c
CsN|jjd�}|jjdd�}|jsE|j�}d}n?|j\}}}}||ksr||kr�|j�}d}|s�|jj�dS|j�}|jjdt|�d�||}	|dt|�}|dkr�|jj�|jj	d|	�|jjd�}|jjdd�}||||f|_dS)N�insertzinsert linestartzinsert lineendr�breakzinsert - %d chars�)
r�index�getr�getwordsZbell�getprevword�delete�lenr)
r�eventZ	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�x7|D]/}|j|�r�q�|j|�|||<q�Wx7|D]/}|j|�r�q�|j|�|||<q�W|j|�|S)Nz1.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)Nzinsert linestartrrr)rrr�	wordchars)rr�ir	r	r
r^s
&zAutoExpand.getprevwordN)rr)�__name__�
__module__�__qualname__Zmenudefs�string�
ascii_letters�digitsr"rrrrr	r	r	r
rsr�__main__z!idlelib.idle_test.test_autoexpand�	verbosity�)r'rrr$Zunittest�mainr	r	r	r
�<module>s
P

?>