{Ss7/dZddlZddlZddlZddlZddlZej Dcgc]}|dvr| c}Zejdejd\Z Z ddl m Z ddlmZddlmZd Zd Zd d d e fZd d d e fZej,ej.zd zZej2ej4r ej4nd ZdeZGddZej=edk(rddl m!Z!e!ddyycc}w)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>NoneTrueFalse)matchcase)r)autocomplete_w)idleConf) HyperParser)TFTN)FTTNF_.c^eZdZd dZedZdZddZdZdZ ddZ d Z d Z d Z d Zy) AutoCompleteNcp||_||j|_||_d|_d|_d|_yN)editwintexttagsautocompletewindow_delayed_completion_id_delayed_completion_index)selfrrs ;/opt/alt/python312/lib64/python3.12/idlelib/autocomplete.py__init__zAutoComplete.__init__(s;   DI "&'+#)-&cBtjddddd|_y)N extensionsr popupwaitintr)typedefault)r GetOptionr)clss rreloadzAutoComplete.reload4s  ** .+E1N rcXtj|j|jS)N)r)r AutoCompleteWindowrr)rs r_make_autocomplete_windowz&AutoComplete._make_autocomplete_window9s00KKrc`|jr"|jjd|_yyr)r hide_windowrevents r_remove_autocomplete_windowz(AutoComplete._remove_autocomplete_window<s*  " "  # # / / 1&*D # #rc.|jty)zA(^space) Open completion list, even if a function call is needed.break)open_completionsFORCEr+s rforce_open_completions_eventz)AutoComplete.force_open_completions_eventAs e$rc@t|dr |js*|jjddj sy|j r5|j j r|j jy|jt}|rdSdS)z5(tab) Complete word or open list if multiple options.mc_stateinsert linestartinsertNr/) hasattrr4rgetstripr is_activecompleter0TAB)rr,openeds rautocomplete_eventzAutoComplete.autocomplete_eventFs 5* %%..IIMM"4h?EEG  " "t'>'>'H'H'J  # # , , .**3/F$7 .$ .rc||jjd}|tvr|dk(rtnt}|jj d|_|j%|jj|j|jj|j|j||_yy)z7(./) Open completion list after pause with no movement.z insert-1crr6N) rr8TRIGGERSTRY_ATRY_Findexrr after_cancelafterr_delayed_open_completions)rr,lastcharargss rtry_open_completions_eventz'AutoComplete.try_open_completions_eventTs99==- x $O5D-1YY__X-FD ***6 &&t'B'BC*.))// > >+FD ' rcd|_|jjd|jk(r|j |yy)z)Call open_completions if index unchanged.Nr6)rrrCrr0)rrHs rrFz&AutoComplete._delayed_open_completions_s9&*# 99??8 $(F(F F  ! !$ ' Grc|\}}}}|j,|jj|jd|_t|jd}|jj dd}t |x}} |jrx|r |tk(rm|jt}|r*||dz dtzvr|dz}|r||dz dtzvr||| } |} |r||dz dvr|dz}|r ||dz dvr||| } n|jr|r |tk(r|jt}|rM||dz tvst||dz dkDr+|dz}|r$||dz tvrt||dz dkDr+||| } |rW||dz dk(rL|jdt ||dz z z|j!} | r|s| j#d d k7ryd } ny|r| s| sy|j%| |} | d sy|j'|_|j(j+| dt | z||| 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. Nr6r5rz'"rz insert-%dc(r r)rrrDr rr8len is_in_stringFILESr-SEPS is_in_codeATTRSID_CHARSord set_indexget_expressionfindfetch_completionsr(r show_window) rrH evalfuncsr;wantwinmodehpcurlineij comp_start comp_what comp_listss rr0zAutoComplete.open_completionsesd.2* 8Wd  & & 2 II " "4#>#> ?*.D ' x 0))-- 2H=G A ?? ddEk  , , .D! EDL8Q! EDL8 1JA! E1Q! E1! I ]]_ddEk  , , .D11S15F5LQ11S15F5L 1JWQqS\S( \S\1Q3-?@A--/ !!innS&9R&?  Ij++It< !}"&"@"@"B**66L3z?:$)) )rc |jjjjj}|r|j dd||fiS|t k(r|dk(ritjjtj}td|}|jt|jd|vrttd|}n|Dcgc] }|dddk7s |}}n |j|}t!|}|jd|vrt|j"}n|Dcgc] }|dddk7s |}}nm|t$k(rd|dk(rd } t&j(j+|} t'j,| }|j|Dcgc] }|ddd k7s |}}s}|fS#d}YxYwcc}wcc}w#ggfcYSxYwcc}w#t.$rggfcYSwxYw) 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. Nexecget_the_completion_listr zdir()__all__rr r)rflistpyshellinterprpcclt remotecallrT__main__ __builtins____dict__evalextendcompletion_kwdssortsorted get_entitydirrirQospath expanduserlistdirOSError) rwhatr^rm namespacebiglsmalllsentity expandedpaths rrZzAutoComplete.fetch_completionss \\''//66==F $$V-F&*D\27 7u}2:!68#8#8#A#A!6#+#4#4!6I3DKK0IIK D(!'Y (B!C-1!BTQrUc\!T!B &!%!6"6{ $,%+FNN%;F15%FA2A#aF%F2:D"#%77#5#5d#;L::l3DIIK)->A2A#aF>4< U F"C&G&!2v ?"r6M"sg4G G %G -A G7 GG GAG%% G 3G 7G%GGG G%% G54G5cZt|itjtjS)zBLookup name in a namespace spanning sys.modules and __main.dict__.)rrsysmodulesrorq)rnames rrwzAutoComplete.get_entitys$D>S[[>H,=,=>??r)NNr)__name__ __module__ __qualname__r classmethodr%r(r-r2r>rIrFr0rZrwrrrr&sO .NNL+  / F( :)x8 t@rrro)mainz#idlelib.idle_test.test_autocomplete) verbosity)"__doc__rokeywordrystringrkwlistrtrsrurTrQidlelibr idlelib.configr idlelib.hyperparserr r1r<rArB ascii_lettersdigitsrUsepaltseprRr@rr%runittestr)rs0rrs  &nn