B
}/ @ s d dl Z d dlmZ d dlmZ d dlmZ ddddd gZdad
d Z dd
Z
G dd deZG dd dZe
dkrd dlmZ edddd dS ) N)
messagebox)EditorWindow)iomenuzfile "([^"]*)", line (\d+)z([^\s]+)\((\d+)\)z^(\s*\S.*?):\s*(\d+):z([^\s]+):\s*(\d+):z^\s*(\S.*?):\s*(\d+):c C s dd t D ad S )Nc S s g | ]}t |t jqS )recompile
IGNORECASE).0Zpatr r 3/opt/alt/python37/lib64/python3.7/idlelib/outwin.py
s z!compile_progs..)file_line_patsfile_line_progsr r r r
compile_progs s r c C s t s
t x^t D ]R}|| }|r|dd\}}yt|d}| P W q tk
r` wY qX qW d S y|t|fS tk
r d S X d S )N r) r
r searchgroupopencloseOSErrorint TypeError)lineprogmatchfilenamelinenofr r r
file_line_helper s"
r c @ sj e Zd ZdddddgZdZdd Zd d
Zdd Zd
d ZdddZ dd Z
dd Zdd ZdddZ
dS )OutputWindow)ZCutz<>Zrmenu_check_cut)ZCopyz<>Zrmenu_check_copy)ZPastez <>Zrmenu_check_paste)NNN)zGo to file/linez<>NFc G s$ t j| f| | jd| j d S )Nz<>)r __init__textZbindgoto_file_line)selfargsr r r
r! O s zOutputWindow.__init__c C s dS )NFr )r$ r r r r
ispythonsourceT s zOutputWindow.ispythonsourcec C s dS )NZOutputr )r$ r r r
short_titleX s zOutputWindow.short_titlec C s | rdS dS )NZyesno)Z get_saved)r$ r r r
maybesave\ s zOutputWindow.maybesaver insertc C sF t |tr|tjd}| j||| | j| | j t |S )Nreplace)
isinstancebytesdecoder encodingr" r* Zseeupdatelen)r$ stagsmarkr r r
writea s
zOutputWindow.writec C s x|D ]}| | qW d S )N)r5 )r$ linesr r r r
writelinesx s
zOutputWindow.writelinesc C s d S )Nr )r$ r r r
flush} s zOutputWindow.flushc O s t j|| d S )N)r showerror)r$ r% kwargsr r r
r9 s zOutputWindow.showerrorNc C sd | j dd}t|}|sJ| j dd}t|}|sJ| jdd| j d d S |\}}| j|| d S )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" getr r9 flistZgotofileline)r$ Zeventr resultr r r r r
r# s
zOutputWindow.goto_file_line)r r* )N)__name__
__module____qualname__Zrmenu_specsZallow_code_contextr! r&