Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/idlelib/FormatParagraph.pyo

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


��Qc@s`ddlZddlmZdd
d��YZd�Zd�Zd�Zd�Zd	�ZdS(i�N(tidleConftFormatParagraphcBs5eZddgfgZd�Zd�Zd�ZRS(tformatsFormat Paragraphs<<format-paragraph>>cCs
||_dS(N(teditwin(tselfR((s-/sys/lib/python2.7/idlelib/FormatParagraph.pyt__init__scCs
d|_dS(N(tNoneR(R((s-/sys/lib/python2.7/idlelib/FormatParagraph.pytclosesc
Cs�ttjddddd��}|jj}|jj�\}}|ri|ri|j||�}d}n$t||jd��\}}}}|rQ|j	d�}t
t|�d	�|�}dj|�}t
|t|�d
�}	t||	�}
|
j	d�}
d}|
ds&d}|
d }
n|d�}djt
||
��|}
nt||�}
|jd
dd�|
|kr�|jd|�|j�|j||�|j||
�|j�n|jd|�|jd�dS(NtmainRt	paragraphttypetintttinserts
cSs||S(N((tsttl((s-/sys/lib/python2.7/idlelib/FormatParagraph.pyt<lambda>0sii�cSs||S(N((titemtprefix((s-/sys/lib/python2.7/idlelib/FormatParagraph.pyR@stsels1.0tendtbreak(RRt	GetOptionRttexttget_selection_indicestgettfind_paragraphtindextsplittmaptlentjointmaxtreformat_paragrapht
tag_removetmark_settundo_block_starttdeleteR
tundo_block_stoptsee(
RteventtmaxformatwidthRtfirsttlasttdatatcomment_headertlinestformat_widthtnewdatatblock_suffixtbuilder((s-/sys/lib/python2.7/idlelib/FormatParagraph.pytformat_paragraph_event"s@	$




(sFormat Paragraphs<<format-paragraph>>(t__name__t
__module__tmenudefsRRR3(((s-/sys/lib/python2.7/idlelib/FormatParagraph.pyRs
		c

Cs�tt|jd��\}}|jd|d|�}xM|jd|dd�r�t|�r�|d}|jd|d|�}q;W|}t|�}t|�}xKt|�|kr�||�r�d}|jd|d|�}q�Wd|}|d}|jd|d|�}xW|dkr{t|�|kr{t||�r{|d}|jd|d|�}q%Wd|d}	|	|||j|	|�fS(Nt.s%d.0s%d.0 lineendt<Rii(RRRRtcomparetis_all_whitetget_comment_headerR(
Rtmarktlinenotcoltlinetfirst_linenoR-tcomment_header_lenR+R*((s-/sys/lib/python2.7/idlelib/FormatParagraph.pyRQs,(




c	Cs�|jd�}d}t|�}x*||krMt||�rM|d}q$W||kr^|St||�}|d|kr�t||d�r�t||d�}n|}|| }|}x||kr�t||�r�tjd||�}	x�tdt|	�d�D]�}
|	|
}|s+qnt||j��|kro||kro|j|j��|}n||d}|
dt|	�kr|	|
ddkr|d}qqW|d}q�W|j|j��|j	||�dj
|�S(Ns
iis(\s+)it (RRR:t
get_indenttretranget
expandtabstappendtrstriptextendR(R,tlimitR.titntindent1tindent2tnewtpartialtwordstjtword((s-/sys/lib/python2.7/idlelib/FormatParagraph.pyR!js<%
 
	*cCstjd|�dk	S(Ns^\s*$(RDtmatchR(R?((s-/sys/lib/python2.7/idlelib/FormatParagraph.pyR:�scCstjd|�j�S(Ns^(\s*)(RDRTtgroup(R?((s-/sys/lib/python2.7/idlelib/FormatParagraph.pyRC�scCs/tjd|�}|dkr"dS|jd�S(Ns^(\s*#*)Ri(RDRTRRU(R?tm((s-/sys/lib/python2.7/idlelib/FormatParagraph.pyR;�s((	RDtidlelib.configHandlerRRRR!R:RCR;(((s-/sys/lib/python2.7/idlelib/FormatParagraph.pyt<module>s=		#		

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.