MINI MINI MANI MO

Path : /lib64/python2.7/idlelib/
File Upload :
Current File : //lib64/python2.7/idlelib/EditorWindow.pyo


E]c@sddlZddlZddlZddlZddlTddlZddlZddlZddlm	Z	ddl
mZddl
mZddl
m
Z
ddl
mZddl
mZdd	l
mZdd
lmZddl
mZmZmZddl
mZd
ZdZedZdefdYZeZdefdYZdZdZ ddl!Z!e!Z"[!defdYZ#dZ$idd6dd6dd6Z%dZ&d Z'd!Z(e)d"kre(ndS(#iN(t*(tMultiCallCreator(tidlever(t
WindowList(tSearchDialog(t
GrepDialog(t
ReplaceDialog(tPyParse(tidleConf(taboutDialogttextViewtconfigDialog(t
macosxSupporticCstj\}}}}}d||f}|rB|d|f7}n|dkrb|d|f7}n'|dkr|d|d|f7}n|S(sYFormat sys.version_info to produce the Sphinx version string used to install the chm docss%s%ss%st	candidatesrc%stfinali(tsystversion_info(tmajortminortmicrotleveltserialtrelease((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyt_sphinx_versionsc
CsSd}x|jdD]}|dk	r5|jntj||\}}}|dtjkrgPntj||||}y
|j}Wqtk
rt	d|j
qXqW|dtjkrFt|}y
|j}Wntk
rqFXd}t
jj|\}}	|	dkr'd}	n||	}|dtjf}n|||fS(sCVersion of imp.find_module() that handles hierarchical module namest.isNo source for module s.pycs.pyN(tNonetsplittclosetimptfind_modulet	PY_SOURCEtload_modulet__path__tAttributeErrortImportErrort__name__t
__import__t__file__tostpathtsplitext(
tfullnameR'tfilettgttfilenametdescrtmoduletmtbasetext((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyt_find_module$s2




	
t
HelpDialogcBs;eZdZddZdZdZddZRS(cCsd|_d|_dS(N(Rtparenttdlg(tself((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyt__init__Gs	cCs9|jdkr|j|n|r5|j|ndS(s Display the help dialog.

            parent - parent widget for the help window

            near - a Toplevel widget (e.g. EditorWindow or PyShell)
                   to use as a reference for placing the help window
        N(R5Rtshow_dialogt
nearwindow(R6R4tnear((s,/usr/lib64/python2.7/idlelib/EditorWindow.pytdisplayKscCsr||_tjjtjjtjjtd}tj|d|dt	|_
}|jd|jddS(Nshelp.txttHelptmodals	<Destroy>t+(
R4R&R'tjointabspathtdirnameR%R
t	view_filetFalseR5tbindtdestroy(R6R4tfnR5((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR8Xs	-"cCs\|j}|jd|jdf}|j|jd||j|jdS(Ni
s=+%d+%d(R5twinfo_rootxtwinfo_rootytwithdrawtgeometryt	deiconifytlift(R6R:R5tgeom((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR9^s	 

cCsd|_d|_dS(N(RR5R4(R6tev((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyREis	N(R#t
__module__R7RR;R8R9RE(((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR3Es
	
		tEditorWindowcBseZddlmZddlmZddlmZddlm	Z	m
Z
mZddlm
Z
ddlmZddlmZd~Zd~d~d~d~dZd	Zd
ZdZdZd~d
ZdddddddgZejred=ded<ndZd Zd~Zd!Z dgZ!d$Z"d%Z#d&Z$d'Z%d~d(Z&d~d)Z'd~d*Z(d~d+Z)d,Z*d-Z+d.Z,d~d/Z-d~d0Z.d1Z/d2Z0d3Z1d4Z2d5Z3d6Z4d7Z5d8Z6d9Z7d~d:Z8d~d;Z9d~d<Z:d=Z;d>Z<d?Z=d@Z>dAZ?dBZ@dCZAdDZBdEZCdFZDdGZEdHZFdIZGdJZHd~dKZIdLZJdMZKdNZLdOZMdPZNdQZOdRZPdSZQdTdUZRdVZSdTdWZTdXZUdYZVdZZWd[ZXd\ZYd]ZZd^Z[d_Z\d`Z]daZ^d~dbZ_d~d~dcZ`ddZad~deZbd~dfZcdgZddhZediZfdjZgehdkZidlZjdmZkdnZldoZmdpZndqZodrZpdsZqdtZrduZsdvZtdwZudxZvdyZwdzZxd{Zyd|Zzd}Z{RS(i(t
Percolator(tColorDelegator(t
UndoDelegator(t	IOBindingtfilesystemencodingtencoding(tBindings(tToplevel(tMultiStatusBarc
Cs	tjdkrstjjtjdd}tjj	drddtj
d }tjjdrld}q
d	}tjj||dd}nztjd d
krtjjtjddt}tjj
|r
|}q
n'tjr
tjjtjd}ntjj|}tjj
|r\|t_tjd
krpdtjt_qpqsdtj
d t_ntj}	||_|p|j}||_ytjWntk
rdt_nXt||_tj|d|j|_}
|r|j|_|j|j_ni|_i|j_tjjtj d|_!t"|
|_#}t$|dd|_%}tj&ddddd|_'idd6dd6dd6|j'd6tj&ddd ddd 6}
t(d!krd"|
d#<nt)t*||
|_+}|j+|j_,|j-|j.|jj/d$|j0|jj1d%|j2tjr|j1d%|j2|j1d&|j3n|j1d'|j3|j1d(|j4|j1d)|j5|j1d*|j6|j1d+|j7|j1d,|j8|j1d-|j9|j1d.|j:|j1d/|j;|j1d0|j<|j1d1d2|j1d3|j=|j1d4|j>|j1d5|j?|j1d6|j@|j1d7|jA|j1d8|jB|j1d9|jC|j1d:|jD|j1d;|jE|j1d<|jF|j1d=|jG|j1d>|jH|j1d?|jI|j1d@|jJ|j1dA|jK|j1dB|jL|j1dC|jM|j1dD|jN|j1dE|jO|j1dF|jPdG|j1dH|jPdI|j1dJ|jQ|j1dK|jR|j1dL|jS|r||j|<|r_||jT|<n|j1dM|jU|j1dN|jjV|j1dO|jW|j1dP|jXn|jY|jZ|dQ<|j[dRt\dSt]|j^|dT<dU}tj&dddVddWrdX}n|j_dYtj&dddYtj&dddZdd|f|j[dRt`dStad[dI|j[dRtbdStad[dI|jctj&dd\d]ddW}||_dd^|_e|je|_f|jgth|_idi|_j|jk||_l}|jm|_n}|jo||jp|_p|jq|_q|jr|js|jt||_u}|jv|jwt|j|_x|jydbjzddcdddedGd|jx|j{d|_||r	tjj}|rtjj|r|j~|q	|j|n|j|js|j|j||j|jyjdf}|r	|jdg}|dkrw	dh}n|dGkr	|j|dI}n||_tj|jntj|_tj|_tj|_dS(jNtDocs
index.htmltlinuxspython-docs-s%s.%s.%sis/var/www/html/python/s/var/www/html/python/index.htmls/usr/share/doc/twinsPython%s.chms0Resources/English.lproj/Documentation/index.htmltdarwinsfile://shttp://docs.python.org/%d.%dis>>> tmenusrecent-files.lsttnametvbartmainRPtwidthttypetintttextitpadxtnonetwraptheightg!@t
wordprocessorttabstyletWM_DELETE_WINDOWs<<close-window>>s<Control-Button-1>s<3>s<<cut>>s<<copy>>s	<<paste>>s<<center-insert>>s<<help>>s<<python-docs>>s<<about-idle>>s<<open-config-dialog>>s<<open-module>>s<<do-nothing>>cSsdS(Ntbreak((tevent((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyt<lambda>ss<<select-all>>s<<remove-selection>>s<<find>>s<<find-again>>s<<find-in-files>>s<<find-selection>>s<<replace>>s
<<goto-line>>s<<smart-backspace>>s<<newline-and-indent>>s<<smart-indent>>s<<indent-region>>s<<dedent-region>>s<<comment-region>>s<<uncomment-region>>s<<tabify-region>>s<<untabify-region>>s<<toggle-tabs>>s<<change-indentwidth>>s<Left>is<Right>is<<del-word-left>>s<<del-word-right>>s<<beginning-of-line>>s<<open-new-window>>s<<close-all-windows>>s<<open-class-browser>>s<<open-path-browser>>tcommandtsidetfilltyscrollcommandtnormals	font-boldtbooltboldtfonts	font-sizetexpandtIndents
use-spacesii2ii@KLR*tlabelsRecent Filest	underlinetwindowstendi(i2ii@KL(RPthelp_urlRR&R'R?RtprefixtplatformtcountRtisdirRtisfileRtrunningAsOSXApptnormpathRtCurrentThemetflisttroottps1R!tMenutmenubarRtListedToplevelttoptvarsttkinter_varstinversedictt
instance_dictt
GetUserCfgDirtrecent_files_pathtFramet
text_framet	ScrollbarR`t	GetOptionRbt	TkVersionRtTextRetfocused_widgett
createmenubartapply_bindingstprotocolRRDtclose_eventtright_menu_eventtcuttcopytpastetcenter_insert_eventthelp_dialogtpython_docstabout_dialogt
config_dialogtopen_modulet
select_alltremove_selectiont
find_eventtfind_again_eventtfind_in_files_eventtfind_selection_eventt
replace_eventtgoto_line_eventtsmart_backspace_eventtnewline_and_indent_eventtsmart_indent_eventtindent_region_eventtdedent_region_eventtcomment_region_eventtuncomment_region_eventttabify_region_eventtuntabify_region_eventttoggle_tabs_eventtchange_indentwidth_eventtmove_at_edge_if_selectiont
del_word_lefttdel_word_rightt
home_callbacktdicttnew_callbacktclose_all_callbacktopen_class_browsertopen_path_browsertset_status_bartyviewtpacktRIGHTtYtsettconfigtLEFTtBOTHtTOPt	focus_settusetabsttabwidthtindentwidthtset_notabs_indentwidthRCtcontext_use_ps1tnum_context_linesRQtperRStundotinsertfiltertundo_block_starttundo_block_stoptset_saved_change_hooktsaved_change_hookRTtiotset_filename_change_hooktfilename_change_hooktrecent_files_menutmenudicttinsert_cascadetupdate_recent_files_listtcolortexiststloadfiletset_filenametResetColorizertset_indentation_paramstispythonsourcetload_extensionstgettindext
add_separatort	wmenu_endtregister_callbacktpostwindowsmenuttkMessageBoxtaskyesnottkSimpleDialogt
askintegert	showerror(R6RR,tkeyRtdochometpyvertbasepathtchmfiletcurrentThemeRRR`ttext_optionsRet
fontWeightt	usespacesRRRR^R}((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR7{s>				

	







	


	
		


	%


	

	cCsxt|ts|r|Sy|j|jSWnCtk
rsy|j|jSWqttk
ro|jdSXnXdS(s8convert filename to unicode in order to display it in Tks	iso8859-1N(t
isinstancetunicodetdecodeRUtUnicodeDecodeErrorRV(R6R,((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyt_filename_to_unicode]s

cCs)|jj\}}|jj|dS(NRm(RtdefaultfilenameRtnew(R6RnRAtbasename((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRlscCs||jd@dkr&|jdkr&dS|jjdr|jjdddr|jjdddrt|jjdjdd	}nR|jjdd}x:tt	|D]}||dkrPqqWt	|}t|jjdjdd	}||krd}nd
t
|d}|jd	@dkr\|jjdddn|jjds|jjddnY|jj|jjdd|jjdr|jjddn|jjdd|jj|}|jjd}|jj|d|r)||}}n|jjddd|jj
d|||jjd||jjddS(NiitHometiomarks<=sinsert lineendsinsert linestartRit s	tinsertsinsert linestart+tctsels1.0R}s	sel.firstt	my_anchort<ssel.lastt>Rm(R
s	(tstatetkeysymReRtcompareRdRRtxrangetlentstrt
tag_removetmark_setttag_addtsee(R6Rntinsertpttlinetlineattdesttfirsttlast((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRqs>"(%	0cCs|j|j|_tjr=|jjdddtn|jjdddt|jjdddt|jjdtdt	|j
jd	|j|j
j
d	d
d|j
j|jdS(Nt	_padding1s    RqtcolumnsCol: ?RsLn: ?Rrs<<set-line-and-column>>s<KeyRelease>s<ButtonRelease>(RYRt
status_barRRt	set_labelRRtBOTTOMtXReRDtset_line_and_columnt	event_addt
after_idle(R6((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs
cCsS|jjtjd\}}|jjdd||jjdd|dS(NRR"sCol: %sRsLn: %s(ReRtINSERTRR#R$(R6RnRR"((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR's!R*t_Fileteditt_EdittformattF_ormattrunt_Runtoptionst_OptionsR|t_Windowsthelpt_Helpit_WindowicCs|j}i|_}x_|jD]T\}}t|\}}t|d|||<}|jd|d|d|q Wtj|jrt|dd|d<}|jddd|n|j	|jdj
t|_|j
dS(	NR_RzR^R{tappletapplicationtIDLER5(RRt
menu_specstprepstrRtadd_cascadeRtisCarbonAquaTkRt
fill_menusRtENDtbase_helpmenu_lengthtreset_help_menu_entries(R6tmbarRR_RzR{R^((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs	
 
cCsk|jd}|jd}|dkr1d}n||jkrZ|j|jd|ntj|dS(NR|R}ii(RRRRtdeleteRtadd_windows_to_menu(R6R^R}((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs
	c	Cs%|jjdd|j|jf|js9|jn|j}||_tjd dk}|rz|jj	ddnxr|j
D]g}y|\}}}Wntk
rqnX|dkrqnt
||}|j|d|qW|j|j|j|r!|jj	ddndS(	NRs@%d,%diR\tcursortarrowRtibeam(ReRtxtytrmenut
make_rmenuRnRRRtrmenu_specst
ValueErrorRtgetattrtentryconfigurettk_popuptx_rootty_root(	R6RnRKtiswintitemRzt	eventnametverify_stateR((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs(#	
		
tCloses<<close-window>>cCst|jdd}xg|jD]\}|d|d}}|dk	rq|j|d}|jd|d|q|jqW||_dS(NttearoffiicSs|j|dS(N(tevent_generate(ReRV((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRpsRzRp(RReRMRtadd_commandRRK(R6RKRURzRVRp((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRLscCs
|jS(N(trmenu_check_copy(R6((s,/usr/lib64/python2.7/idlelib/EditorWindow.pytrmenu_check_cutscCs=y|jjd}Wntk
r*dSX|r5dSdSdS(Ns	sel.firsttdisabledRt(ReRtTclError(R6tindx((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR\s

cCs=y |jjjd|jdWntk
r4dSXdSdS(Nstk::GetSelectiont	CLIPBOARDR^Rt(RettktcallR_(R6((s,/usr/lib64/python2.7/idlelib/EditorWindow.pytrmenu_check_pastes
 
cCstj|jddS(Ns
About IDLE(R	tAboutDialogR(R6Rn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRscCstj|jddS(NtSettings(RtConfigDialogR(R6Rn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRscCs8|jr|j}n	|j}tj|d|jdS(NR:(RRt
helpDialogR;(R6RnR4((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs		cCsytjd dkreytj|jWqutk
ra}tjdddt|d|j	quXnt
j|jdS(NiR\ttitlesDocument Start FailuretmessageR4Rm(RRR&t	startfileR~tWindowsErrorRRRRet
webbrowsertopen(R6Rntwhy((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR#scCs|jjddS(Ns<<Cut>>Rm(ReRZ(R6Rn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR.scCs*|jjdsdS|jjddS(NR
s<<Copy>>Rm(Ret
tag_rangesRZ(R6Rn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR2scCs$|jjd|jjddS(Ns	<<Paste>>RRm(ReRZR(R6Rn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR9scCs=|jjddd|jjdd|jjddS(NR
s1.0send-1cRRm(ReRRR(R6Rn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR>scCs*|jjddd|jjddS(NR
s1.0R}R(ReRR(R6Rn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRDscs:|jj|jjdfd}|S(sCursor move begins at start or end of selection

        When a left/right cursor key is pressed create and return to Tkinter a
        function which causes a cursor move from the associated edge of the
        selection.

        ssel.first+1cssel.last-1ccsM|jd@dkrIyddWqItk
rEqIXndS(Niis	sel.firstR(RR_(Rn(t
edge_indextedges_tabletself_text_indextself_text_mark_set(s,/usr/lib64/python2.7/idlelib/EditorWindow.pytmove_at_edgeSs

(ssel.first+1cssel.last-1c(ReRR(R6RqRu((RqRrRsRts,/usr/lib64/python2.7/idlelib/EditorWindow.pyRHs
cCs|jjddS(Ns
<Meta-Delete>Rm(ReRZ(R6Rn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR\scCs|jjddS(Ns<Meta-d>Rm(ReRZ(R6Rn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR`scCstj|jdS(NRm(RtfindRe(R6Rn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRdscCstj|jdS(NRm(Rt
find_againRe(R6Rn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRhscCstj|jdS(NRm(Rtfind_selectionRe(R6Rn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRlscCs tj|j|j|jdS(NRm(RtgrepReRR(R6Rn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRpscCstj|jdS(NRm(RtreplaceRe(R6Rn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRtscCsp|j}tjddd|}|dkr1dS|dkrK|jdS|jdd||jddS(NtGotosGo to line number:R4RmiRs%d.0(ReRRRtbellRR(R6RnRetlineno((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRxs		
c	CsPy|jjdd}Wntk
r2d}n
X|j}tjddd|jd|}|ru|j}n|sdSy"t|\}}\}}}Wn9ttfk
r}t	j
dt|d|jdSX|tj
kr
t	j
d	d
|d|jdS|r |jn|jr<|jj|n|jj|dS(Ns	sel.firstssel.lastttModulesAEnter the name of a Python module
to search on sys.path and open:R4tinitialvaluesImport errorsUnsupported types%s is not a source module(ReRR_tstripRt	askstringR2t	NameErrorR"RRRRRRRRnRR(	R6RnR_tfR*tsuffixtmodeRctmsg((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs4

	"	
	cCs|jj}|s<tjddd|j|jjdStjj	|\}}tjj
|\}}ddlm}|j|j
||gdS(NsNo filenames&This buffer has no associated filenametmasteri(tClassBrowser(RR,RRReRRR&R'RR(tidlelibRR(R6RnR,theadttailR0R1R((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs

cCs$ddlm}|j|jdS(Ni(tPathBrowser(RRR(R6RnR((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRscCsl|dk	rh|dkrh|jjdd||jjddd|jjddd|jndS(NiRs%d.0R
s1.0R}s
insert +1l(RReRRRtcenter(R6R}((s,/usr/lib64/python2.7/idlelib/EditorWindow.pytgotolines
cCs|stjj|rtStjjtjj|\}}tjj|dkr]tSy&t|}|j}|j	Wnt
k
rtSX|jdo|j
ddkS(Ns.pys.pyws#!tpythoni(s.pys.pyw(R&R'RtTrueR(RtnormcaseRntreadlineRtIOErrorRCt
startswithRv(R6R,R0R1RR((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs$
cCs)|jr%|jj|d|_ndS(N(Rtunregister_maybe_terminateR(R6((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyt
close_hooks	cCs
||_dS(N(R(R6R((s,/usr/lib64/python2.7/idlelib/EditorWindow.pytset_close_hookscCsD|jr|jj|n|j|jj||jdS(N(Rtfilename_changed_editRRtupdate_windowlist_registryR(R6((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs
	
cCs}|jr
dS|j|jjr4|j|_n|jry|jj|j|jj|j|jj|jndS(N(	RRRR,RRRtremovefilterRR(R6((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyt
_addcolorizers		cCs:|js
dS|jj|jj|jd|_dS(N(RtremovecolorsRRR(R6((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyt_rmcolorizers
	
cCs|j|jtjddd}tj|d}tj|ddd}tj|d}|jjd	|d	d
|d
d|d|d	d
|d
dS(sUpdate the colour themeRatThemeR_RtRFtfgBgtfgthilitet
foregroundt
backgroundtinsertbackgroundtselectforegroundtselectbackgroundN(RRRRtGetHighlightReR(R6tthemet
normal_colorstcursor_colort
select_colors((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs




c	Csnd}tjdddddr*d}n|jjdtjdddtjddd	dd
|fdS(s.Update the text widgets' font if it is changedRtRaRPs	font-boldRcRuRvRws	font-sizeRdN(RRReR(R6R((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyt	ResetFonts	cCstj|j_}x-|jD]\}}|jj||q#Wx\|jD]N}tj|}|rSx0|jD]\}}|jj||q{WqSqSWdS(s/Remove the keybindings before they are changed.N(	RtGetCurrentKeySetRWtdefault_keydefstitemsRetevent_deletetget_standard_extension_namestGetExtensionBindings(R6tkeydefsRntkeylistt
extensionNametxkeydefs((s,/usr/lib64/python2.7/idlelib/EditorWindow.pytRemoveKeybindings	sc
Cstj|j_}|jx9|jD]+}tj|}|r-|j|q-q-Wi}xd|jjD]V}i||d<x?|dD]3}|r|d||dt|dd<qqWqoWx|j	j
D]}|j	|}|jtd}xt
d|D]}	|j|	dkr|j|	d}
|
r|j|	d}d}||kr|||kr|||}qn|rt||}
|j|	d|
qqqqWqWdS(s-Update the keybindings after they are changediiRptacceleratorRzR~N(RRRWRRRRtmenudefsR<RtkeysRR@trangeRct	entrycgettget_acceleratortentryconfig(
R6RRRt
menuEventDictR^RUtmenubarItemR}RtacceltitemNameRn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pytApplyKeybindingss6
/
cCs.|js*tjddddd|_ndS(sCUpdate the indentwidth if changed and not using tabs in this windowRaRys
num-spacesRcRdN(RRRR(R6((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR5s	cCstj}|jd}|jt}||jkrQ|j|jd|n|r|jx>|D]3}|j|d}|j	d|dd|qhWn||jd<dS(s3Update the additional help entries on the Help menuR5iRziRpN(
RtGetAllExtraHelpSourcesListRRR@RARDRt"_EditorWindow__extra_help_callbackR[(R6t	help_listthelpmenuthelpmenu_lengthtentrytcmd((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRB<s


!cs|fd}|S(sCCreate a callback with the helpfile value frozen at definition timecs|jd	s$tjj|}ntjd dkrytj|Wqtk
r}tj	dddt
|djqXn
tj
|dS(
NtwwwthttpiR\RisDocument Start FailureRjR4(RR(RR&R'RRRRkRlRRRReRmRn(thelpfileRo(R6(s,/usr/lib64/python2.7/idlelib/EditorWindow.pytdisplay_extra_helpOs((R6RR((R6s,/usr/lib64/python2.7/idlelib/EditorWindow.pyt__extra_help_callbackMsc
Cs\g}tjj|jrNt|jd}z|j}Wd|jXn|rtjj|d}||kr|j|n|j	d|ng}xD|D]<}d|kstjj|dd!r|j
|qqWg|D]}||kr|^q}d}|dt|!}y,t|jd}|j|WdQXWn`t
k
r}t|jd	tst|j_tjd
ddd
t|d|jqnXx|jjjD]}	|	j}
|
jdtxlt|D]^\}}|j}|j|}
|	j |}|
j!d||d|
d|ddqWqWdS(s/Load and update the recent files list and menustrNs
itit1234567890ABCDEFGHIJKtwtrecentfilelist_error_displayedRis
IDLE ErrorRjs&Unable to update Recent Files list:
%sR4RzR
RpR{("R&R'RRRnt	readlinesRR@tremoveRtappendRt
writelinesRRORRCRRRRRReRRRRRDR@t	enumeratetrstripRt#_EditorWindow__recent_file_callbackR[(R6tnew_filetrf_listtrf_list_filet	bad_pathsR'tulcharstrf_fileterrtinstanceR^tit	file_namet
ufile_nametcallback((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR\sL
&%
	cs|fd}|S(Ncsjjd|dS(NteditFile(RRn(t
fn_closure(R6(s,/usr/lib64/python2.7/idlelib/EditorWindow.pytopen_recent_files((R6RR((R6s,/usr/lib64/python2.7/idlelib/EditorWindow.pyt__recent_file_callbackscCs|j}|j}|r5|r5|d|}n$|rD|}n|rS|}nd}|ph|ph|}|jsd|}d|}n|jj||jj|dS(Ns - tUntitleds*%s*s*%s(tshort_titlet
long_titlet	get_savedRtwm_titletwm_iconname(R6tshorttlongRiticon((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs		

cCs
|jjS(N(RR(R6((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRscCs|jj|dS(N(Rt	set_saved(R6tflag((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRscCs|jjdS(N(Rt
reset_undo(R6((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRscCs4|jj}|r'tjj|}n|j|S(N(RR,R&R'RR(R6R,((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRscCs|j|jjpdS(NR~(RRR,(R6((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRscCs|jdS(N(R(R6Rn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRsRcCsb|j}|j\}}|j|}||}td||d}|jt|dS(Nii(Retgetwindowlinest	getlinenotmaxRtfloat(R6tmarkReRtbotR}Ritnewtop((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs	
cCsp|j}|jd}|jd}||krf|jdkrft|d}||d}n||fS(Ns@0,0s@0,65535iRi(ReRtwinfo_heightRd(R6ReRRRi((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs	cCs"|j}tt|j|S(N(ReRdRR(R6RRe((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs	cCs:|jj}tjd|}tt|j}|S(sReturn (width, height, x, y)s(\d+)x(\d+)\+(-?\d+)\+(-?\d+)(Rtwm_geometrytretmatchtmapRdtgroups(R6RMR/ttuple((s,/usr/lib64/python2.7/idlelib/EditorWindow.pytget_geometryscCs|jdS(N(R(R6Rn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRscCsh|jrd|jsW|jjdkr:|jjn|jj|jjn|jjSdS(NRt(RRRRRKtlowerRLt	maybesave(R6((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR	s	
cCs/|j}t|dkr+|jn|S(Ntcancel(R	Rt_close(R6treply((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs
cCs|jjr%|jd|jjntj|j|j|jjd|_d|_	|j
r|j
jtd|_
nd|_d|_
|jjd|_|jj|jr|jndS(NR(RR,RRtunregister_callbackRtunload_extensionsRRRRRCReRRRRER(R6((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs"

					
	
	cCsi|_|jdS(N(t
extensionstload_standard_extensions(R6((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs	cCsCx3|jjD]"}t|dr|jqqWi|_dS(NR(RtvaluesthasattrR(R6tins((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRscCs[xT|jD]F}y|j|Wq
dGt|GHddl}|jq
Xq
WdS(NsFailed to load extensioni(Rtload_extensiontreprt	tracebackt	print_exc(R6R_R((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRscCstjdtS(Nteditor_only(Rt
GetExtensionsR(R6((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR
scCsVyt|ttg}Wntk
r<dG|GHdSXt||}tj|}t|dr|j|j	|n||}||j
|<|rR|j|x|jD]}|j
dd}x|d dkr|d}qWx|ddkr|d }qW|d	}t||r|jj|t||qqWndS(
Ns
Failed to import extension: Rt-t_iRiRt_event(R$tglobalstlocalsR"RORRRR?RRRRRzReRD(R6R_tmodtclsRRtveventt
methodname((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs,
	


cCsg|dkr|jj}n|j}||_x3|jD]%\}}|r:|j||q:q:WdS(N(RRWRReRRR((R6RReRnR((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR(s		c
Csf|d	kr|jj}n|d	kr6|jj}n|j}|j}x|D]\}}|j|}|svqOnx|D]}|s|jq}|\}	}
|	d dk}|r|	d}	nt|	\}}	t	||
}
||
d}|r8|j
|
t}|jd|	d|d|d|
d|q}|j
d|	d|d|d|
q}WqOWd	S(
sAdd appropriate entries to the menus and submenus

        Menus that are absent or None in self.menudict are ignored.
        it!cSs|j|dS(N(RZ(ReRV((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRpJsRzR{RpRtvariableN(RRWRRRReRRR<Rtget_var_objt
BooleanVartadd_checkbuttonR[(R6RRRRetmnamet	entrylistR^RRzRVtcheckbuttonR{RRptvar((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR?1s8		



cCs2|j|}|r%|j}|St|dS(N(R%RR(R6R_R+tvalue((s,/usr/lib64/python2.7/idlelib/EditorWindow.pytgetvarVs
cCs5|j||}|r(|j|n	t|dS(N(R%RR(R6R_R,tvartypeR+((s,/usr/lib64/python2.7/idlelib/EditorWindow.pytsetvar^scCs@|jj|}|r<|r<||j|j|<}n|S(N(RRRe(R6R_R.R+((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR%es
cCs<|jr4|jjd|p3d|jj|kSdSdS(NtTODOtSTRINGi(RRet
tag_prevranget	tag_names(R6t
text_index((s,/usr/lib64/python2.7/idlelib/EditorWindow.pytis_char_in_stringus	cCsKy2|jjd}|jjd}||fSWntk
rFdSXdS(Ns	sel.firstssel.last(NN(ReRR_R(R6RR ((s,/usr/lib64/python2.7/idlelib/EditorWindow.pytget_selection_indicess
cCs|jdpt}t|S(Nttabs(RetTK_TABWIDTH_DEFAULTRd(R6tcurrent((s,/usr/lib64/python2.7/idlelib/EditorWindow.pytget_tabwidthscCs^|j}|j|krZ|jjdd|dd|jd|}|jd|ndS(NRwtmeasures
-displayoftnR7(ReR:RbRcRt	configure(R6tnewtabwidthRetpixels((s,/usr/lib64/python2.7/idlelib/EditorWindow.pytset_tabwidths		
cCsu|ra|ra|j}d|ko/dknr@||_n|j|jkrat|_qan|j|jdS(Nii(tguess_indentRRRCRR@(R6RtguessR((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRscCs|j}|j\}}|rK|rK|j|||jd|dS|jdd}|dkr|jdddr|jdn
|jdS|dd	kr|jddS|j}t|j	|}|d
|j
|j
}|jrtj
jdd}	nd}	d}
x\||	kr4Pn|d }|
d
}
t|j	|}||ksy|dd	kr$Pq$q$|j|jd
|
d||kr|jdd||n|jdS(NRRmsinsert linestartR~Rs1.0s	insert-1cis 	is
is
insert-%dcR
(ReR6RDRRRR|RRt
expandtabsRRRRRRRR(R6RnReRR tcharsRthavetwanttlast_line_of_promptt
ncharsdeleted((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRsH	

		



c
CsH|j}|j\}}|jz|r||r|t|t|krY|j|S|j|||jd|n|jdd}t||j	\}}|t
|kr|j||jnU|j
rd}n3t
|j|j	}|j}	d|	||	}|jd||jddSWd|jXdS(NRsinsert linestarts	R
Rm(ReR6Rt
index2lineRRDRRt
classifywsRRtreindent_toRRRCRRR(
R6RnReRR Rtrawt	effectivetpadR<((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs,	

			
c	Cs|j}|j\}}|jz|rW|rW|j|||jd|n|jdd}dt|}}x*||kr||dkr|d}qW||kr|jdddS|| }d}tj	j
dd}	x:|r+|ddkr+||	kr+|d }|d}qW|rI|jd	|dnx&|jddkrq|jdqLW|jddt|jd}
t
j|j|j}|js^x|jD]}t|
|d}
t|
d
}|j|d}|j||j|j|j|}|dk	s@|
dkrPqqW|j|pWdnW|jdd}|r|d}nd}|j|d}|j||jd|j}|t
jkrw|t
jkrn|t
jkr|jd|no|t
jkr)|j |j!nJ|t
j"krs|j#dkr]|jd|qs|j |j$ndS|j%}|jd||j&r|j'|n"|r|j(r|j)|ndSWd|j*d|j+XdS(
NRsinsert linestartis 	is
Rmisinsert - %d charss.0tconsoles1.0(,ReR6RRDRRRRRRRRIRRtParserRRRRRRtset_strtfind_good_parse_startt_build_char_in_string_funcRtset_loR2tget_continuation_typetC_NONEtC_STRING_FIRST_LINEtC_STRING_NEXT_LINESt	C_BRACKETRKtcompute_bracket_indenttC_BACKSLASHtget_num_lines_in_stmttcompute_backslash_indenttget_base_indent_stringtis_block_openerRtis_block_closerRRR(R6RnReRR RRR<tindentRGtlnoRJtcontexttstartattstartatindextrawtexttbodRR((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs	

%
	




cCs||jd}|S(NcSs||d|S(Ns+%dc((toffsett_startindext_icis((s,/usr/lib64/python2.7/idlelib/EditorWindow.pytinnerhs(R5(R6t
startindexRk((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRSgsc
Cs|j\}}}}xmtt|D]Y}||}|r+t||j\}}	|	|j}	|j|	||||<q+q+W|j||||dS(NRm(t
get_regionRRRJRRt_make_blankst
set_region(
R6RnRRRDtlinestposRRLRM((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRms

"c
Cs|j\}}}}xvtt|D]b}||}|r+t||j\}}	t|	|jd}	|j|	||||<q+q+W|j||||dS(NiRm(	RmRRRJRRRRnRo(
R6RnRRRDRpRqRRLRM((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRxs
"cCsk|j\}}}}x6tt|dD]}||}d|||<q/W|j||||dS(Nis##(RmRRRo(R6RnRRRDRpRqR((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs

cCs|j\}}}}xttt|D]`}||}|sGq+n|d dkrd|d}n|d dkr|d}n|||<q+W|j||||dS(Nis##it#(RmRRRo(R6RnRRRDRpRqR((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs


c
Cs|j\}}}}|j}|dkr4dSxutt|D]a}||}|rGt||\}	}
t|
|\}}d|d|||	||<qGqGW|j||||dS(Ns	R
(Rmt_asktabwidthRRRRJtdivmodRo(
R6RnRRRDRpRRqRRLRMtntabstnspaces((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs
%cCs|j\}}}}|j}|dkr4dSx1tt|D]}||j|||<qGW|j||||dS(N(RmRsRRRRCRo(R6RnRRRDRpRRq((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRscCsZ|jddd
|jdd|jdd	d
|jrV|j|_d|_ndS(NsToggle tabss
Turn tabs tontoffs?
Indent width swill bes
remains ats 8.s!
 Note: a tab is always 8 columnsR4iRm(RwRx(swill bes
remains at(RRReR(R6Rn((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs!
cCs_|jddd|jd|jdddd}|r[||jkr[|jr[||_nd	S(
NsIndent widths6New indent width (2-16)
(Always use 8 when using tabs)R4RtminvalueitmaxvalueiRm(RReRR(R6RnR((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRs			cCs|j}|j\}}|rP|rP|j|d}|j|d}n|jd}|jd}|j||}|jd}||||fS(Ns
 linestarts-1c lineend +1csinsert linestartsinsert lineend +1cs
(ReR6RRR(R6ReRR RRRDRp((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRms	cCs|j}dj|}||kr2|jdS|jddd|jd||j|j|||j|||j|j	d|ddS(Ns
R
s1.0R}R(
ReR?R|RRRRDRRR(R6RRRDRpRetnewchars((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRos	


cCs=|jr1t||j\}}d|d|Sd|SdS(Ns	R
(RRtR(R6R<RuRv((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRns	cCsk|j}|j|jdddr;|jddn|r]|jd|j|n|jdS(Nsinsert linestarts!=R(ReRRRDRRnR(R6R"Re((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRKs	
cCs.|jddd|jd|jddddS(	Ns	Tab widthsColumns per tab? (2-16)R4RRyiRzi(RReR(R6((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRss		cCsrt|j|jj\}}|r`|r`t||j\}}t||j\}}n
d}}||S(Ni(tIndentSearcherReRR0RJ(R6topenertindentedRLtindentsmalltindentlarge((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRAs!
N(sfileR+(seditR-(sformatR/(srunR1(R2R3(swindowsR4(shelpR6(swindowsR7(RXs<<close-window>>N(|R#ROtidlelib.PercolatorRQtidlelib.ColorDelegatorRRtidlelib.UndoDelegatorRStidlelib.IOBindingRTRURVRRWtTkinterRXtidlelib.MultiStatusBarRYRR~R7RRRRR'R;RRRRRKRRMRLR]R\RdRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRBRRRRRRRRRRRRRRRR	RRRRRRRRR?R-R/R%R5R6R:R@RRRRRRSRRRRRRRRRmRoRnRKRsRA(((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRPps			)		
		
																		!											 			-									
													%							0	#	k					
					
		
			cCstt|S(N(RdR(R((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRIscCstd}}x]|D]U}|dkr:|d}|d}q|dkre|d}||d|}qPqW||fS(NiR
is	((tsRRLRMtch((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRJs




R|cBs;eZdZdZejejd
dZd	ZRS(cCs6||_||_d|_|_d|_|_dS(Ni(ReRRtfinishedRtblkopenlinetindentedline(R6ReR((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR75s		cCsd|jr
dS|jd}|_t|d}|jj|ddrMdS|jj||dS(NR~is.0s>=R}s lineend+1c(RRRReRR(R6RR((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR;s	tclasstdeftfortifttrytwhilec		Cs^|jrnN||kr0||kr0||_n*||krZ|jrZ||_d|_ndS(Ni(RRR(	R6RcttokentstartR}RtINDENTtNAMEtOPENERS((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyt
tokeneaterDs		cCsmtj}|jt_z;ytj|j|jWntjtfk
rNnXWd|t_X|j|j	fS(N(
t	_tokenizettabsizeRttokenizeRRt
TokenErrortSyntaxErrorRR(R6tsave_tabsize((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR0Ps	
(RRRRRR(	R#ROR7RRRRRR0(((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR|.s		
	cCs>|jd}|dkr4|| ||d}n||fS(NRii(Rv(RR((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyR<`st[tbracketleftt]tbracketrightt/tslashcCs|j|}|s7tjr;|dddhkr;dS|d}tjdd|}tjdd	|}tjd
d|}tjdd|}tjd
d|}tjdd|}tjdd|}tjdd|}tjdd|}|S(Ns<<open-module>>s
<<goto-line>>s<<change-indentwidth>>R~is-[a-z]\bcSs|jjS(N(tgrouptupper(R/((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRoyss\b\w+\bcSstj|j|jS(N(tkeynamesRR(R/((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRozssKey-tCancels
Ctrl-BreaksControl-sCtrl-RR>s><R
RR(RRRRtsub(RRVRR((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyRos"
cCsF|j}|jddd|jddd|jddddS(	Nttcl_wordBreakAftersa biRt
tcl_wordcharss[a-zA-Z0-9_]ttcl_nonwordcharss
[^a-zA-Z0-9_](RbRc(RRb((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyt
fixwordbreakss	cCst}t||jtjdr:tjd}nd}td|d|}|j|j|j	j
d|j|j|j
dS(NiRR,s<<close-all-windows>>(tTkRRIRtargvRRPRtquitReRDRtmainloopRE(RR,R,((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyttests	



t__main__(*RR&RRRRRRmtidlelib.MultiCallRRRRRRRRtidlelib.configHandlerRR	R
RRR8RRR2tobjectR3RhRPRIRJRRR|R<RRRRR#(((s,/usr/lib64/python2.7/idlelib/EditorWindow.pyt<module>sX
	!(			
2		
				

OHA YOOOO