File "AutoComplete.cpython-34.pyc"

Full Path: /home/attunedd/public_html/byp/izo/con7ext_sym404/rintoar.txt/opt/alt/python34/lib64/python3.4/idlelib/__pycache__/AutoComplete.cpython-34.pyc
File size: 7.53 KB
MIME-type: text/x-bytecode.python
Charset: 8 bit


e f#@sdZddlZddlZddlZddlmZejejdZe	dd\Z
Zddlm
Z
ddlmZddlZejZejreej7ZnGd	d
d
ZedkrddlmZed
ddndS)zAutoComplete.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.
N)idleConf_)AutoCompleteWindow)HyperParserc@seZdZdd!gfgZejddddddd	Zd
ddZd
dZd
ddZ	ddZ
ddZddZddZ
ddZd
ddZddZdd Zd
S)"AutoCompleteZeditShow Completions<<force-open-completions>>
extensions	popupwaittypeintdefaultrNcCsD||_|dkrdS|j|_d|_d|_d|_dS)N)editwintextautocompletewindow_delayed_completion_id_delayed_completion_index)selfrr9/opt/alt/python34/lib64/python3.4/idlelib/AutoComplete.py__init__&s			zAutoComplete.__init__cCstj|jS)N)rr)rrrr_make_autocomplete_window3sz&AutoComplete._make_autocomplete_windowcCs&|jr"|jjd|_ndS)N)rZhide_window)reventrrr_remove_autocomplete_window6s	
z(AutoComplete._remove_autocomplete_windowcCs|jddddS)zqHappens when the user really wants to open a completion list, even
        if a function call is needed.
        TFN)open_completions)rrrrrforce_open_completions_event;sz)AutoComplete.force_open_completions_eventcCs`|jjd}|dkr7|jdddtn%|tkr\|jdddtndS)zHappens 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.
        z	insert-1c.FN)rget_open_completions_laterCOMPLETE_ATTRIBUTESSEPSCOMPLETE_FILES)rrZlastcharrrrtry_open_completions_eventAs
z'AutoComplete.try_open_completions_eventcCsht|dr|jrdS|jrE|jjrE|jjdS|jddd}|rddSdS)zHappens when the user wants to complete his word, and if necessary,
        open a completion list after that (if there is more than one
        completion)
        mc_stateNbreakFT)hasattrr%rZ	is_activecompleter)rrZopenedrrrautocomplete_eventNs
zAutoComplete.autocomplete_eventcGs_|jjd|_|jdk	r:|jj|jn|jj|j|j||_dS)Ninsert)rindexrrafter_cancelafterr_delayed_open_completions)rargsrrrr ^s
z$AutoComplete._open_completions_latercGs9d|_|jjd|jkr(dS|j|dS)Nr*)rrr+rr)rr/rrrr.fs	z&AutoComplete._delayed_open_completionscCs|jdk	r.|jj|jd|_nt|jd}|jjdd}t|}}|jr|s|tkr|j	t}x,|r||ddt
kr|d8}qW|||}	|}x(|r||ddkr|d8}qW|||}
n|jr|s6|tkr|j	t}xB|r||dt
ks}t||ddkr|d8}qIW|||}	|r
||ddkr
|jdt||d|j}
|
s|r|
jd	dkrdSqd
}
ndS|r/|
r/|	r/dS|j|
|}|dsOdS|j|_|jj|dt|	|||S)
aXFind 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.
        Nr*zinsert linestartrz'"rz
insert-%dc(r)rrr,rrrlenZis_in_stringr#rr"Z
is_in_coder!ID_CHARSordZ	set_indexZget_expressionfindfetch_completionsrrZshow_window)rZ	evalfuncsr(ZuserWantsWinmodeZhpZcurlineijZ
comp_startZ	comp_whatZ
comp_listsrrrrlsN
!
7	
	zAutoComplete.open_completionsc	Csy|jjjjj}Wnd}YnX|rL|jdd||fiS|tkrK|dkrtjj	}|j
tjjtd|}|j
d|krttd|}qHdd|D}qyZ|j|}t|}|j
d|krt|j}nd	d|D}WqggfSYqXn|tkr|dkrld
}nyBtjj|}tj|}|j
dd|D}Wqtk
rggfSYqXn|s|}n||fSdS)aOReturn 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.
        NexecZget_the_completion_listr2zdir()__all__cSs,g|]"}|dddkr|qS)Nrrr).0srrr
<listcomp>s	z2AutoComplete.fetch_completions.<locals>.<listcomp>cSs,g|]"}|dddkr|qS)Nrrr)r>r?rrrr@s	rcSs,g|]"}|dddkr|qS)Nrrr)r>r?rrrr@s	)rZflistZpyshellZinterprpccltZ
remotecallr!__main____dict__copyupdate__builtins__evalsortsorted
get_entitydirr=r#ospath
expanduserlistdirOSError)	rZwhatr9rA	namespaceZbiglZsmalllZentityZexpandedpathrrrr8sL

	

	zAutoComplete.fetch_completionscCs,tjj}|jtjt||S)zALookup name in a namespace spanning sys.modules and __main.dict__)sysmodulesrDrErBrCrG)rnamerQrrrrJszAutoComplete.get_entity)r	r
)__name__
__module____qualname__ZmenudefsrZ	GetOptionrrrrrr$r)r r.rr8rJrrrrrs

;9rrB)mainz#idlelib.idle_test.test_autocomplete	verbosity)__doc__rLrRstringZidlelib.configHandlerrZ
ascii_lettersZdigitsr5ranger!r#ZidlelibrZidlelib.HyperParserrrBsepr"altseprrUZunittestrXrrrr<module>s