• File: autocomplete.cpython-37.opt-1.pyc
  • Full Path: /home3/farmfre2/public_html/ALFA_DATA/alfasymlink/root/opt/alt/python37/lib64/python3.7/idlelib/__pycache__/autocomplete.cpython-37.opt-1.pyc
  • Date Modified: 10/26/2026 8:08 PM
  • File size: 6.64 KB
  • MIME-type: text/x-bytecode.python
  • Charset: 8 bit
B

Nj"@sdZddlZddlZddlZddlZd\ZZddlmZddl	m
Z
ddlmZdZ
dZd	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|_dS)N)editwintextautocompletewindow_delayed_completion_id_delayed_completion_index)selfr
r9/opt/alt/python37/lib64/python3.7/idlelib/autocomplete.py__init__!szAutoComplete.__init__cCstjdddddd|_dS)N
extensionsr		popupwaitintr)typedefault)rZ	GetOptionr)clsrrrreload,szAutoComplete.reloadcCst|jS)N)rZAutoCompleteWindowr)rrrr_make_autocomplete_window1sz&AutoComplete._make_autocomplete_windowcCs|jr|jd|_dS)N)rZhide_window)reventrrr_remove_autocomplete_window4s
z(AutoComplete._remove_autocomplete_windowcCs|tdS)zA(^space) Open completion list, even if a function call is needed.break)open_completionsFORCE)rrrrrforce_open_completions_event9s
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_statezinsert linestartinsertNr)
hasattrr!rgetstriprZ	is_activecompleterTAB)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)rr$TRIGGERSTRY_ATRY_Findexrr
after_cancelZafterr_delayed_open_completions)rrZlastcharargsrrrtry_open_completions_eventLs
z'AutoComplete.try_open_completions_eventcCs&d|_|jd|jkr"||dS)z)Call open_completions if index unchanged.Nr")r
rr,rr)rr/rrrr.Wsz&AutoComplete._delayed_open_completionsc
Cs|\}}}}|jdk	r*|j|jd|_t|jd}|jdd}t|}}	|r|rd|tkr|	t}x$|r||ddt
kr|d8}qrW|||	}
|}	x |r||ddkr|d8}qW|||	}n|r|r|tkr|	t}x:|r4||dt
ks*t||ddkr4|d8}qW|||	}
|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"zinsert linestartrz'"rz
insert-%dc(rr)r
rr-rr
r$lenZis_in_stringFILESrSEPSZ
is_in_codeATTRSID_CHARSordZ	set_indexZget_expressionfindfetch_completionsrrZshow_window)
rr/Z	evalfuncsr&ZwantwinmodeZhpZcurlineijZ
comp_startZ	comp_whatZ
comp_listsrrrr]sP
0

zAutoComplete.open_completionsc	Cs`y|jjjjj}Wnd}YnX|r<|dd||fiS|tkr|dkrtjj	tj	}t
d|}|d|krtt
d|}qdd|D}nPy@|
|}t|}|d|krt|j}nd	d|D}WnggfSnd|tkrJ|dkrd
}y0tj|}t|}|dd|D}Wntk
rHggfSX|sT|}||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()__all__cSs g|]}|dddkr|qS)Nrrr).0srrr
<listcomp>sz2AutoComplete.fetch_completions.<locals>.<listcomp>cSs g|]}|dddkr|qS)Nrrr)rArBrrrrCsrcSs g|]}|dddkr|qS)Nrrr)rArBrrrrCs)r
ZflistZpyshellZinterprpccltZ
remotecallr7__main____builtins____dict__evalsortsorted
get_entitydirr@r5ospath
expanduserlistdirOSError)	rZwhatr<rD	namespaceZbiglZsmalllZentityZexpandedpathrrrr;sL







zAutoComplete.fetch_completionscCst|tjtjS)zBLookup name in a namespace spanning sys.modules and __main.dict__.)rHsysmodulesrErG)rnamerrrrKszAutoComplete.get_entity)N)N)N)__name__
__module____qualname__rclassmethodrrrr r(r0r.rr;rKrrrrr	s


<9r	rE)mainz#idlelib.idle_test.test_autocomplete)	verbosity)__doc__rErMstringrSr7r5ZidlelibrZidlelib.configrZidlelib.hyperparserrrr'r*r+Z
ascii_lettersZdigitsr8sepaltsepr6r)r	rrVZunittestrZrrrr<module>s*
9