%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python2.7/idlelib/
Upload File :
Create Path :
Current File : //usr/local/lib/python2.7/idlelib/AutoCompleteWindow.pyc

ó
Pêáac
@sƒdZddlTddlmZddlmZmZdZdZdZ	dZ
dZdZdZ
dZdZddd„ƒYZdS(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>tAutoCompleteWindowcBseZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z	d„Z
d	„Zd
„Zd„Z
d„Zd
„Zd„ZRS(cCs¨||_d|_|_|_d|_|_d|_d|_d|_	d|_
d|_d|_d|_
d|_|_|_|_|_|_t|_dS(N(twidgettNonetautocompletewindowtlistboxt	scrollbartorigselforegroundtorigselbackgroundtcompletionstmorecompletionstmodetstartt
startindextlasttypedstarttuserwantswindowthideidt
keypressidtlistupdateidtwinconfigidtkeyreleaseidt
doubleclickidtFalsetlastkey_was_tab(tselfR((s6/usr/local/lib/python2.7/idlelib/AutoCompleteWindow.pyt__init__s								,cCsìtt|jƒt|ƒƒ}d}x1||krW|j|||krW|d7}q'W|t|jƒkr¦|jjd|j|fd|jt|jƒfƒn|t|ƒkrß|jjd|j|f||ƒn||_dS(Niis%s+%dc(tmintlenRRtdeleteRtinsert(Rtnewstarttmin_lenti((s6/usr/local/lib/python2.7/idlelib/AutoCompleteWindow.pyt
_change_start8s& cCsvd}t|jƒ}xD||kr[||d}|j||krN|}q|d}qWt|t|jƒdƒS(s’Find 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((s6/usr/local/lib/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}qÿW|| S(sÖAssuming 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"((s6/usr/local/lib/python2.7/idlelib/AutoCompleteWindow.pyt_complete_stringRs(
	


#cCsÁt|jjƒdƒ}|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|jjdƒd|jjdƒƒ|jr½|j|_d|_|jjdtƒx$|jD]}|jjt|ƒqwW|jj|j|j
ƒƒ|jƒndS(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((s6/usr/local/lib/python2.7/idlelib/AutoCompleteWindow.pyR9qs2	
	#

#
		cCsT|\|_|_||_|jj|ƒ|_|jj|jdƒ|_|râ|j|jƒ}|j}|j	|ƒ|j
|ƒ}|j||krâ|t|jƒdksÕ|j|dt|ƒ |krâ||kSn||_|j|_
t|jƒ|_}	|	jdƒ|	jdƒy#|	jjdd|	jddƒWntk
r]nXt|	dtƒ|_}
t|	d	|
jd
tddƒ|_}x!|jD]}|jt|ƒq©W|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|
ƒq½W|jj-t7|j8ƒ|_9|jj2t7t:ƒ|j-t;|j<ƒ|_=|	j-t>|j?ƒ|_@|j-tA|jBƒ|_CdS(s¤Show 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((s6/usr/local/lib/python2.7/idlelib/AutoCompleteWindow.pytshow_window•sh		
!
	






		cCs
|jƒsdS|j}|j|jƒ|j|jƒ\}}}}|j}|jƒ|jƒ}}	|jƒ|jƒ}
}|jƒt	|t
d|
|ƒƒ}|jƒ|}
||||	ksØ||	krå|
|7}
n
|
|	8}
|jd||
fƒdS(Nis+%d+%d(
t	is_activeRR4RtbboxRtwinfo_widthtwinfo_heighttwinfo_rootxRtmaxtwinfo_rootyRL(RteventttexttxtytcxtcyRtt	acw_widtht
acw_heightt
text_widthttext_heighttnew_xtnew_y((s6/usr/local/lib/python2.7/idlelib/AutoCompleteWindow.pyRmÛs		&

cCs|jƒsdS|jƒdS(N(Rwthide_window(RR~((s6/usr/local/lib/python2.7/idlelib/AutoCompleteWindow.pyRaðscCsJ|jƒsdSt|_t|jjƒdƒ}|j|j|ƒdS(Ni(RwR]RR2RR3R$R(RR~R:((s6/usr/local/lib/python2.7/idlelib/AutoCompleteWindow.pyRkõs
	cCs;t|jjƒdƒ}|j|j|ƒ|jƒdS(Ni(R2RR3R$RRŠ(RR~R:((s6/usr/local/lib/python2.7/idlelib/AutoCompleteWindow.pyRoüscsÃ|jƒsdS|j‰t|dƒr4|j}nd}ˆdkrRt|_ntˆƒdks‹ˆd%ks‹|jtkr¼ˆd&kr¼|t	@r¼tˆƒdkrÀ|j
|jˆƒn ˆdkrã|j
|jd	ƒn}ˆdkr|j
|jd
ƒnZˆdkr)|j
|jdƒn7t|jƒdkrL|jƒdS|j
|jd ƒ|j|_
|jjdt|jjƒdƒƒ|jj|j|jƒƒ|jƒd
SˆdkrÖ|jƒdS|jtkrñˆd'ks|jtkr‘ˆd(kr‘|t	@r‘t|jjƒdƒ}|j|t|jƒ |jkrƒ|jtksl|jrƒ|j
|j|ƒn|jƒdSˆd)kr!|r!t|_t|jjƒdƒ}ˆdkrÛd}nˆdkrýt|jƒd}nâˆd*kr‹|jj|jjƒƒ|jjdƒ}ˆdkrVtd||ƒ}q߈dksht‚tt|jƒd||ƒ}nTˆdkr­td|dƒ}n2ˆdks¿t‚tt|jƒd|dƒ}|jj|ƒ|jj|ƒ|jƒ|j
|j|ƒd
Sˆdkr‘|r‘|jrxt|jjƒdƒ}|j
|j|ƒ|jƒd
St|_t|_dSn.t‡fd†d+Dƒƒr±dS|jƒdSdS(,Ntmc_stateitTabit
underscoret	BackSpacetperiodtminust_t.t-iÿÿÿÿtbreaktReturntspacet	parenleftt
parenrighttbracketlefttbracketrighttslasht	backslashtquotedblt
apostrophetHometEndtPriortNexttUptDownc3s|]}|ˆkVqdS(N((t.0R%(tkeysym(s6/usr/local/lib/python2.7/idlelib/AutoCompleteWindow.pys	<genexpr>bstShifttControltAlttMetatCommandtOption(RRŽ(RR(RR–R—R˜R™Rš(R›RœRRž(RŸR R¡R¢R£R¤(R¡R¢(R§R¨R©RªR«R¬(RwR¦thasattrR‹RRRRRRR$RRŠRRtselect_clearR2R3R8R(R9RRR]RtnearestRzR|tAssertionErrorRtany(RR~tstateR:tnewseltjump((R¦s6/usr/local/lib/python2.7/idlelib/AutoCompleteWindow.pyRes¤		
&

		#
		# 
	
		

cCs[|jƒsdS|jjdƒ|jjd|jt|jƒfƒkrW|jƒndS(NR s%s+%dc(RwRRIRRRRŠ(RR~((s6/usr/local/lib/python2.7/idlelib/AutoCompleteWindow.pyRhls
+cCs
|jdk	S(N(RR(R((s6/usr/local/lib/python2.7/idlelib/AutoCompleteWindow.pyRwtscCs|j|j|jƒƒdS(N(R$R-R(R((s6/usr/local/lib/python2.7/idlelib/AutoCompleteWindow.pyRqwscCsL|jƒsdSx!tD]}|jjt|ƒqW|jjt|jƒd|_x!tD]}|jjt	|ƒqZW|jjt	|j
ƒd|_
|jjttƒ|jjt|j
ƒd|_
|jjt|jƒd|_|jjt|jƒd|_|jjƒd|_|jjƒd|_|jjƒd|_dS(N(RwRbRtevent_deleteR`tunbindRRRfRdRRgRiRRRjRRRlRR	tdestroy(RRu((s6/usr/local/lib/python2.7/idlelib/AutoCompleteWindow.pyRŠ{s0
	
				
	
	
(t__name__t
__module__RR$R(R-R9RvRmRaRkRoReRhRwRqRŠ(((s6/usr/local/lib/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(((s6/usr/local/lib/python2.7/idlelib/AutoCompleteWindow.pyt<module>s


Zerion Mini Shell 1.0