• File: AutoCompleteWindow.pyo
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/proc/self/root/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pyo
  • Date Modified: 10/26/2026 8:10 PM
  • File size: 12.36 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit

jc
@sdZddlTddlmZddlmZmZdZdZdZ	dZ
dZdZdZ
dZdZdddYZdS(sH
An auto-completion window for IDLE, used by the AutoComplete extension
i(t*(tMC_SHIFT(tCOMPLETE_FILEStCOMPLETE_ATTRIBUTESs<<autocompletewindow-hide>>s
<FocusOut>s
<ButtonPress>s<<autocompletewindow-keypress>>s<Key>s<Key-BackSpace>s<Key-Return>s	<Key-Tab>s<Key-Up>s
<Key-Down>s
<Key-Home>s	<Key-End>s<Key-Prior>s
<Key-Next>s!<<autocompletewindow-keyrelease>>s<KeyRelease>s<B1-ButtonRelease>s<Configure>s<B1-Double-ButtonRelease>tAutoCompleteWindowcBseZdZdZdZdZdZdZdZdZ	dZ
d	Zd
ZdZ
dZd
ZdZRS(cCs||_d|_|_|_d|_|_d|_d|_d|_	d|_
d|_d|_d|_
d|_|_|_|_|_|_t|_dS(N(twidgettNonetautocompletewindowtlistboxt	scrollbartorigselforegroundtorigselbackgroundtcompletionstmorecompletionstmodetstartt
startindextlasttypedstarttuserwantswindowthideidt
keypressidtlistupdateidtwinconfigidtkeyreleaseidt
doubleclickidtFalsetlastkey_was_tab(tselfR((s?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pyt__init__s								,cCstt|jt|}d}x1||krW|j|||krW|d7}q'W|t|jkr|jjd|j|fd|jt|jfn|t|kr|jjd|j|f||n||_dS(Niis%s+%dc(tmintlenRRtdeleteRtinsert(Rtnewstarttmin_lenti((s?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pyt
_change_start8s& cCsvd}t|j}xD||kr[||d}|j||krN|}q|d}qWt|t|jdS(sFind the first index in self.completions where completions[i] is
        greater or equal to s, or the last index if there is no such
        one.iii(RRR(RtsR#tjtm((s?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pyt_binary_searchEs	c
Cs5|j|}|j|t| |kr0|S|d}t|j}xN||kr||d}|j|t| |kr|}qL|d}qLW|d}||kr|j|S|j|}|j|}tt|t|}	t|}x.||	kr,||||kr,|d7}qW|| S(sAssuming that s is the prefix of a string in self.completions,
        return the longest string which is a prefix of all the strings which
        s is a prefix of them. If s is not a prefix of a string, return s.ii(R(RRR(
RR%tfirstR#R&R'tlastt
first_compt	last_compR"((s?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pyt_complete_stringRs(
	


#cCst|jjd}|jj||j}|j|}|j||kr]|}n\tt|t|}d}x.||kr||||kr|d7}qW|| }|j	||j|t|j
 |j
kr|jjd|jd|j
n|jjd|jjdd|jjd|jr|j|_d|_|jjdtx$|jD]}|jjt|qwW|jj|j|j
|jndS(s|Should be called when the selection of the Listbox has changed.
        Updates the Listbox display and calls _change_start.iitselectbackgroundtselectforegroundtbgtfgN(tintRtcurselectiontseeRRR(RRR$Rt	configureRR
tcgetR
RRtENDR t
select_sett_selection_changed(RtcurseltltstselstartR!R"R#titem((s?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pyR9qs2	
	#

#
		cCsT|\|_|_||_|jj||_|jj|jd|_|r|j|j}|j}|j	||j
|}|j||kr|t|jdks|j|dt| |kr||kSn||_|j|_
t|j|_}	|	jd|	jdy#|	jjdd|	jddWntk
r]nXt|	dt|_}
t|	d	|
jd
tdd|_}x!|jD]}|jt|qW|jd
|_ |jd|_!|
j"d|j#|
j$dt%dt&|j$dt'dt(dt)|	j*|jj+|j
|j|j,|jj-t.|j/|_0x!t1D]}
|jj2t.|
q~W|jj-t3|j4|_5x!t6D]}
|jj2t3|
qW|jj-t7|j8|_9|jj2t7t:|j-t;|j<|_=|	j-t>|j?|_@|j-tA|jB|_CdS(sShow the autocomplete list, bind events.
        If complete is True, complete the text, and if there is exactly one
        matching completion, don't open a list.R is+10000+10000s!::tk::unsupported::MacWindowStyletstylethelptnoActivatestorienttyscrollcommandtexportselectionR0twhiteR/R.tcommandtsidetfilltexpandN(DRR
RRtindexRtgetRR-R$R(RRRtToplevelRtwm_geometrytwm_overrideredirectttktcallt_wtTclErrort	ScrollbartVERTICALR	tListboxtsetRRR R7R6R
RtconfigtyviewtpacktRIGHTtYtLEFTtBOTHtTruetliftR8R9tbindtHIDE_VIRTUAL_EVENT_NAMEt
hide_eventRtHIDE_SEQUENCESt	event_addtKEYPRESS_VIRTUAL_EVENT_NAMEtkeypress_eventRtKEYPRESS_SEQUENCEStKEYRELEASE_VIRTUAL_EVENT_NAMEtkeyrelease_eventRtKEYRELEASE_SEQUENCEtLISTUPDATE_SEQUENCEtlistselect_eventRtWINCONFIG_SEQUENCEtwinconfig_eventRtDOUBLECLICK_SEQUENCEtdoubleclick_eventR(Rt
comp_listsRItcompleteRtuserWantsWint	completedRR#tacwR	RR=tseq((s?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pytshow_windowsh		
!
	






		cCs
|jsdS|j}|j|j|j|j\}}}}|j}|j|j}}	|j|j}
}|jt	|t
d|
|}|j|}
||||	ks||	kr|
|7}
n
|
|	8}
|jd||
fdS(Nis+%d+%d(
t	is_activeRR4RtbboxRtwinfo_widthtwinfo_heighttwinfo_rootxRtmaxtwinfo_rootyRL(RteventttexttxtytcxtcyRtt	acw_widtht
acw_heightt
text_widthttext_heighttnew_xtnew_y((s?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pyRms		&

cCs|jsdS|jdS(N(Rwthide_window(RR~((s?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pyRascCsJ|jsdSt|_t|jjd}|j|j|dS(Ni(RwR]RR2RR3R$R(RR~R:((s?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pyRks
	cCs;t|jjd}|j|j||jdS(Ni(R2RR3R$RR(RR~R:((s?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pyRoscs|jsdS|jt|dr4|j}nd}dkrRt|_ntdksd%ks|jtkrd&kr|t	@rtdkr|j
|jndkr|j
|jd	n}dkr|j
|jd
nZdkr)|j
|jdn7t|jdkrL|jdS|j
|jd |j|_
|jjdt|jjd|jj|j|j|jd
Sdkr|jdS|jtkrd'ks|jtkrd(kr|t	@rt|jjd}|j|t|j |jkr|jtksl|jr|j
|j|n|jdSd)kr|rt|_t|jjd}dkrd}ndkrt|jd}nd*kry|jj|jj|jjd}dkrVtd||}qtt|jd||}nBdkrtd|d}n tt|jd|d}|jj||jj||j|j
|j|d
Sdkrm|rm|jrTt|jjd}|j
|j||jd
St|_t|_dSn.tfdd+DrdS|jdSdS(,Ntmc_stateitTabit
underscoret	BackSpacetperiodtminust_t.t-itbreaktReturntspacet	parenleftt
parenrighttbracketlefttbracketrighttslasht	backslashtquotedblt
apostrophetHometEndtPriortNexttUptDownc3s|]}|kVqdS(N((t.0R%(tkeysym(s?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pys	<genexpr>bstShifttControltAlttMetatCommandtOption(RR(RR(RRRRRR(RRRR(RRRRRR(RR(RRRRRR(RwRthasattrRRRRRRRR$RRRRtselect_clearR2R3R8R(R9RRR]RtnearestRzR|Rtany(RR~tstateR:tnewseltjump((Rs?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pyRes		
&

		#
		# 
	
		

cCs[|jsdS|jjd|jjd|jt|jfkrW|jndS(NR s%s+%dc(RwRRIRRRR(RR~((s?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pyRhls
+cCs
|jdk	S(N(RR(R((s?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pyRwtscCs|j|j|jdS(N(R$R-R(R((s?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pyRqwscCsL|jsdSx!tD]}|jjt|qW|jjt|jd|_x!tD]}|jjt	|qZW|jjt	|j
d|_
|jjtt|jjt|j
d|_
|jjt|jd|_|jjt|jd|_|jjd|_|jjd|_|jjd|_dS(N(RwRbRtevent_deleteR`tunbindRRRfRdRRgRiRRRjRRRlRR	tdestroy(RRu((s?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pyR{s0
	
				
	
	
(t__name__t
__module__RR$R(R-R9RvRmRaRkRoReRhRwRqR(((s?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pyRs	 	
	
		$	F					j			N(s
<FocusOut>s
<ButtonPress>(
s<Key>s<Key-BackSpace>s<Key-Return>s	<Key-Tab>s<Key-Up>s
<Key-Down>s
<Key-Home>s	<Key-End>s<Key-Prior>s
<Key-Next>((t__doc__tTkintertidlelib.MultiCallRtidlelib.AutoCompleteRRR`RbRdRfRgRiRjRlRnR(((s?/opt/alt/python27/lib64/python2.7/idlelib/AutoCompleteWindow.pyt<module>s