python (3.11.7)

(root)/
lib/
python3.11/
idlelib/
__pycache__/
outwin.cpython-311.opt-1.pyc

eSdZddlZddlmZddlmZgdZdadZdZ	Gdd	eZ
Gd
dZedkrdd
l
mZeddddSdS)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(dtDadS)z?Compile the patterns for matching to file name and line number.cLg|]!}tj|tj"S)recompile
IGNORECASE).0pats  B/BuggyBox/python/3.11.7/bootstrap/lib/python3.11/idlelib/outwin.py
<listcomp>z!compile_progs.<locals>.<listcomp>s6222z#r}55222N)file_line_patsfile_line_progsrrr

compile_progsrs$22"0222OOOrcVtsttD]h}||}|rO|dd\}}	t	|}|n#t$rYdwxYwidS	|t|fS#t$rYdSwxYw)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)	rrsearchgroupopencloseOSErrorint	TypeError)lineprogmatchfilenamelinenofs      r
file_line_helperr#sD!!	${{1a00Hf
NN			




	tV$$tts$#A55
BB	B
B('B(cXeZdZdZgdZdZdZdZdZdZ	dd
Z
dZdZd
Z
ddZdS)OutputWindowzAn 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<<cut>>rmenu_check_cut)Copyz<<copy>>rmenu_check_copy)Pastez	<<paste>>rmenu_check_paste)NNN)zGo to file/line<<goto-file-line>>NFcjtj|g|R|jd|jdS)Nr,)r__init__textbindgoto_file_line)selfargss  r
r.zOutputWindow.__init__Ns;d*T****	+T-@AAAAArcdS)z6Python source is only part of output: do not colorize.Fr)r2r s  r
ispythonsourcezOutputWindow.ispythonsourceSsurcdS)zCustomize EditorWindow title.Outputrr2s r
short_titlezOutputWindow.short_titleWsxrc2|rdndS)z;Customize EditorWindow to not display save file messagebox.yesno)	get_savedr8s r
	maybesavezOutputWindow.maybesave[s((2uud2rrinsertc|j||||j||jt	|S)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.
        )r/r?seeupdate_idletaskslenr2stagsmarks    r
writezOutputWindow.write`sQ"	
	q$'''	

d	""$$$1vv
rc:|D]}||dS)z"Write each item in lines iterable.N)rH)r2linesrs   r

writelineszOutputWindow.writelinesvs0		DJJt		rcdS)z8No flushing needed as write() directly writes to widget.Nrr8s r
flushzOutputWindow.flush{src(tj|i|dSN)r	showerror)r2r3kwargss   r
rPzOutputWindow.showerrorsd-f-----rNc4|jdd}t|}|sK|jdd}t|}|s|dd|jdS|\}}|j||dS)	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/getr#rPflistgotofileline)r2eventrresultr r!s      r
r1zOutputWindow.goto_file_linesy}}/1ABB!$''	9==!:!8::D%d++F
%C9	&&&
!&
&11111r)rr?rO)__name__
__module____qualname____doc__rmenu_specsallow_code_contextr.r5r9r>rHrKrMrPr1rrr
r%r%:sKBBB
333
,



...222222rr%c2eZdZddiddidZdZdZdZdS)	OnDemandOutputWindow
foregroundbluez#007700)stdoutstderrc"||_d|_dSrO)rUowin)r2rUs  r
r.zOnDemandOutputWindow.__init__s
			rct|js||j|||dSrO)rfsetuprHrDs    r
rHzOnDemandOutputWindow.writes7y	JJLLL	4&&&&&rct|jx|_}|j}|jD]\}}|r|j|fi||d|jj|_dS)Nsel)	r%rUrfr/tagdefsitems
tag_configure	tag_raiserH)r2rfr/tagcnfs     r
rhzOnDemandOutputWindow.setups'
333	Dy**,,	/	/HC
/""3..#...uY_


rN)rYrZr[rkr.rHrhrrr
r`r`s_!&) ),G'''
%%%%%rr`__main__)mainzidlelib.idle_test.test_outwinrF)	verbosityexit)r\rtkinterridlelib.editorrrrrr#r%r`rYunittestrrrrr
<module>rxs
			''''''2228a2a2a2a2a2<a2a2a2J%%%%%%%%6zD	(AEBBBBBBr