python (3.12.0)

(root)/
lib/
python3.12/
idlelib/
__pycache__/
squeezer.cpython-312.opt-2.pyc

̑e"2	ddlZddlZddlmZddlmZddlmZddlm	Z	ddl
mZddZGdd	ejZGd
dZej!edk(rdd
lmZedddyy)N)
messagebox)idleConf)	view_text)Hovertip)macosxcP	d}d}d}d}tjd|D][}|j|z
}||z
}||z
}||dk(r||kDr||dz
|zz
}|dz
}d}n||||zz
z
}||kDr|dz
}|}|dz
}]|t||z
z
}|dkDr
||dz
|zz
}|S|dz}|S)Nrz[\t\n]
)refinditerstartlen)s	linewidthtabwidthpos	linecountcurrent_columnmnumcharss        D/BuggyBox/python/3.12.0/bootstrap/lib/python3.12/idlelib/squeezer.pycount_lines_with_wrappingrsH
CIN
[[A
&779s?x("
S6T>	)nq0Y>>	NIN
h.8*CDDN	)Q	!)q;@c!fsl"Nnq(Y66	
	Q	c<eZdZ	dZdZd	dZd	dZd	dZdZdZ	y)
ExpandingButtonc|_||_||_||_|jx|_}|j
x|_}|jj|_|dk7rdnd}d|d|d}tjj|||dd	d
}	t||	d|jd
|jtj r|jd|j"n|jd|j"|j%fdd|_|j)|j*y)Nr
lineslinezSqueezed text ( z).z#FFFFC0z#FFFFE0)text
backgroundactivebackgroundz5Double-click to expand, right-click for more options.P)hover_delayz<Double-Button-1>z
<Button-2>z
<Button-3>cJt|t|t|zSN)int)offsetlengthrs  r<lambda>z*ExpandingButton.__init__.<locals>.<lambda>zs1S[Vs6{1J#Kr)rtags
numoflinessqueezereditwinr!perbottom	base_texttkButton__init__rbindexpandrisAquaTkcontext_menu_eventselection_handleis_dangerous
after_idleset_is_dangerous)
selfrr,r-r.r/r!line_pluralitybutton_textbutton_tooltip_texts
 `        rr5zExpandingButton.__init___s$	$ 
!)!1!11w"<<'	D ++$.!O'
|1^4DBG
		4K&/)		M
D		*;		%t{{3??IIlD$;$;<IIlD$;$;<K	M!--.rcd|jjz|jdkDxsLt|jdkDxs2tfdt
jd|jD|_y)N2iiPc3XK|]!}t|jdk\#yw)rN)rgroup).0
line_matchdangerous_line_lens  r	<genexpr>z3ExpandingButton.set_is_dangerous.<locals>.<genexpr>s/J$$Q'(,>>s'*z[^\n]+)	r!winfo_widthr-rranyrr
r;)r>rHs @rr=z ExpandingButton.set_is_dangeroussm$))"7"7"99OOd"
K%
"$++i"@
	
rNc	|j|j|jrgtjddj	gd|j
t
|jfztj|j}|sy|jj|}|jj||j|j|jj||jj!||j|j|j"j$j'|y)NzExpand huge output?z

)z5The squeezed output is very long: %d lines, %d chars.z2Expanding it could make IDLE slow or unresponsive.z5It is recommended to view or copy the output instead.zReally expand?)titlemessagedefaultparentbreak)r;r=raskokcanceljoinr-rrCANCELr!indexr2insertr,deleter/on_squeezed_expandr.expandingbuttonsremove)r>eventconfirmrUs    rr7zExpandingButton.expands	$!!# ,,+%
oos466{34#))yy	"G		%eTVVTYY7d#''tvvtyyA

&&--d3rc\	|j|j|jyr')clipboard_clearclipboard_appendrr>r[s  rcopyzExpandingButton.copys'		
dff%rcN	t|jd|jddy)NzSqueezed Output ViewerFnone)modalwrap)rr!rr`s  rviewzExpandingButton.views%		$))5tvvF	,r))rara)rfrfc^|jjdd|j|jfzt	j
|jd}|jD]"\}}|j|t||$|j|j|jy)NrVz@%d,%dr)tearoff)labelcommandrQ)r!mark_setxyr3Menurmenu_specsadd_commandgetattrtk_popupx_rooty_root)r>r[rmenurimethod_names     rr9z"ExpandingButton.context_menu_events		8X%''0B%BC		1-"&"2"2	OE;E743MN	O
u||U\\2rr')
__name__
__module____qualname__r5r=r7rarfror9rrrrTs-	/@	
4>&,Krrc0eZdZ	edZdZdZdZy)SqueezercD	tjddddd|_y)NmainPyShellzauto-squeeze-min-linesr(rC)typerO)r	GetOptionauto_squeeze_min_lines)clss rreloadzSqueezer.reloads%/%-%7%7I7&
"rc0	|_|jx_|jj_dtj
dtj
dzz_g_d|jffd	}||_	y)Nborderpadxrzc|dk7r	|||Sj}t||kr	|||Sj|}||kr	|||St|||}j	dt
jjd|ddjdjj	dt
jjj|y)Nstdoutiomarkwindowrpady)
rrcount_linesrmark_gravityr3RIGHT
window_createseeupdateLEFTrYappend)rr,writerr-expandingbuttonr>r!s      rmywritez"Squeezer.__init__.<locals>.mywritesxQ~%&*%@%@"1v..Q~%))!,J22Q~%.az4HO
h1x$%A

/HHXKKMh0
!!((9r)
r/r!r0r1r2r(cgetwindow_width_deltarYr)r>r/rr!s`  @rr5zSqueezer.__init__s	"<<'	D!++#$		(#$		&!"
##

!#gmm	:< 
rcD	t||jjSr')rr/width)r>rs  rrzSqueezer.count_liness 		)DLL,>,>??rc	|jjtj}dD]}||vsn|jj	y|jj|tjdz\}}|jj
||}t|dkDr+|ddk(r#|jjd|z}|dd}|jj|||j|}t||||}|jj||dd	
t|j}|dkDre|jj|j|dz
d|r8|dz}|dkDr.|jj|j|dz
d|r8|jj!||y)
N)rstderrrQz+1crrz%s-1crrrr
>)r!	tag_namesr3INSERTbell
tag_prevrangegetrrUr2rWrrrrYcomparerV)	r>rtag_namerendrr-ris	         rsqueeze_current_textzSqueezer.squeeze_current_text"s	II''		2	,	H9$	

IINNYY,,Xryy57HI
sIIMM%%q6A:!B%4-))//'C-0C#2A	
eS)%%a(
)!Xz4H	
		o%&Q	 	0
%%&!e		))$*?*?!*D*-@
FA!e		))$*?*?!*D*-@	
$$Q8rN)rwrxryclassmethodrr5rrrzrrr|r|s,


= ~@-rr|__main__)r~zidlelib.idle_test.test_squeezerrF)	verbosityexit)r$)rtkinterr3ridlelib.configridlelib.textviewridlelib.tooltipridlelibrrr4rr|rrwunittestr~rzrr<module>rsr 
#&$5pqbiiqhGGT	z	*aeDr