3
2a @ 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 j|t jqS )recompile
IGNORECASE).0Zpatr r +/opt/alt/python36/lib64/python3.6/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}|j| }|r|jdd\}}yt|d}|j 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 Zd d!d"d#d$gZd
d Zdd Zdd Zdd Zf dfddZdd Z dd Z
dd Zd%ddZd
S )&OutputWindowCut<>rmenu_check_cutCopy<>rmenu_check_copyPaste <>rmenu_check_pasteNGo to file/line<>c G s0 t j| f| | jjd| j | jjd d S )Nz<>z<>)r __init__textZbindgoto_file_lineZunbind)selfargsr r r
r, M s zOutputWindow.__init__c C s dS )NFr )r/ r r r r
ispythonsourceS s zOutputWindow.ispythonsourcec C s dS )NZOutputr )r/ r r r
short_titleW s zOutputWindow.short_titlec C s | j rdS dS )Nyesno)Z get_saved)r/ r r r
maybesave[ s zOutputWindow.maybesaveinsertc C sF t |tr|jtjd}| jj||| | jj| | jj t |S )Nreplace)
isinstancebytesdecoder encodingr- r6 Zseeupdatelen)r/ stagsmarkr r r
write` s
zOutputWindow.writec C s x|D ]}| j | qW d S )N)rA )r/ linesr r r r
writelinesw 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/ r0 kwargsr r r
rE s zOutputWindow.showerrorc C sd | j jdd}t|}|sJ| j jdd}t|}|sJ| jdd| j d d S |\}}| jj|| 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 rE flistZgotofileline)r/ Zeventr resultr r r r r
r. s
zOutputWindow.goto_file_line)r! r" r# )r$ r% r&