AlkantarClanX12

Your IP : 3.144.100.252


Current Path : /opt/alt/python35/lib64/python3.5/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python35/lib64/python3.5/idlelib/__pycache__/OutputWindow.cpython-35.opt-2.pyc



���]*�@srddlTddlmZddlZddljZddlmZGdd�de�Z	Gdd�d�Z
dS)	�)�*)�EditorWindowN)�	IOBindingc@s�eZdZdd�Zdd�Zdd�Zdd�Zfd	d
d�Zdd
�Zdd�Z	d%d&d'd(d)gZ
ddddd gZdZdd!d"�Z
d#d$�ZdS)*�OutputWindowcGs*tj||�|jjd|j�dS)Nz<<goto-file-line>>)r�__init__�text�bind�goto_file_line)�self�args�r�1/opt/alt/python35/lib64/python3.5/OutputWindow.pyrszOutputWindow.__init__cCsdS)Nrr)r
�filenamerrr
�ispythonsourceszOutputWindow.ispythonsourcecCsdS)NZOutputr)r
rrr
�short_titleszOutputWindow.short_titlecCs|j�rdSdSdS)N�yes�no)Z	get_saved)r
rrr
�	maybesaveszOutputWindow.maybesave�insertcCsgt|ttf�r*|jtjd�}|jj|||�|jj|�|jj�t	|�S)N�replace)
�
isinstance�bytes�decoder�encodingrrZsee�update�len)r
�s�tags�markrrr
�write%s
zOutputWindow.writecCs"x|D]}|j|�qWdS)N)r)r
�lines�linerrr
�
writelines-s
zOutputWindow.writelinescCsdS)Nr)r
rrr
�flush1szOutputWindow.flush�Cut�<<cut>>�rmenu_check_cut�Copy�<<copy>>�rmenu_check_copy�Paste�	<<paste>>�rmenu_check_pasteN�Go to file/line�<<goto-file-line>>zfile "([^"]*)", line (\d+)z([^\s]+)\((\d+)\)z^(\s*\S.*?):\s*(\d+):z([^\s]+):\s*(\d+):z^\s*(\S.*?):\s*(\d+):c	Cs�|jdkrNg}x-|jD]"}|jtj|tj��qW||_|jjdd�}|j|�}|s�|jjdd�}|j|�}|s�t	j
ddd|j�dS|\}}|jj|�}|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)�file_line_progs�file_line_pats�append�re�compile�
IGNORECASEr�get�_file_line_helper�tkMessageBoxZ	showerror�flist�openZgotoline)	r
�event�l�patr!�resultr�linenoZeditrrr
r	Is( 		
zOutputWindow.goto_file_linecCs�xx|jD]i}|j|�}|r
|jdd�\}}yt|d�}|j�PWq
tk
rrw
Yq
Xq
WdSy|t|�fSWntk
r�dSYnXdS)N���r)r0�search�groupr:�close�OSError�int�	TypeError)r
r!�prog�matchrr?�frrr
r7ds


zOutputWindow._file_line_helper)r$r%r&)r'r(r))r*r+r,)NNN)r-r.N)�__name__�
__module__�__qualname__rrrrrr"r#Zrmenu_specsr1r0r	r7rrrr
rs(			rc@sReZdZdddidddiiZdd�Zdd	�Zd
d�ZdS)
�OnDemandOutputWindow�stdoutZ
foregroundZblue�stderrz#007700cCs||_d|_dS)N)r9�owin)r
r9rrr
r�s	zOnDemandOutputWindow.__init__cCs-|js|j�|jj|||�dS)N)rR�setupr)r
rrrrrr
r�s	
zOnDemandOutputWindow.writecCsut|j�|_}|j}x3|jj�D]"\}}|r/|j||�q/W|jd�|jj|_dS)NZsel)	rr9rRr�tagdefs�itemsZ
tag_configureZ	tag_raiser)r
rRr�tagZcnfrrr
rS�s	
zOnDemandOutputWindow.setupN)rLrMrNrTrrrSrrrr
rOxs
rO)�tkinterZidlelib.EditorWindowrr3Ztkinter.messageboxZ
messageboxr8ZidlelibrrrOrrrr
�<module>s
q