AlkantarClanX12

Your IP : 3.21.159.223


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

�
��fz#c@s�dZddlZddlZddlZddlmZejejdZe	dd�\Z
Zddlm
Z
ddlmZddlZejZejr�eej7ZnGd	d
�d
�ZdS(u�AutoComplete.py - An IDLE extension for automatically completing names.

This extension can complete either attribute names of file names. It can pop
a window with all available names, for the user to select from.
iN(uidleConfu_ii(uAutoCompleteWindow(uHyperParsercBs�|EeZdZdd!gfgZejddddddd	�Zd d
d�Zdd
�Z	d dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zd dd�Zdd�Zdd�Zd S("uAutoCompleteuedituShow Completionsu<<force-open-completions>>u
extensionsu	popupwaitutypeuintudefaulticCsD||_|dkrdS|j|_d|_d|_d|_dS(N(ueditwinuNoneutextuautocompletewindowu_delayed_completion_idu_delayed_completion_index(uselfueditwin((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu__init__&s			uAutoComplete.__init__cCstj|j�S(N(uAutoCompleteWindowutext(uself((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu_make_autocomplete_window3su&AutoComplete._make_autocomplete_windowcCs&|jr"|jj�d|_ndS(N(uautocompletewindowuhide_windowuNone(uselfuevent((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu_remove_autocomplete_window6s	
u(AutoComplete._remove_autocomplete_windowcCs|jddd�dS(uqHappens when the user really wants to open a completion list, even
        if a function call is needed.
        NTF(uopen_completionsuTrueuFalse(uselfuevent((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyuforce_open_completions_event;su)AutoComplete.force_open_completions_eventcCs`|jjd�}|dkr7|jdddt�n%|tkr\|jdddt�ndS(u�Happens when it would be nice to open a completion list, but not
        really necessary, for example after an dot, so function
        calls won't be made.
        u	insert-1cu.NF(utextugetu_open_completions_lateruFalseuCOMPLETE_ATTRIBUTESuSEPSuCOMPLETE_FILES(uselfueventulastchar((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyutry_open_completions_eventAs
u'AutoComplete.try_open_completions_eventcCsht|d�r|jrdS|jrE|jj�rE|jj�dS|jddd�}|rddSdS(u�Happens when the user wants to complete his word, and if necessary,
        open a completion list after that (if there is more than one
        completion)
        umc_stateNubreakFT(uhasattrumc_stateuautocompletewindowu	is_activeucompleteuopen_completionsuFalseuTrue(uselfueventuopened((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyuautocomplete_eventNs
uAutoComplete.autocomplete_eventcGs_|jjd�|_|jdk	r:|jj|j�n|jj|j|j|�|_dS(Nuinsert(	utextuindexu_delayed_completion_indexu_delayed_completion_iduNoneuafter_canceluafteru	popupwaitu_delayed_open_completions(uselfuargs((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu_open_completions_later^s
u$AutoComplete._open_completions_latercGs9d|_|jjd�|jkr(dS|j|�dS(Nuinsert(uNoneu_delayed_completion_idutextuindexu_delayed_completion_indexuopen_completions(uselfuargs((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu_delayed_open_completionsfs	u&AutoComplete._delayed_open_completionscCs�|jd	k	r.|jj|j�d	|_nt|jd�}|jjdd�}t|�}}|j�r|s�|t	kr|j
�t	}x,|r�||ddtkr�|d8}q�W|||�}	|}x(|r||ddkr|d8}q�W|||�}
n|j�r|s6|t
kr|j
�t
}xB|r�||dtks}t||d�dkr�|d8}qIW|||�}	|r
||ddkr
|jdt|�|d�|j�}
|
s|r|
jd�dkrd	Sqd
}
nd	S|r/|
r/|	r/d	S|j|
|�}|dsOd	S|j�|_|jj|dt|	�|||�S(
uXFind the completions and create the AutoCompleteWindow.
        Return True if successful (no syntax error or so found).
        if complete is True, then if there's nothing to complete and no
        start of completion, won't open completions and return False.
        If mode is given, will open a completion list only in this mode.
        uinsertuinsert linestartiu'"iu.u
insert-%dcu(Nuii����(u_delayed_completion_iduNoneutextuafter_canceluHyperParserueditwinugetulenuis_in_stringuCOMPLETE_FILESu_remove_autocomplete_windowuSEPSu
is_in_codeuCOMPLETE_ATTRIBUTESuID_CHARSuordu	set_indexuget_expressionufindufetch_completionsu_make_autocomplete_windowuautocompletewindowushow_window(uselfu	evalfuncsucompleteuuserWantsWinumodeuhpucurlineuiuju
comp_startu	comp_whatu
comp_lists((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyuopen_completionslsN
!
7	
	uAutoComplete.open_completionsc	Cs�y|jjjjj}Wnd}YnX|rL|jdd||fi�S|tkrK|dkr�tj	j
�}|jtjj	�t
d|�}|j�d|kr�tt
d|��}qHdd�|D�}q�yZ|j|�}t|�}|j�d|krt|j�}ndd�|D�}Wq�ggfSYq�Xn�|tkr�|dkrld	}nyBtjj|�}tj|�}|j�d
d�|D�}Wq�tk
r�ggfSYq�Xn|s�|}n||fSdS(uOReturn a pair of lists of completions for something. The first list
        is a sublist of the second. Both are sorted.

        If there is a Python subprocess, get the comp. list there.  Otherwise,
        either fetch_completions() is running in the subprocess itself or it
        was called in an IDLE EditorWindow before any script had been run.

        The subprocess environment is that of the most recently run script.  If
        two unrelated modules are being edited some calltips in the current
        module may be inoperative if the module was not the last to run.
        uexecuget_the_completion_listuudir()u__all__cSs,g|]"}|dd�dkr|�qS(Niu_((u.0us((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu
<listcomp>�s	u2AutoComplete.fetch_completions.<locals>.<listcomp>cSs,g|]"}|dd�dkr|�qS(Niu_((u.0us((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu
<listcomp>�s	u.cSs,g|]"}|dd�dkr|�qS(Niu.((u.0us((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu
<listcomp>�s	N(ueditwinuflistupyshelluinterpurpccltuNoneu
remotecalluCOMPLETE_ATTRIBUTESu__main__u__dict__ucopyuupdateu__builtins__uevalusortusortedu
get_entityudiru__all__uCOMPLETE_FILESuosupathu
expanduserulistdiruOSError(	uselfuwhatumodeurpccltu	namespaceubiglusmallluentityuexpandedpath((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyufetch_completions�sL

	

	uAutoComplete.fetch_completionscCs,tjj�}|jtj�t||�S(uALookup name in a namespace spanning sys.modules and __main.dict__(usysumodulesucopyuupdateu__main__u__dict__ueval(uselfunameu	namespace((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu
get_entity�suAutoComplete.get_entityN(uShow Completionsu<<force-open-completions>>(u__name__u
__module__u__qualname__umenudefsuidleConfu	GetOptionu	popupwaituNoneu__init__u_make_autocomplete_windowu_remove_autocomplete_windowuforce_open_completions_eventutry_open_completions_eventuautocomplete_eventu_open_completions_lateru_delayed_open_completionsuopen_completionsufetch_completionsu
get_entity(u
__locals__((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyuAutoCompletes

;9uAutoCompletei(u__doc__uosusysustringuidlelib.configHandleruidleConfu
ascii_lettersudigitsuID_CHARSurangeuCOMPLETE_ATTRIBUTESuCOMPLETE_FILESuidlelibuAutoCompleteWindowuidlelib.HyperParseruHyperParseru__main__usepuSEPSualtsepuAutoComplete(((u9/opt/alt/python33/lib64/python3.3/idlelib/AutoComplete.pyu<module>s