Ë oÈêƒêÄaLãó˜—dZddlZddlmZddlmZgd¢Zdad„Zd„Z Gd„d e«Z Gd „d «Z e d k(rdd l mZeddd¬«yy)z0Editor window that can serve as an output file. éN)Ú messagebox)Ú EditorWindow)zfile "([^"]*)", line (\d+)z([^\s]+)\((\d+)\)z^(\s*\S.*?):\s*(\d+):z([^\s]+):\s*(\d+):z^\s*(\S.*?):\s*(\d+):cóz—tD�cgc]&}tj|tj«‘Œ(c}aycc}w)z?Compile the patterns for matching to file name and line number.N)Úfile_line_patsÚreÚcompileÚ IGNORECASEÚfile_line_progs)Úpats ú%/usr/lib/python3.12/idlelib/outwin.pyÚ compile_progsr s5€õ#1ó2Ù"0˜3ô—z‘z #¤r§}¡}Õ5Ø"0ñ2�Oùò2s‰+8có—ts t«tD]H}|j|«}|sŒ|jdd«\}} t |«}|j «ny |t|«fS#t $rYŒewxYw#t$rYywxYw)a-Extract file name and line number from line of text. Check if line of text contains one of the file/line patterns. If it does and if the file and line are valid, return a tuple of the file name and line number. If it doesn't match or if the file or line is invalid, return None. ééN) r r ÚsearchÚgroupÚopenÚcloseÚOSErrorÚintÚ TypeError)ÚlineÚprogÚmatchÚfilenameÚlinenoÚfs r Úfile_line_helperrs–€õ ܌߈ؗ ‘ ˜DÓ!ˆÚ Ø$Ÿ{™{¨1¨aÓ0Ñ ˆH�fð ܘ“N�Ø—‘” Ùð ððØœ˜V›Ð$Ð$øô ò Ùð ûô òÙðús$ÁA1Á$ BÁ1 A=Á<A= B  B cóV—eZdZdZgd¢ZdZd„Zd„Zd„Zd„Z dd„Z d „Z d „Z d „Z dd „Zy )Ú OutputWindowzÛAn editor window that can serve as an output file. Also the future base class for the Python shell window. This class has no input facilities. Adds binding to open a file at a line to the text widget. ))ÚCutz<>Úrmenu_check_cut)ÚCopyz<>Úrmenu_check_copy)ÚPastez <>Úrmenu_check_paste)NNN)zGo to file/lineú<>NFcó|—tj|g|¢­Ž|jjd|j«y)Nr')rÚ__init__ÚtextÚbindÚgoto_file_line)ÚselfÚargss r r)zOutputWindow.__init__Ns.€Ü×јdÐ* TÓ*Ø � ‰ �‰Ð+¨T×-@Ñ-@ÕAócó—y)z6Python source is only part of output: do not colorize.F©)r-rs r ÚispythonsourcezOutputWindow.ispythonsourceSs€àr/có—y)zCustomize EditorWindow title.ÚOutputr1©r-s r Ú short_titlezOutputWindow.short_titleWs€àr/có*—|j«rdSdS)z;Customize EditorWindow to not display save file messagebox.ÚyesÚno)Ú get_savedr5s r Ú maybesavezOutputWindow.maybesave[s€àŸ™Ô(ˆuÐ2¨dÐ2r/cóà—t|t«sJ‚|jj|||«|jj |«|jj «t |«S)aæWrite text to text widget. The text is inserted at the given index with the provided tags. The text widget is then scrolled to make it visible and updated to display it, giving the effect of seeing each line as it is added. Args: s: Text to insert into text widget. tags: Tuple of tag strings to apply on the insert. mark: Index for the insert. Return: Length of text inserted. )Ú isinstanceÚstrr*ÚinsertÚseeÚupdateÚlen©r-ÚsÚtagsÚmarks r ÚwritezOutputWindow.write`sS€ô ˜!œSÔ!Ð!Ð!Ø � ‰ ×ј˜q $Ô'Ø � ‰ � ‰ �dÔØ � ‰ ×ÑÔÜ�1‹vˆ r/có4—|D]}|j|«Œy)z"Write each item in lines iterable.N)rG)r-Úlinesrs r Ú writelineszOutputWindow.writelinesvs€ãˆDØ �J‰J�tÕ ñr/có—y)z8No flushing needed as write() directly writes to widget.Nr1r5s r ÚflushzOutputWindow.flush{s€à r/có.—tj|i|¤Žy©N)rÚ showerror)r-r.Úkwargss r rOzOutputWindow.showerrors€Ü×јdÐ- fÓ-r/Ncó(—|jjdd«}t|«}|sH|jjdd«}t|«}|s|jdd|j¬«y|\}}|jj ||«y) aHandle request to open file/line. If the selected or previous line in the output window contains a file name and line number, then open that file name in a new window and position on the line number. Otherwise, display an error messagebox. zinsert linestartzinsert lineendzinsert -1line linestartzinsert -1line lineendzNo special linezTThe line you point at doesn't look like a valid file name followed by a line number.)ÚparentN)r*ÚgetrrOÚflistÚ gotofileline)r-ÚeventrÚresultrrs r r,zOutputWindow.goto_file_line‚s’€ð�y‰y�}‰}Ð/Ð1AÓBˆÜ! $Ó'ˆÙð—9‘9—=‘=Ð!:Ø!8ó:ˆDä% dÓ+ˆFÙØ—‘Ø%ðCàŸ9™9ð ô&ð Ø!ш�&Ø � ‰ ×Ñ ¨&Õ1r/)r1r?rN)Ú__name__Ú __module__Ú __qualname__Ú__doc__Ú rmenu_specsÚallow_code_contextr)r2r6r;rGrJrLrOr,r1r/r r r :sD„ñò€KðÐòBò òò3ó ò,ò  ò.ô2r/r có0—eZdZddiddidœZd„Zd„Zd„Zy) ÚOnDemandOutputWindowÚ foregroundÚbluez#007700)ÚstdoutÚstderrcó —||_d|_yrN)rTÚowin)r-rTs r r)zOnDemandOutputWindow.__init__§s€ØˆŒ ؈� r/cóv—|js|j«|jj|||«yrN)reÚsetuprGrCs r rGzOnDemandOutputWindow.write«s&€Ø�yŠyØ �J‰JŒLØ � ‰ �‰˜˜4 Õ&r/có—t|j«x|_}|j}|jj «D]\}}|sŒ |j |fi|¤ŽŒ|jd«|jj|_y)NÚsel) r rTrer*ÚtagdefsÚitemsÚ tag_configureÚ tag_raiserG)r-rer*ÚtagÚcnfs r rgzOnDemandOutputWindow.setup°sp€Ü'¨¯ © Ó3Ð3ˆŒ �DØ�y‰yˆØŸ ™ ×*Ñ*Ö,‰HˆC�ÚØ"�×"Ñ" 3Ñ.¨#Ó.ð-ð �‰�uÔØ—Y‘Y—_‘_ˆ� r/N)rXrYrZrjr)rGrgr1r/r r_r_Ÿs*„ð! &Ð)Ø  )Ð,ñ€Gò ò'ó %r/r_Ú__main__)Úmainzidlelib.idle_test.test_outwinrF)Ú verbosityÚexit)r[rÚtkinterrÚidlelib.editorrrr r rr r_rXÚunittestrqr1r/r Úrwseðñó åå'ò€ð€ò2òô8a2�<ôa2÷J%ñ%ð6 ˆzÒÝÙÐ (°A¸EÖBðr/