Viewing File: /opt/alt/python35/lib64/python3.5/idlelib/__pycache__/OutputWindow.cpython-35.pyc



Yf*@srddlTddlmZddlZddljZddlmZGdddeZ	GdddZ
dS)	)*)EditorWindowN)	IOBindingc@seZdZdZddZddZddZdd	Zfd
ddZd
dZ	ddZ
d&d'd(d)d*gZdddd d!gZdZ
dd"d#Zd$d%ZdS)+OutputWindowzAn editor window that can serve as an output file.

    Also the future base class for the Python shell window.
    This class has no input facilities.
    cGs*tj|||jjd|jdS)Nz<<goto-file-line>>)r__init__textZbindgoto_file_line)selfargsr9/opt/alt/python35/lib64/python3.5/idlelib/OutputWindow.pyrszOutputWindow.__init__cCsdS)Nrr)r	filenamerrrispythonsourceszOutputWindow.ispythonsourcecCsdS)NZOutputr)r	rrrshort_titleszOutputWindow.short_titlecCs|jrdSdSdS)Nyesno)Z	get_saved)r	rrr	maybesaveszOutputWindow.maybesaveinsertcCsgt|ttfr*|jtjd}|jj||||jj||jjt	|S)Nreplace)

isinstancebytesdecoderencodingrrZseeupdatelen)r	stagsmarkrrrwrite%s
zOutputWindow.writecCs"x|D]}|j|qWdS)N)r)r	lineslinerrr
writelines-s
zOutputWindow.writelinescCsdS)Nr)r	rrrflush1szOutputWindow.flushCut<<cut>>rmenu_check_cutCopy<<copy>>rmenu_check_copyPaste	<<paste>>rmenu_check_pasteNGo 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|tjqW||_|jjdd}|j|}|s|jjdd}|j|}|st	j
ddd|jdS|\}}|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_progsfile_line_patsappendrecompile
IGNORECASErget_file_line_helpertkMessageBoxZ	showerrorflistopenZgotoline)	r	ZeventlZpatr resultr
linenoZeditrrrrIs( 		
zOutputWindow.goto_file_linecCsxx|jD]i}|j|}|r
|jdd\}}yt|d}|jPWq
tk
rrw
Yq
Xq
WdSy|t|fSWntk
rdSYnXdS)Nr)r/searchgroupr9closeOSErrorint	TypeError)r	r progmatchr
r<frrrr6ds


zOutputWindow._file_line_helper)r#r$r%)r&r'r()r)r*r+)NNN)r,r-N)__name__
__module____qualname____doc__rrrrrr!r"Zrmenu_specsr0r/rr6rrrrrs*			rc@sReZdZdddidddiiZddZdd	Zd
dZdS)
OnDemandOutputWindowstdoutZ
foregroundZbluestderrz#007700cCs||_d|_dS)N)r8owin)r	r8rrrrs	zOnDemandOutputWindow.__init__cCs-|js|j|jj|||dS)N)rPsetupr)r	rrrrrrrs	
zOnDemandOutputWindow.writecCsut|j|_}|j}x3|jjD]"\}}|r/|j||q/W|jd|jj|_dS)NZsel)	rr8rPrtagdefsitemsZ
tag_configureZ	tag_raiser)r	rPrtagZcnfrrrrQs	
zOnDemandOutputWindow.setupN)rIrJrKrRrrrQrrrrrMxs
rM)ZtkinterZidlelib.EditorWindowrr2Ztkinter.messageboxZ
messageboxr7ZidlelibrrrMrrrr<module>s
q
Back to Directory File Manager