Your IP : 3.148.115.187


Current Path : /opt/alt/python36/lib64/python3.6/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/idlelib/__pycache__/paragraph.cpython-36.opt-2.pyc

3

��2a��@s�ddlZddlmZGdd�d�Zej�dd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
edkr|ddlm
Z
e
dddd�dS)�N)�idleConfc@s2eZdZdd�Zedd��Zdd�Zd
dd	�ZdS)�FormatParagraphcCs
||_dS)N)�editwin)�selfr�r�./opt/alt/python36/lib64/python3.6/paragraph.py�__init__szFormatParagraph.__init__cCstjdddddd�|_dS)N�
extensionsrz	max-width�int�H)�type�default)rZ	GetOption�	max_width)�clsrrr�reloadszFormatParagraph.reloadcCs
d|_dS)N)r)rrrr�close szFormatParagraph.closeNc	Cs�|dkr|jn|}|jj}|jj�\}}|rF|rF|j||�}t|�}nt||jd��\}}}}|rpt|||�}n
t	||�}|j
ddd�||kr�|jd|�|j�|j
||�|j||�|j�n|jd|�|jd�dS)N�insertZselz1.0�end�break)rr�textZget_selection_indices�get�get_comment_header�find_paragraph�index�reformat_comment�reformat_paragraphZ
tag_removeZmark_setZundo_block_start�deleterZundo_block_stopZsee)	rZevent�limitr�first�last�data�comment_header�newdatarrr�format_paragraph_event#s(



z&FormatParagraph.format_paragraph_event)N)�__name__�
__module__�__qualname__r�classmethodrrr#rrrrrsrc
CsJtt|jd��\}}|jd|d|�}x:|jd|dd�rbt|�rb|d}|jd|d|�}q*W|}t|�}t|�}x>t|�|kr�t||d��r�|d}|jd|d|�}qzWd|}|d}|jd|d|�}xL|dk�r(t|�|k�r(t||d���r(|d}|jd|d|�}q�Wd|d}	|	|||j|	|�fS)N�.z%d.0z%d.end�<r�r)�mapr
�splitrZcompare�is_all_whiter�len)
rZmark�lineno�col�lineZfirst_linenor!Zcomment_header_lenrrrrrrLs,rcCs�|jd�}d}t|�}x ||kr6t||�r6|d}qW||krD|St||�}|d|kr�t||d�r�t||d�}n|}|d|�}|}x�||ko�t||��rTtjd||�}	x�tdt|	�d�D]v}
|	|
}|s�q�t||j��|ko�||k�r|j|j��|}||d}|
dt|	�kr�|	|
ddkr�|d}q�W|d}q�W|j|j��|j	||d��dj
|�S)N�
rr*z(\s+)�� )r,r.r-�
get_indent�re�range�
expandtabs�append�rstrip�extend�join)r r�lines�i�nZindent1Zindent2�new�partialZwords�jZwordrrrrqs<

 rcs�t���dj�fdd�|jd�D��}t|t��d�}t||�}|jd�}d}|dshd}|dd	�}dj�fdd�|D��|S)
Nr2c3s|]}|�d�VqdS)Nr)�.0r1)�lcrr�	<genexpr>�sz#reformat_comment.<locals>.<genexpr>��r*c3s|]}�|VqdS)Nr)rCr1)r!rrrE�s���rH)r.r<r,�maxr)r rr!Zformat_widthr"Zblock_suffixr)r!rDrr�s

rcCstjd|�dk	S)Nz^\s*$)r6�match)r1rrrr-�sr-cCstjd|�j�S)Nz	^([ \t]*))r6rJ�group)r1rrrr5�sr5cCs"tjd|�}|dkrdS|jd�S)Nz^([ \t]*#*)rGr*)r6rJrK)r1�mrrrr�sr�__main__)�mainz idlelib.idle_test.test_paragraphr3F)�	verbosity�exit)r6Zidlelib.configrrrrrrr-r5rr$ZunittestrNrrrr�<module>s4%$

?>