Your IP : 216.73.216.196


Current Path : /opt/alt/python310/lib64/python3.10/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python310/lib64/python3.10/idlelib/__pycache__/outwin.cpython-310.opt-2.pyc

o

0�iM�@s�	ddlZddlmZddlmZgd�Zdadd�Zdd�ZGd	d
�d
e�Z	Gdd�d�Z
ed
krAddlm
Z
e
dddd�dSdS)�N)�
messagebox)�EditorWindow)zfile "([^"]*)", line (\d+)z([^\s]+)\((\d+)\)z^(\s*\S.*?):\s*(\d+):z([^\s]+):\s*(\d+):z^\s*(\S.*?):\s*(\d+):cCs	dd�tD�adS)NcSsg|]	}t�|tj��qS�)�re�compile�
IGNORECASE)�.0Zpatrr�5/opt/alt/python310/lib64/python3.10/idlelib/outwin.py�
<listcomp>s�z!compile_progs.<locals>.<listcomp>)�file_line_pats�file_line_progsrrrr	�
compile_progss
�r
c	Cs�	tst�tD]'}|�|�}|r/|�dd�\}}zt|d�}|��Wnty.YqwqdSz|t|�fWStyCYdSw)N���r)	rr
�search�group�open�close�OSError�int�	TypeError)�line�prog�match�filename�lineno�frrr	�file_line_helpers*

��	�rc@sfeZdZ	gd�ZdZdd�Zdd�Zdd�Zd	d
�Zdd
d�Z	dd�Z
dd�Zdd�Zddd�Z
dS)�OutputWindow))ZCutz<<cut>>Zrmenu_check_cut)ZCopyz<<copy>>Zrmenu_check_copy)ZPastez	<<paste>>Zrmenu_check_paste)NNN)zGo to file/line�<<goto-file-line>>NFcGs&tj|g|�R�|j�d|j�dS)Nr )r�__init__�textZbind�goto_file_line)�self�argsrrr	r!NszOutputWindow.__init__cC�	dS)NFr)r$rrrr	�ispythonsourceS�zOutputWindow.ispythonsourcecCr&)NZOutputr�r$rrr	�short_titleWr(zOutputWindow.short_titlecCs	|��rdSdS)NZyesZno)Z	get_savedr)rrr	�	maybesave[szOutputWindow.maybesaver�insertcCs0	|j�|||�|j�|�|j��t|�S�N)r"r,Zsee�update�len�r$�sZtagsZmarkrrr	�write`s

zOutputWindow.writecCs	|D]}|�|�qdSr-)r2)r$�linesrrrr	�
writelinesvs�zOutputWindow.writelinescCs	dSr-rr)rrr	�flush{r(zOutputWindow.flushcOstj|i|��dSr-)r�	showerror)r$r%�kwargsrrr	r6szOutputWindow.showerrorNcCsf	|j�dd�}t|�}|s&|j�dd�}t|�}|s&|jdd|jd�dS|\}}|j�||�dS)Nzinsert 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.)�parent)r"�getrr6�flistZgotofileline)r$Zeventr�resultrrrrr	r#�s"��zOutputWindow.goto_file_line)rr,r-)�__name__�
__module__�__qualname__Zrmenu_specsZallow_code_contextr!r'r*r+r2r4r5r6r#rrrr	r:s	
rc@s6eZdZddiddid�Zdd�Zdd�Zd	d
�ZdS)�OnDemandOutputWindowZ
foregroundZbluez#007700)�stdout�stderrcCs||_d|_dSr-)r:�owin)r$r:rrr	r!�s
zOnDemandOutputWindow.__init__cCs"|js|��|j�|||�dSr-)rB�setupr2r0rrr	r2�szOnDemandOutputWindow.writecCsXt|j�|_}|j}|j��D]\}}|r|j|fi|��q|�d�|jj|_dS)NZsel)	rr:rBr"�tagdefs�itemsZ
tag_configureZ	tag_raiser2)r$rBr"�tagZcnfrrr	rC�s�
zOnDemandOutputWindow.setupN)r<r=r>rDr!r2rCrrrr	r?�s�r?�__main__)�mainzidlelib.idle_test.test_outwinrF)�	verbosity�exit)rZtkinterrZidlelib.editorrrrr
rrr?r<ZunittestrHrrrr	�<module>s	e�