Hacked By AnonymousFox

Current Path : /opt/alt/python33/lib64/python3.3/idlelib/__pycache__/
Upload File :
Current File : //opt/alt/python33/lib64/python3.3/idlelib/__pycache__/AutoCompleteWindow.cpython-33.pyo

�
��fEc
@s�dZddlTddlmZddlmZmZdZdZdZ	dZ
dZdZdZ
dZdZGdd�d�ZdS(uH
An auto-completion window for IDLE, used by the AutoComplete extension
i(u*(uMC_SHIFT(uCOMPLETE_FILESuCOMPLETE_ATTRIBUTESu<<autocompletewindow-hide>>u
<FocusOut>u
<ButtonPress>u<<autocompletewindow-keypress>>u<Key>u<Key-BackSpace>u<Key-Return>u	<Key-Tab>u<Key-Up>u
<Key-Down>u
<Key-Home>u	<Key-End>u<Key-Prior>u
<Key-Next>u!<<autocompletewindow-keyrelease>>u<KeyRelease>u<B1-ButtonRelease>u<Configure>u<B1-Double-ButtonRelease>cBs�|EeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�ZdS( uAutoCompleteWindowcCs�||_d|_|_|_d|_|_d|_d|_d|_	d|_
d|_d|_d|_
d|_|_|_|_|_|_d|_dS(NF(uwidgetuNoneuautocompletewindowulistboxu	scrollbaruorigselforegrounduorigselbackgrounducompletionsumorecompletionsumodeustartu
startindexulasttypedstartuuserwantswindowuhideidu
keypressidulistupdateiduwinconfigidukeyreleaseidu
doubleclickiduFalseulastkey_was_tab(uselfuwidget((u?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyu__init__s								,uAutoCompleteWindow.__init__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||d��n||_dS(Niiu%s+%dc(uminulenustartuwidgetudeleteu
startindexuinsert(uselfunewstartumin_lenui((u?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyu
_change_start8s& u AutoCompleteWindow._change_startcCsvd}t|j�}xD||kr[||d}|j||krN|}q|d}qWt|t|j�d�S(u�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(ulenucompletionsumin(uselfusuiujum((u?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyu_binary_searchEs	u!AutoCompleteWindow._binary_searchc
CsG|j|�}|j|dt|��|kr6|S|d}t|j�}xT||kr�||d}|j|dt|��|kr�|}qR|d}qRW|d}||kr�|j|S|j|}|j|}tt|�t|��}	t|�}x.||	kr8||||kr8|d7}qW|d|�S(u�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.Nii(u_binary_searchucompletionsulenumin(
uselfusufirstuiujumulastu
first_compu	last_compumin_len((u?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyu_complete_stringRs(#
#	


#u#AutoCompleteWindow._complete_stringcCs�t|jj�d�}|jj|�|j}|j|}|j|�|kr]|}nbtt|�t|��}d}x.||kr�||||kr�|d7}q�W|d|�}|j	|�|j|dt|j
��|j
kr|jjd|jd|j
�n�|jjd|jjd�d|jjd��|jr�|j|_d|_|jjdt�x$|jD]}|jjt|�q�W|jj|j|j
��|j�ndS(u|Should be called when the selection of the Listbox has changed.
        Updates the Listbox display and calls _change_start.iiNuselectbackgrounduselectforegroundubgufg(uintulistboxucurselectionuseeulasttypedstartucompletionsu_binary_searchuminulenu
_change_startustartu	configureuorigselbackgrounduorigselforegrounducgetumorecompletionsuNoneudeleteuENDuinsertu
select_setu_selection_changed(uselfucurselultsuselstartunewstartumin_lenuiuitem((u?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyu_selection_changedqs2	
	#
)
		u%AutoCompleteWindow._selection_changedcCsQ|\|_|_||_|jj|�|_|jj|jd�|_|r�|j|j�}|j}|j	|�|j
|�}|j||kr�|t|j�dks�|j|ddt|��|kr�||kSn||_|j|_
t|j�|_}	|	jd�|	jd�y#|	jjdd|	jdd�Wntk
rdYnXt|	d	t�|_}
t|	d
|
jdddd
�|_}x!|jD]}|jt|�q�W|jd�|_ |jd�|_!|
j"d|j#�|
j$dt%dt&�|j$dt'dt(dd�|jj*|j
|j��|j+�|jj,t-|j.�|_/x!t0D]}
|jj1t-|
�q{W|jj,t2|j3�|_4x!t5D]}
|jj1t2|
�q�W|jj,t6|j7�|_8|jj1t6t9�|j,t:|j;�|_<|	j,t=|j>�|_?|j,t@|jA�|_BdS(u�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.uinsertiNu+10000+10000u!::tk::unsupported::MacWindowStyleustyleuhelpunoActivatesuorientuyscrollcommanduexportselectionubguwhiteuselectforegrounduselectbackgrounducommandusideufilluexpandFT(Cucompletionsumorecompletionsumodeuwidgetuindexu
startindexugetustartu_complete_stringu
_change_startu_binary_searchulenuuserwantswindowulasttypedstartuTopleveluautocompletewindowuwm_geometryuwm_overrideredirectutkucallu_wuTclErroru	ScrollbaruVERTICALu	scrollbaruListboxusetuFalseulistboxuinsertuENDucgetuorigselforegrounduorigselbackgrounduconfiguyviewupackuRIGHTuYuLEFTuBOTHuTrueu
select_setu_selection_changedubinduHIDE_VIRTUAL_EVENT_NAMEu
hide_eventuhideiduHIDE_SEQUENCESu	event_adduKEYPRESS_VIRTUAL_EVENT_NAMEukeypress_eventu
keypressiduKEYPRESS_SEQUENCESuKEYRELEASE_VIRTUAL_EVENT_NAMEukeyrelease_eventukeyreleaseiduKEYRELEASE_SEQUENCEuLISTUPDATE_SEQUENCEulistselect_eventulistupdateiduWINCONFIG_SEQUENCEuwinconfig_eventuwinconfigiduDOUBLECLICK_SEQUENCEudoubleclick_eventu
doubleclickid(uselfu
comp_listsuindexucompleteumodeuuserWantsWinu	completedustartuiuacwu	scrollbarulistboxuitemuseq((u?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyushow_window�sf		
'
	





		uAutoCompleteWindow.show_windowcCs
|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(Niu+%d+%d(
u	is_activeuwidgetuseeu
startindexubboxuautocompletewindowuwinfo_widthuwinfo_heightuwinfo_rootxuminumaxuwinfo_rootyuwm_geometry(uselfueventutextuxuyucxucyuacwu	acw_widthu
acw_heightu
text_widthutext_heightunew_xunew_y((u?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyuwinconfig_event�s		&

u"AutoCompleteWindow.winconfig_eventcCs|j�sdS|j�dS(N(u	is_activeuhide_window(uselfuevent((u?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyu
hide_event�suAutoCompleteWindow.hide_eventcCsJ|j�sdSd|_t|jj�d�}|j|j|�dS(NiT(u	is_activeuTrueuuserwantswindowuintulistboxucurselectionu
_change_startucompletions(uselfueventucursel((u?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyulistselect_event�s
	u#AutoCompleteWindow.listselect_eventcCs;t|jj�d�}|j|j|�|j�dS(Ni(uintulistboxucurselectionu
_change_startucompletionsuhide_window(uselfueventucursel((u?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyudoubleclick_event�su$AutoCompleteWindow.doubleclick_eventcs9|j�sdS|j�t|d�r4|j}nd}�dkrRd&|_nt��dks��d'ks�|jtkr��d(kr�|t	@r�t��dkr�|j
|j��n��dkr�|j
|jd	�n��dkr|j
|jd
�n`�dkr)|j
|jd�n=t|j�dkrL|j�dS|j
|jdd)��|j|_
|jjdt|jj�d��|jj|j|j��|j�dS�d
kr�|j�dS|jtkr��d*ks|jtkr��d+kr�|t	@r�t|jj�d�}|j|dt|j��|jkr�|jtksx|jr�|j
|j|�n|j�dS�d,kr	|r	d-|_t|jj�d�}�dkr�d}n��dkr	t|j�d}n��d.kr�|jj|jj��|jjd�}�dkrbtd||�}q�tt|j�d||�}nB�dkr�td|d�}n tt|j�d|d�}|jj|�|jj|�|j�|j
|j|�dS�dkry|ry|jr`t|jj�d�}|j
|j|�|j�dSd-|_d-|_dSn�t�fdd�d/D��r�dS|jr'|jd%kr'|j
|j|j�|j|_
|jjdt|jj�d��|jj|j|j��|j�dS|j�dSdS(0Numc_stateiuTabiu
underscoreu	BackSpaceuperioduminusu_u.u-ubreakuReturnuspaceu	parenleftu
parenrightubracketleftubracketrightuslashu	backslashuquotedblu
apostropheuHomeuEnduPrioruNextuUpuDownc3s|]}|�kVqdS(N((u.0us(ukeysym(u?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyu	<genexpr>asu4AutoCompleteWindow.keypress_event.<locals>.<genexpr>uShiftuControluAltuMetauCommanduOptionu F(u
underscoreu	BackSpace(uperioduminusi����(uperioduspaceu	parenleftu
parenrightubracketleftubracketright(uslashu	backslashuquotedblu
apostrophe(uHomeuEnduPrioruNextuUpuDownT(uPrioruNext(uShiftuControluAltuMetauCommanduOption(u	is_activeukeysymuhasattrumc_stateuFalseulastkey_was_tabulenumodeuCOMPLETE_FILESuMC_SHIFTu
_change_startustartuhide_windowulasttypedstartulistboxuselect_clearuintucurselectionu
select_setu_binary_searchu_selection_changeduCOMPLETE_ATTRIBUTESucompletionsuTrueuuserwantswindowunearestuwinfo_heightumaxuminuanyuchar(uselfueventustateucurselunewselujump((ukeysymu?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyukeypress_events�		
&

		)
		# 
	
		
&

u!AutoCompleteWindow.keypress_eventcCs[|j�sdS|jjd�|jjd|jt|j�f�krW|j�ndS(Nuinsertu%s+%dc(u	is_activeuwidgetuindexu
startindexulenustartuhide_window(uselfuevent((u?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyukeyrelease_eventts
+u#AutoCompleteWindow.keyrelease_eventcCs
|jdk	S(N(uautocompletewindowuNone(uself((u?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyu	is_active|suAutoCompleteWindow.is_activecCs|j|j|j��dS(N(u
_change_startu_complete_stringustart(uself((u?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyucompletesuAutoCompleteWindow.completecCsL|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(u	is_activeuHIDE_SEQUENCESuwidgetuevent_deleteuHIDE_VIRTUAL_EVENT_NAMEuunbinduhideiduNoneuKEYPRESS_SEQUENCESuKEYPRESS_VIRTUAL_EVENT_NAMEu
keypressiduKEYRELEASE_VIRTUAL_EVENT_NAMEuKEYRELEASE_SEQUENCEukeyreleaseidulistboxuLISTUPDATE_SEQUENCEulistupdateiduautocompletewindowuWINCONFIG_SEQUENCEuwinconfigidu	scrollbarudestroy(uselfuseq((u?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyuhide_window�s0
	
				
	
	
uAutoCompleteWindow.hide_windowN(u__name__u
__module__u__qualname__u__init__u
_change_startu_binary_searchu_complete_stringu_selection_changedushow_windowuwinconfig_eventu
hide_eventulistselect_eventudoubleclick_eventukeypress_eventukeyrelease_eventu	is_activeucompleteuhide_window(u
__locals__((u?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyuAutoCompleteWindows 

$EsuAutoCompleteWindowN(u
<FocusOut>u
<ButtonPress>(
u<Key>u<Key-BackSpace>u<Key-Return>u	<Key-Tab>u<Key-Up>u
<Key-Down>u
<Key-Home>u	<Key-End>u<Key-Prior>u
<Key-Next>(u__doc__utkinteruidlelib.MultiCalluMC_SHIFTuidlelib.AutoCompleteuCOMPLETE_FILESuCOMPLETE_ATTRIBUTESuHIDE_VIRTUAL_EVENT_NAMEuHIDE_SEQUENCESuKEYPRESS_VIRTUAL_EVENT_NAMEuKEYPRESS_SEQUENCESuKEYRELEASE_VIRTUAL_EVENT_NAMEuKEYRELEASE_SEQUENCEuLISTUPDATE_SEQUENCEuWINCONFIG_SEQUENCEuDOUBLECLICK_SEQUENCEuAutoCompleteWindow(((u?/opt/alt/python33/lib64/python3.3/idlelib/AutoCompleteWindow.pyu<module>s


Hacked By AnonymousFox1.0, Coded By AnonymousFox