+
     Bi"2                         ^ RI t ^ RIt^ RIHt ^ RIHt ^ RIHt ^ RIH	t	 ^ RI
Ht RR lt ! R R	]P                  4      t ! R
 R4      t]P!                  4        ]R8X  d   ^ RIHt ]! R^RR7       R# R# )    N)
messagebox)idleConf)	view_text)Hovertip)macosxc                    ^p^ p^p^ p\         P                  ! RV 4       F  pVP                  4       V,
          pW7,          pWW,          pW,          R8X  d)   WQ8  d   WE^,
          V,          ,          pV^,          p^ pM&WRWR,          ,
          ,          pWQ8  d   V^,          pTpV^,          pK  	  V\        V 4      V,
          ,          pV^ 8  d   WE^,
          V,          ,          pV# V^,          pV# )   z[\t\n]
)refinditerstartlen)s	linewidthtabwidthpos	linecountcurrent_columnmnumcharss   &&      '/usr/lib/python3.14/idlelib/squeezer.pycount_lines_with_wrappingr      s     H
CIN[[A&779s?" 6T> ) q0Y>>	NIN .*CDDN )Q	!)q; '@ c!fsl"Nq(Y66	
  	Q	    c                   T   a  ] tR t^Tt o R tR tR	R ltR	R ltR	R ltR
t	R t
RtV tR# )ExpandingButtonc                  a SV n         W n        W0n        W@n        VP                  ;V n        pVP
                  ;V n        pVP                  P                  V n        V^8w  d   RMRpRV RV R2p\        P                  P                  WVRRR7       R	p	\        W	^PR
7       V P                  RV P                  4       \        P                   ! 4       '       d   V P                  RV P"                  4       MV P                  RV P"                  4       V P%                  V3R l4       RV n        V P)                  V P*                  4       R# )   lineslinezSqueezed text ( z).z#FFFFC0z#FFFFE0)text
backgroundactivebackgroundz5Double-click to expand, right-click for more options.)hover_delayz<Double-Button-1>z
<Button-2>z
<Button-3>c                 R   < S\        V 4      \        V 4      \        V4      ,            # N)int)offsetlengthr   s   &&r   <lambda>*ExpandingButton.__init__.<locals>.<lambda>z   s    1S[Vs6{1J#Kr   N)r   tags
numoflinessqueezereditwinr!   perbottom	base_texttkButton__init__r   bindexpandr   isAquaTkcontext_menu_eventselection_handleis_dangerous
after_idleset_is_dangerous)
selfr   r,   r-   r.   r/   r!   line_pluralitybutton_textbutton_tooltip_texts
   &f&&&     r   r5   ExpandingButton.__init___   s   	$ !)!1!11w"<<'	D ++$.!O'
|1^4DBG
		4K&/) 	 	M D 	 	;		%t{{3??IIlD$;$;<IIlD$;$;<K	M !--.r   c                  a ^2V P                   P                  4       ,          oV P                  R8  ;'       g    \        V P                  4      R8  ;'       g    \
        ;QJ dL    V3R l\        P                  ! RV P                  4       4       F  '       g   K   RV n        R# 	  RV n        R# ! V3R l\        P                  ! RV P                  4       4       4      V n        R# )2   i  iP  c              3   ^   <"   T F"  p\        VP                  ^ 4      4      S8  x  K$  	  R# 5i)r   N)r   group).0
line_matchdangerous_line_lens   & r   	<genexpr>3ExpandingButton.set_is_dangerous.<locals>.<genexpr>   s.      "@J J$$Q'(,>>"@s   *-z[^\n]+TFN)	r!   winfo_widthr-   r   r   anyr   r   r;   )r>   rI   s   &@r   r=    ExpandingButton.set_is_dangerous   s    $))"7"7"99OOd"  K% C "$++i"@CC 	  	  "$++i"@  	r   Nc                   V P                   f   V P                  4        V P                   '       dt   \        P                  ! RRP	                  . RO4      V P
                  \        V P                  4      3,          \        P                  V P                  R7      pV'       g   R# V P                  P                  V 4      pV P                  P                  W0P                  V P                  4       V P                  P                  V 4       V P                  P!                  W0P                  V P                  4       V P"                  P$                  P'                  V 4       R # )NzExpand huge output?z

)titlemessagedefaultparentbreak)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.zReally expand?)r;   r=   r   askokcanceljoinr-   r   r   CANCELr!   indexr2   insertr,   deleter/   on_squeezed_expandr.   expandingbuttonsremove)r>   eventconfirmrX   s   &&  r   r7   ExpandingButton.expand   s     $!!# ,,+ % 
 oos466{34 #))yy	"G 		%eVVTYY7d#''vvtyyA&&--d3r   c                \    V P                  4        V P                  V P                  4       R # r&   )clipboard_clearclipboard_appendr   r>   r^   s   &&r   copyExpandingButton.copy   s"    
 	dff%r   c                N    \        V P                  R V P                  RRR7       R# )zSqueezed Output ViewerFnone)modalwrapN)r   r!   r   rd   s   &&r   viewExpandingButton.view   s     
 	$))5tvvF	,r   c                j   V P                   P                  R RVP                  VP                  3,          4       \        P
                  ! V P                   ^ R7      pV P                   F!  w  r4VP                  V\        W4      R7       K#  	  VP                  VP                  VP                  4       R# )rY   z@%d,%d)tearoff)labelcommandrT   )r!   mark_setxyr3   Menurmenu_specsadd_commandgetattrtk_popupx_rooty_root)r>   r^   rmenuro   method_names   &&   r   r9   "ExpandingButton.context_menu_event   s    		8X%''0B%BC		1-"&"2"2EE743MN #3u||U\\2r   )r2   r/   r;   r-   r   r.   r,   r!   r&   ))re   re   )rk   rk   )__name__
__module____qualname____firstlineno__r5   r=   r7   re   rk   ru   r9   __static_attributes____classdictcell____classdict__s   @r   r   r   T   s0     /@	
4>&,K r   r   c                   B   a  ] tR t^t o ]R 4       tR tR tR tRt	V t
R# )Squeezerc                F    \         P                  ! R RRR^2R7      V n        R# )mainPyShellzauto-squeeze-min-linesr'   )typerR   N)r   	GetOptionauto_squeeze_min_lines)clss   &r   reloadSqueezer.reload   s$     &.%7%7I7&
"r   c                B  a a VS n         VP                  ;S n        oVP                  P                  S n        ^\        SP                  R4      4      \        SP                  R4      4      ,           ,          S n        . S n        RVP                  3V V3R llpW!n	        R# )   borderpadxc                   < VR 8w  d	   V! W4      # SP                   p\        V 4      V8  d	   V! W4      # SP                  V 4      pWC8  d	   V! W4      # \        WVS4      pSP	                  R\
        P                  4       SP                  RV^^R7       SP                  R4       SP                  4        SP	                  R\
        P                  4       SP                  P                  V4       R# )stdoutiomarkwindowr   padyN)r   r   count_linesr   mark_gravityr3   RIGHTwindow_createseeupdateLEFTr\   append)r   r,   writer   r-   expandingbuttonr>   r!   s   &&&   r   mywrite"Squeezer.__init__.<locals>.mywrite   s    xQ~% &*%@%@"1v..Q~%))!,J2Q~% .az4HO h1x$%A  /HHXKKMh0 !!((9r   N )
r/   r!   r0   r1   r2   r'   cgetwindow_width_deltar\   r   )r>   r/   r   r!   s   f& @r   r5   Squeezer.__init__   s     "<<'	D !++ #$		(#$		&!"##

 !# gmm 	: 	:<  r   c                @    \        WP                  P                  4      # r&   )r   r/   width)r>   r   s   &&r   r   Squeezer.count_lines  s     )LL,>,>??r   c                ~   V P                   P                  \        P                  4      pR F  pW!9   g   K   M	  V P                   P	                  4        R# V P                   P                  V\        P                  R,           4      w  r4V P                   P                  W44      p\        V4      ^ 8  d6   VR	,          R8X  d(   V P                   P                  RV,          4      pVRR	 pV P                  P                  W44       V P                  V4      p\        WRW`4      pV P                   P                  W7^^R7       \        V P                  4      pV^ 8  dG   V P                   P                  V P                  V^,
          ,          RV4      '       d   V^,          pKM  V P                  P!                  W4       R# )
r   rT   z+1cr
   z%s-1cNr   >)r   stderr)r!   	tag_namesr3   INSERTbelltag_prevrangegetr   rX   r2   rZ   r   r   r   r\   comparerY   )	r>   r   tag_namer   endr   r-   r   is	   &        r   squeeze_current_textSqueezer.squeeze_current_text"  sh    II''		2	,H$ -
 IINN YY,,Xryy57HI
IIMM%% q6A:!B%4-))//'C-0C#2A 	e) %%a(
)!zH 			%&Q 	  	0 %%&!e		))$*?*?!*D*-@ @FA$$Q8r   )r2   r/   r\   r!   r   N)r~   r   r   r   classmethodr   r5   r   r   r   r   r   s   @r   r   r      s/      
 
= ~@- -r   r   __main__)r   zidlelib.idle_test.test_squeezerF)	verbosityexit)P   )r   tkinterr3   r   idlelib.configr   idlelib.textviewr   idlelib.tooltipr   idlelibr   r   r4   r   r   r   r~   unittestr   r   r   r   <module>r      sm   " 
   # & $ 5pqbii qhG GT 	  z	*aeD r   