%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/local/lib/python3.8/idlelib/__pycache__/
Upload File :
Create Path :
Current File : //usr/local/lib/python3.8/idlelib/__pycache__/autocomplete.cpython-38.pyc

U

qa#@sdZddlZddlZddlZddlZddlZd\ZZddlm	Z	ddl
mZddlm
Z
dZdZd	d	d	efZd	d	d	efZejejd
ZejejrejndZdeZGd
ddZeedkrddlmZeddddS)zComplete either attribute names or file names.

Either on demand or after a user-selected delay after a key character,
pop up a list of candidates.
N)r)autocomplete_w)idleConf)HyperParser)TFTN)FTTNF_.c@sneZdZdddZeddZddZddd	Zd
dZdd
Z	dddZ
ddZddZddZ
ddZdS)AutoCompleteNcCs,||_|dk	r|j|_d|_d|_d|_dSN)editwintextautocompletewindow_delayed_completion_id_delayed_completion_index)selfrr0/usr/local/lib/python3.8/idlelib/autocomplete.py__init__"szAutoComplete.__init__cCstjdddddd|_dS)N
extensionsr		popupwaitintr)typedefault)rZ	GetOptionr)clsrrrreload-szAutoComplete.reloadcCst|jSr
)rZAutoCompleteWindowr)rrrr_make_autocomplete_window2sz&AutoComplete._make_autocomplete_windowcCs|jr|jd|_dSr
)r
Zhide_windowreventrrr_remove_autocomplete_window5s
z(AutoComplete._remove_autocomplete_windowcCs|tdS)zA(^space) Open completion list, even if a function call is needed.break)open_completionsFORCErrrrforce_open_completions_event:s
z)AutoComplete.force_open_completions_eventcCs^t|dr|js"|jdds&dS|jrD|jrD|jdS|t	}|rVdSdSdS)z5(tab) Complete word or open list if multiple options.mc_stateinsert linestartinsertNr)
hasattrr#rgetstripr
Z	is_activecompleter TAB)rrZopenedrrrautocomplete_event?s

zAutoComplete.autocomplete_eventcCsd|jd}|tkr`|dkr tnt}|jd|_|jdk	rJ|j|j|j	|j
|j||_dS)z7(./) Open completion list after pause with no movement.z	insert-1crr%N)rr'TRIGGERSTRY_ATRY_Findexrrafter_cancelZafterr_delayed_open_completions)rrZlastcharargsrrrtry_open_completions_eventMs
z'AutoComplete.try_open_completions_eventcCs&d|_|jd|jkr"||dS)z)Call open_completions if index unchanged.Nr%)rrr/rr )rr2rrrr1Xsz&AutoComplete._delayed_open_completionsc
Cs|\}}}}|jdk	r*|j|jd|_t|jd}|jdd}t|}}	|r|rd|tkr|	t}|r||ddt
kr|d8}qp|||	}
|}	|r||ddkr|d8}q|||	}n|r|r|tkr|	t}|r*||dt
ks t||ddkr*|d8}q|||	}
|r||ddkr|dt||d|}|r|s|d	d
krdSnd}ndS|r|s|
sdS|||}|dsdS||_|j|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%r$rz'"rz
insert-%dc(rr)rrr0rrr'lenZis_in_stringFILESrSEPSZ
is_in_codeATTRSID_CHARSordZ	set_indexZget_expressionfindfetch_completionsrr
Zshow_window)
rr2Z	evalfuncsr)ZwantwinmodeZhpZcurlineijZ
comp_startZ	comp_whatZ
comp_listsrrrr ^s^


.



zAutoComplete.open_completionsc
Csz|jjjjj}Wnd}YnX|r<|dd||fiS|tkr|dkrtjj	tj	}t
d|}ddtjD}|
||d|krtt
d|}nd	d
|D}nVz@||}t|}|d|krt|j}ndd
|D}WnggfYSXnh|tkrp|dkr d}z0tj|}	t|	}|d
d
|D}Wntk
rnggfYSX|sz|}||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_listrzdir()css|]}|dkr|VqdS)>TrueFalseNoneNr.0srrr	<genexpr>sz1AutoComplete.fetch_completions.<locals>.<genexpr>__all__cSs g|]}|dddkr|qSNrrrrFrrr
<listcomp>sz2AutoComplete.fetch_completions.<locals>.<listcomp>cSs g|]}|dddkr|qSrKrrFrrrrLsrcSs g|]}|dddkr|qS)NrrrrFrrrrLs)rflistZpyshellZinterprpccltZ
remotecallr:__main____builtins____dict__evalkeywordkwlistextendsortsorted
get_entitydirrJr8ospath
expanduserlistdirOSError)
rZwhatr?rN	namespaceZbiglkwdsZsmalllZentityZexpandedpathrrrr>sV







zAutoComplete.fetch_completionscCst|tjtjS)zBLookup name in a namespace spanning sys.modules and __main.dict__.)rRsysmodulesrOrQ)rnamerrrrXszAutoComplete.get_entity)N)N)N)__name__
__module____qualname__rclassmethodrrrr"r+r3r1r r>rXrrrrr	 s



<<r	rO)mainz#idlelib.idle_test.test_autocomplete)	verbosity)__doc__rOrSrZstringrar:r8ZidlelibrZidlelib.configrZidlelib.hyperparserrr!r*r-r.
ascii_lettersdigitsr;sepaltsepr9r,r	rrdZunittestrhrrrr<module>s,
<

Zerion Mini Shell 1.0