eISrSSKrSSKJr SSKJr /SQrSqSrSr "SS \5r "S S 5r \ S :XaSS K Jr \"SSSS9 gg)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[Vs/sH(n[R"U[R5PM* snqgs snf)z?Compile the patterns for matching to file name and line number.N)file_line_patsrecompile IGNORECASEfile_line_progs)pats 4/opt/imh/python3.13/lib/python3.13/idlelib/outwin.py compile_progsr s5#12"03zz#r}}5"02O2s/<c:[(d [5 [HMnURU5nU(dMURSS5up4[ U5nUR 5 O gU[U54$![ a Mmf=f![a gf=f)aExtract 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 searchgroupopencloseOSErrorint TypeError)lineprogmatchfilenamelinenofs r file_line_helperrs ? D! 5${{1a0 H N  V$$    s$A</ B < B  B  BBcb\rSrSrSr/SQrSrSrSrSr Sr SS jr S r S r S rSSjrS rg) OutputWindow:zAn 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~[R"U/UQ76 URRSUR5 g)Nr()r__init__textbindgoto_file_line)selfargss r r*OutputWindow.__init__Ns.d*T* +T-@-@Acg)z6Python source is only part of output: do not colorize.F)r.rs r ispythonsourceOutputWindow.ispythonsourceSsr1cg)zCustomize EditorWindow title.Outputr3r.s r short_titleOutputWindow.short_titleWsr1c4UR5(aS$S$)z;Customize EditorWindow to not display save file messagebox.yesno) get_savedr8s r maybesaveOutputWindow.maybesave[s((u2d2r1r3c[U[5(deURRX1U5 URR U5 URR 5 [ U5$)aWrite 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. ) isinstancestrr+insertseeupdatelenr.stagsmarks r writeOutputWindow.write`sT !S!!!! $' d 1v r1c8UHnURU5 M g)z"Write each item in lines iterable.N)rL)r.linesrs r writelinesOutputWindow.writelinesvsD JJt r1cg)z8No flushing needed as write() directly writes to widget.Nr3r8s r flushOutputWindow.flush{s r1c0[R"U0UD6 gN)r showerror)r.r/kwargss r rWOutputWindow.showerrorsd-f-r1Nc2URRSS5n[U5nU(dJURRSS5n[U5nU(dURSSURS9 gUupEURR XE5 g) zHandle 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+getrrWflist gotofileline)r.eventrresultrrs r r-OutputWindow.goto_file_linesyy}}/1AB!$'99==!:!8:D%d+F%C99 & ! 1r1)r3rDrV)__name__ __module__ __qualname____firstlineno____doc__ rmenu_specsallow_code_contextr*r4r9r?rLrPrSrWr-__static_attributes__r3r1r r r :sDKB 3 ,  .2r1r c8\rSrSrSS0SS0S.rSrSrSrS rg ) OnDemandOutputWindow foregroundbluez#007700)stdoutstderrcXlSUlgrV)r]owin)r.r]s r r*OnDemandOutputWindow.__init__s  r1c~UR(dUR5 URRXU5 grV)rrsetuprLrHs r rLOnDemandOutputWindow.writes$yy JJL &r1c*[UR5=UlnURnURR 5H!up4U(dMUR "U40UD6 M# URS5 URRUlg)Nsel) r r]rrr+tagdefsitems tag_configure tag_raiserL)r.rrr+tagcnfs r ruOnDemandOutputWindow.setupsn' 33 Dyy **,HCs""3.#.- uYY__ r1)r]rrrLN) rbrcrdreryr*rLrurir3r1r rkrks*!&) ),G ' %r1rk__main__)mainzidlelib.idle_test.test_outwinrF) verbosityexit)rfrtkinterridlelib.editorrrr r rr rkrbunittestrr3r1r rse '28a2<a2J%%6 z (AEBr1