Hacked By AnonymousFox

Current Path : /opt/alt/python37/lib64/python3.7/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/idlelib/__pycache__/autoexpand.cpython-37.opt-2.pyc

B

YI~d��@sBddlZddlZGdd�d�Zedkr>ddlmZeddd�dS)	�Nc@s<eZdZejejdZdd�Zdd�Zdd�Z	dd	�Z
d
S)�
AutoExpand�_cCs|j|_|jj|_d|_dS)N)�text�bell�state)�selfZeditwin�r�7/opt/alt/python37/lib64/python3.7/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)N�insertzinsert linestartzinsert lineendr�breakzinsert - %d chars�)
r�index�getr�getwordsr�getprevword�delete�lenr)
rZeventZ	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}|��x*|D]"}|�|�r�qz|�|�|||<qzWx*|D]"}|�|�r�q�|�|�|||<q�W|�|�|S)Nz1.0zinsert wordstartz\bz\w+\bzinsert wordend�end)rrr�re�findall�reverse�append)	rrZbeforeZwbeforeZafterZwafterr�dict�wrrr	r6s4






zAutoExpand.getwordscCsJ|j�dd�}t|�}x&|dkr<||d|jkr<|d}qW||d�S)Nzinsert linestartrrr
)rrr�	wordchars)rr�irrr	rUs
zAutoExpand.getprevwordN)�__name__�
__module__�__qualname__�stringZ
ascii_letters�digitsrr
rrrrrrr	rs
r�__main__)�mainz!idlelib.idle_test.test_autoexpand�)�	verbosity)rr$rr!Zunittestr'rrrr	�<module>s
K

Hacked By AnonymousFox1.0, Coded By AnonymousFox