
    .hhI                         S SK r S SKJr  S SKJr  / SQrSqS rS r " S S\5      r	 " S	 S
5      r
\S:X  a  S SKJr  \" SSSS9  gg)    N)
messagebox)EditorWindow)zfile "([^"]*)", line (\d+)z([^\s]+)\((\d+)\)z^(\s*\S.*?):\s*(\d+):z([^\s]+):\s*(\d+):z^\s*(\S.*?):\s*(\d+):c                      [          V s/ s H(  n [        R                  " U [        R                  5      PM*     sn qg s  sn f N)file_line_patsrecompile
IGNORECASEfile_line_progs)pats    7/opt/python-3.13.8/usr/lib/python3.13/idlelib/outwin.pycompile_progsr      s5     #12"03 zz#r}}5"02O 2s   /<c                 :   [         (       d
  [        5         [          HM  nUR                  U 5      nU(       d  M  UR                  SS5      u  p4 [	        U5      nUR                  5           O   g  U[        U5      4$ ! [         a     Mm  f = f! [         a     g f = f)N      )	r   r   searchgroupopencloseOSErrorint	TypeError)lineprogmatchfilenamelinenofs         r   file_line_helperr      s     ?D!5${{1a0HN	   V$$    s$   A</B <
B
	B

BBc                   ^    \ rS rSr/ SQrSrS rS rS rS r	SS	 jr
S
 rS rS rSS jrSrg)OutputWindow:   ))Cutz<<cut>>rmenu_check_cut)Copyz<<copy>>rmenu_check_copy)Pastez	<<paste>>rmenu_check_paste)NNN)zGo to file/line<<goto-file-line>>NFc                 ~    [         R                  " U /UQ76   U R                  R                  SU R                  5        g )Nr)   )r   __init__textbindgoto_file_line)selfargss     r   r+   OutputWindow.__init__N   s.    d*T*		+T-@-@A    c                     g)NF )r/   r   s     r   ispythonsourceOutputWindow.ispythonsourceS   s    r2   c                     g)NOutputr4   r/   s    r   short_titleOutputWindow.short_titleW   s    r2   c                 4    U R                  5       (       a  S$ S$ )Nyesno)	get_savedr9   s    r   	maybesaveOutputWindow.maybesave[   s    ((u2d2r2   r4   c                     U R                   R                  X1U5        U R                   R                  U5        U R                   R                  5         [	        U5      $ r   )r,   insertseeupdatelenr/   stagsmarks       r   writeOutputWindow.write`   sA    " 			$'		d		1vr2   c                 8    U H  nU R                  U5        M     g r   )rK   )r/   linesr   s      r   
writelinesOutputWindow.writelinesv   s    DJJt r2   c                     g r   r4   r9   s    r   flushOutputWindow.flush{   s    r2   c                 0    [         R                  " U0 UD6  g r   )r   	showerror)r/   r0   kwargss      r   rU   OutputWindow.showerror   s    d-f-r2   Nc                 2   U R                   R                  SS5      n[        U5      nU(       dJ  U R                   R                  SS5      n[        U5      nU(       d  U R                  SSU R                   S9  g Uu  pEU R                  R                  XE5        g )Nzinsert linestartzinsert lineendzinsert -1line linestartzinsert -1line lineendzNo special linezTThe line you point at doesn't look like a valid file name followed by a line number.)parent)r,   getr   rU   flistgotofileline)r/   eventr   resultr   r   s         r   r.   OutputWindow.goto_file_line   s     yy}}/1AB!$' 99==!:!8:D%d+F%C99	  &
 !

1r2   )r4   rC   r   )__name__
__module____qualname____firstlineno__rmenu_specsallow_code_contextr+   r5   r:   r@   rK   rO   rR   rU   r.   __static_attributes__r4   r2   r   r!   r!   :   s?    K B
3
,
.2r2   r!   c                   8    \ rS rSrSS0SS0S.rS rS rS rS	rg
)OnDemandOutputWindow   
foregroundbluez#007700)stdoutstderrc                     Xl         S U l        g r   )r[   owin)r/   r[   s     r   r+   OnDemandOutputWindow.__init__   s    
	r2   c                 ~    U R                   (       d  U R                  5         U R                   R                  XU5        g r   )ro   setuprK   rG   s       r   rK   OnDemandOutputWindow.write   s$    yyJJL		&r2   c                 *   [        U R                  5      =U l        nUR                  nU R                  R                  5        H!  u  p4U(       d  M  UR                  " U40 UD6  M#     UR                  S5        U R                  R                  U l        g )Nsel)	r!   r[   ro   r,   tagdefsitemstag_configure	tag_raiserK   )r/   ro   r,   tagcnfs        r   rr   OnDemandOutputWindow.setup   sn    '

33	Dyy**,HCs""3.#. - 	uYY__
r2   )r[   ro   rK   N)	r`   ra   rb   rc   rv   r+   rK   rr   rf   r4   r2   r   rh   rh      s*     !&) ),G'
%r2   rh   __main__)mainzidlelib.idle_test.test_outwinr   F)	verbosityexit)r   tkinterr   idlelib.editorr   r   r   r   r   r!   rh   r`   unittestr~   r4   r2   r   <module>r      s`    
  ' 28a2< a2J% %6 z	(AEB r2   