AlkantarClanX12

Your IP : 3.138.32.53


Current Path : /proc/thread-self/root/lib64/python2.7/idlelib/
Upload File :
Current File : //proc/thread-self/root/lib64/python2.7/idlelib/AutoComplete.pyc

�
{fc@sdZddlZddlZddlZddlmZejejejdZ	ejejdZ
edd�\ZZ
ddlmZdd	lmZddlZejZejr�eej7Znd
dd��YZedkrdd
lmZeddd�ndS(s�AutoComplete.py - An IDLE extension for automatically completing names.

This extension can complete either attribute names or file names. It can pop
a window with all available names, for the user to select from.
i����N(tidleConfs._~#$:-t_ii(tAutoCompleteWindow(tHyperParsertAutoCompletecBs�eZddgfgZejddddddd	�Zdd
�Zd�Zdd�Z	d
�Z
d�Zd�Zd�Z
d�Zdd�Zd�Zd�ZRS(teditsShow Completionss<<force-open-completions>>t
extensionsRt	popupwaitttypetinttdefaulticCsD||_|dkrdS|j|_d|_d|_d|_dS(N(teditwintNonettexttautocompletewindowt_delayed_completion_idt_delayed_completion_index(tselfR((s,/usr/lib64/python2.7/idlelib/AutoComplete.pyt__init__)s			cCstj|j�S(N(RR
(R((s,/usr/lib64/python2.7/idlelib/AutoComplete.pyt_make_autocomplete_window6scCs&|jr"|jj�d|_ndS(N(Rthide_windowR(Rtevent((s,/usr/lib64/python2.7/idlelib/AutoComplete.pyt_remove_autocomplete_window9s	
cCs|jttt�dS(sqHappens when the user really wants to open a completion list, even
        if a function call is needed.
        N(topen_completionstTruetFalse(RR((s,/usr/lib64/python2.7/idlelib/AutoComplete.pytforce_open_completions_event>scCs`|jjd�}|dkr7|jtttt�n%|tkr\|jtttt�ndS(s�Happens when it would be nice to open a completion list, but not
        really necessary, for example after a dot, so function
        calls won't be made.
        s	insert-1ct.N(R
tgett_open_completions_laterRtCOMPLETE_ATTRIBUTEStSEPStCOMPLETE_FILES(RRtlastchar((s,/usr/lib64/python2.7/idlelib/AutoComplete.pyttry_open_completions_eventDs
cCsht|d�r|jrdS|jrE|jj�rE|jj�dS|jttt�}|rddSdS(s�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)
        tmc_stateNtbreak(thasattrR#Rt	is_activetcompleteRRR(RRtopened((s,/usr/lib64/python2.7/idlelib/AutoComplete.pytautocomplete_eventQs
cGs_|jjd�|_|jdk	r:|jj|j�n|jj|j|j|�|_dS(Ntinsert(	R
tindexRRRtafter_canceltafterRt_delayed_open_completions(Rtargs((s,/usr/lib64/python2.7/idlelib/AutoComplete.pyRas
cGs9d|_|jjd�|jkr(dS|j|�dS(NR*(RRR
R+RR(RR/((s,/usr/lib64/python2.7/idlelib/AutoComplete.pyR.is	cCsb|jdk	r.|jj|j�d|_nt|jd�}|jjdd�}t|�}}|j�r|s�|t	kr|j
�t	}x(|r�||dtkr�|d8}q�W|||!}	|}x,|r||dttkr|d8}q�W|||!}
n�|j
�r�|s0|tkr�|j
�t}x(|rj||dtkrj|d8}qCW|||!}	|r�||ddkr�|jdt|�|d�|j�}
|
s�|r�|
jd�dkr�dSq�d	}
ndS|r|
r|	rdS|j|
|�}|d
s,dS|j�|_|jj|dt|	�|||�S(sXFind 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.
        R*sinsert linestartiRs
insert-%dct(i����Nti(RRR
R,RRRtlentis_in_stringR RtFILENAME_CHARSRt
is_in_codeRtID_CHARSt	set_indextget_expressiontfindtfetch_completionsRRtshow_window(Rt	evalfuncsR'tuserWantsWintmodethptcurlinetitjt
comp_startt	comp_whatt
comp_lists((s,/usr/lib64/python2.7/idlelib/AutoComplete.pyRosN

!

	
	c
Cs&y|jjjjj}Wn
d	}nX|rK|jdd||fi�S|tkrr|dkr�tj	j
�}|jtjj	�t
d|�}|j�d|kr�tt
d|��}qog|D]}|d dkr�|^q�}q	yp|j|�}t|�}|j�d|kr4t|j�}n)g|D]}|d dkr;|^q;}Wq	ggfSXn�|tkr	|dkr�d}nyXtjj|�}	tj|	�}|j�g|D]}|d dkr�|^q�}Wq	tk
rggfSXn|s|}n||fSd	S(
sOReturn 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.
        texectget_the_completion_listR1sdir()t__all__iRRN(RtflisttpyshelltinterptrpccltRt
remotecallRt__main__t__dict__tcopytupdatet__builtins__tevaltsorttsortedt
get_entitytdirRHR tostpatht
expandusertlistdirtOSError(
RtwhatR>RLt	namespacetbigltsmallltstentitytexpandedpath((s,/usr/lib64/python2.7/idlelib/AutoComplete.pyR:�sL

,
-	
-
	cCs,tjj�}|jtj�t||�S(sALookup name in a namespace spanning sys.modules and __main.dict__(tsystmodulesRPRQRNRORS(RtnameR^((s,/usr/lib64/python2.7/idlelib/AutoComplete.pyRV�s(sShow Completionss<<force-open-completions>>N(t__name__t
__module__tmenudefsRt	GetOptionRRRRRRR"R)RR.RR:RV(((s,/usr/lib64/python2.7/idlelib/AutoComplete.pyRs
			
			4	9RN(tmains#idlelib.idle_test.test_autocompletet	verbosityi((t__doc__RXRdtstringtidlelib.configHandlerRt
ascii_letterstdigitstcurdirR4R6trangeRR tidlelibRtidlelib.HyperParserRRNtsepRtaltsepRRgtunittestRk(((s,/usr/lib64/python2.7/idlelib/AutoComplete.pyt<module>s"		�