ok

Mini Shell

Direktori : /opt/alt/python36/lib64/python3.6/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/idlelib/__pycache__/outwin.cpython-36.opt-2.pyc

3

��2a��@s�ddlZddlmZddlmZddlmZddddd	gZdad
d�Z	dd
�Z
Gdd�de�ZGdd�d�Ze
dkr�ddlmZedddd�dS)�N)�
messagebox)�EditorWindow)�iomenuzfile "([^"]*)", line (\d+)z([^\s]+)\((\d+)\)z^(\s*\S.*?):\s*(\d+):z([^\s]+):\s*(\d+):z^\s*(\S.*?):\s*(\d+):cCsdd�tD�adS)NcSsg|]}tj|tj��qS�)�re�compile�
IGNORECASE)�.0Zpatrr�+/opt/alt/python36/lib64/python3.6/outwin.py�
<listcomp>sz!compile_progs.<locals>.<listcomp>)�file_line_pats�file_line_progsrrrr
�
compile_progssrcCs�ts
t�x^tD]R}|j|�}|r|jdd�\}}yt|d�}|j�PWqtk
r`wYqXqWdSy|t|�fStk
r�dSXdS)N���r)	r
r�search�group�open�close�OSError�int�	TypeError)�line�prog�match�filename�lineno�frrr
�file_line_helpers"


rc@sjeZdZd d!d"d#d$gZd
d�Zdd�Zdd�Zdd�Zfdfdd�Zdd�Z	dd�Z
dd�Zd%dd�Zd
S)&�OutputWindow�Cut�<<cut>>�rmenu_check_cut�Copy�<<copy>>�rmenu_check_copy�Paste�	<<paste>>�rmenu_check_pasteN�Go to file/line�<<goto-file-line>>cGs0tj|f|��|jjd|j�|jjd�dS)Nz<<goto-file-line>>z<<toggle-code-context>>)r�__init__�textZbind�goto_file_lineZunbind)�self�argsrrr
r,MszOutputWindow.__init__cCsdS)NFr)r/rrrr
�ispythonsourceSszOutputWindow.ispythonsourcecCsdS)NZOutputr)r/rrr
�short_titleWszOutputWindow.short_titlecCs|j�rdSdS)N�yes�no)Z	get_saved)r/rrr
�	maybesave[szOutputWindow.maybesave�insertcCsFt|t�r|jtjd�}|jj|||�|jj|�|jj�t	|�S)N�replace)
�
isinstance�bytes�decoder�encodingr-r6Zsee�update�len)r/�s�tags�markrrr
�write`s

zOutputWindow.writecCsx|D]}|j|�qWdS)N)rA)r/�linesrrrr
�
writelinesws
zOutputWindow.writelinescCsdS)Nr)r/rrr
�flush|szOutputWindow.flushcOstj||�dS)N)r�	showerror)r/r0�kwargsrrr
rE�szOutputWindow.showerrorcCsd|jjdd�}t|�}|sJ|jjdd�}t|�}|sJ|jdd|jd�dS|\}}|jj||�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-�getrrE�flistZgotofileline)r/Zeventr�resultrrrrr
r.�s	
zOutputWindow.goto_file_line)r!r"r#)r$r%r&)r'r(r))NNN)r*r+N)N)
�__name__�
__module__�__qualname__Zrmenu_specsr,r1r2r5rArCrDrEr.rrrr
r ;sr c@s6eZdZddiddid�Zdd�Zdd�Zd	d
�ZdS)�OnDemandOutputWindowZ
foregroundZbluez#007700)�stdout�stderrcCs||_d|_dS)N)rI�owin)r/rIrrr
r,�szOnDemandOutputWindow.__init__cCs"|js|j�|jj|||�dS)N)rQ�setuprA)r/r>r?r@rrr
rA�szOnDemandOutputWindow.writecCsXt|j�|_}|j}x(|jj�D]\}}|r"|j|f|�q"W|jd�|jj|_dS)NZsel)	r rIrQr-�tagdefs�itemsZ
tag_configureZ	tag_raiserA)r/rQr-�tagZcnfrrr
rR�s
zOnDemandOutputWindow.setupN)rKrLrMrSr,rArRrrrr
rN�s
rN�__main__)�mainzidlelib.idle_test.test_outwinrF)�	verbosity�exit)rZtkinterrZidlelib.editorrZidlelibrrr
rrr rNrKZunittestrWrrrr
�<module>s e

Zerion Mini Shell 1.0