tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Z\¬Qc
@sƒdZddlTddlmZddlmZmZdZdZdZ    dZ
dZ dZ dZ dZdZddd„ƒYZdS(sH
An auto-completion window for IDLE, used by the AutoComplete extension
iÿÿÿÿ(t*(tMC_SHIFT(tCOMPLETE_FILEStCOMPLETE_ATTRIBUTESs<<autocompletewindow-hide>>s
<FocusOut>s <ButtonPress>s<<autocompletewindow-keypress>>s<Key>s<Key-BackSpace>s <Key-Return>s    <Key-Tab>s<Key-Up>s
<Key-Down>s
<Key-Home>s    <Key-End>s <Key-Prior>s
<Key-Next>s!<<autocompletewindow-keyrelease>>s <KeyRelease>s<B1-ButtonRelease>s <Configure>s<B1-Double-ButtonRelease>tAutoCompleteWindowcBseZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
d    „Z d
„Z d „Z d „Zd „Zd„ZRS(cCs¨||_d|_|_|_d|_|_d|_d|_d|_    d|_
d|_ d|_ d|_ d|_|_|_|_|_|_t|_dS(N(twidgettNonetautocompletewindowtlistboxt    scrollbartorigselforegroundtorigselbackgroundt completionstmorecompletionstmodetstartt
startindextlasttypedstarttuserwantswindowthideidt
keypressidt listupdateidt winconfigidt keyreleaseidt doubleclickidtFalsetlastkey_was_tab(tselfR((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pyt__init__s                                ,cCsìtt|jƒt|ƒƒ}d}x1||krW|j|||krW|d7}q'W|t|jƒkr¦|jjd|j|fd|jt|jƒfƒn|t|ƒkrß|jjd|j|f||ƒn||_dS(Niis%s+%dc(tmintlenRRtdeleteRtinsert(Rtnewstarttmin_lenti((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pyt _change_start8s& cCsvd}t|jƒ}xD||kr[||d}|j||krN|}q|d}qWt|t|jƒdƒS(s’Find the first index in self.completions where completions[i] is
        greater or equal to s, or the last index if there is no such
        one.iii(RR R(RtsR#tjtm((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pyt_binary_searchEs    c
Cs5|j|ƒ}|j|t|ƒ |kr0|S|d}t|jƒ}xN||kr™||d}|j|t|ƒ |krŒ|}qL|d}qLW|d}||kr»|j|S|j|}|j|}tt|ƒt|ƒƒ}    t|ƒ}x.||    kr,||||kr,|d7}qÿW|| S(sÖAssuming that s is the prefix of a string in self.completions,
        return the longest string which is a prefix of all the strings which
        s is a prefix of them. If s is not a prefix of a string, return s.ii(R(R RR(
RR%tfirstR#R&R'tlastt
first_compt    last_compR"((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pyt_complete_stringRs(
    
     #cCsÁt|jjƒdƒ}|jj|ƒ|j}|j|}|j|ƒ|kr]|}n\tt|ƒt|ƒƒ}d}x.||kr®||||kr®|d7}qW|| }|j    |ƒ|j|t|j
ƒ |j
kr |jj d|j d|j ƒn²|jj d|jjdƒd|jjdƒƒ|jr½|j|_d|_|jjdtƒx$|jD]}|jjt|ƒqwW|jj|j|j
ƒƒ|jƒndS(s|Should be called when the selection of the Listbox has changed.
        Updates the Listbox display and calls _change_start.iitselectbackgroundtselectforegroundtbgtfgN(tintRt curselectiontseeRR R(RRR$Rt    configureR R
tcgetR RRtENDR t
select_sett_selection_changed(RtcurseltltstselstartR!R"R#titem((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pyR9qs2         #
 #          c
Cs;|\|_|_||_|jj|ƒ|_|jj|jdƒ|_|rÓ|j|jƒ}|j    |ƒ|j
|ƒ}|j||krÓ|t |jƒdksÌ|j|dt |ƒ |krÓdSn||_ |j|_ t|jƒ|_}|jdƒ|jdƒy#|jjdd|jddƒWntk
rNnXt|d    tƒ|_}    t|d
|    jd td d ƒ|_}
x!|jD]} |
jt| ƒqšW|
jdƒ|_ |
jdƒ|_!|    j"d|
j#ƒ|    j$dt%dt&ƒ|
j$dt'dt(dt)ƒ|jj*|j
|jƒƒ|j+ƒ|jj,t-|j.ƒ|_/x!t0D]} |jj1t-| ƒqeW|jj,t2|j3ƒ|_4x!t5D]} |jj1t2| ƒq¤W|jj,t6|j7ƒ|_8|jj1t6t9ƒ|
j,t:|j;ƒ|_<|j,t=|j>ƒ|_?|
j,t@|jAƒ|_BdS(s¤Show the autocomplete list, bind events.
        If complete is True, complete the text, and if there is exactly one
        matching completion, don't open a list.R iNs +10000+10000s!::tk::unsupported::MacWindowStyletstylethelpt noActivatestorienttyscrollcommandtexportselectionR0twhiteR/R.tcommandtsidetfilltexpand(CR R RRtindexRtgetRR-R$R(RRRtToplevelRt wm_geometrytwm_overrideredirectttktcallt_wtTclErrort    ScrollbartVERTICALR    tListboxtsetRRR R7R6R
R tconfigtyviewtpacktRIGHTtYtLEFTtBOTHtTrueR8R9tbindtHIDE_VIRTUAL_EVENT_NAMEt
hide_eventRtHIDE_SEQUENCESt    event_addtKEYPRESS_VIRTUAL_EVENT_NAMEtkeypress_eventRtKEYPRESS_SEQUENCEStKEYRELEASE_VIRTUAL_EVENT_NAMEtkeyrelease_eventRtKEYRELEASE_SEQUENCEtLISTUPDATE_SEQUENCEtlistselect_eventRtWINCONFIG_SEQUENCEtwinconfig_eventRtDOUBLECLICK_SEQUENCEtdoubleclick_eventR( Rt
comp_listsRItcompleteRt userWantsWint    completedR#tacwR    RR=tseq((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pyt show_window•sd     !        
             cCs
|jƒsdS|j}|j|jƒ|j|jƒ\}}}}|j}|jƒ|jƒ}}    |jƒ|jƒ}
} |jƒt    |t
d|
|ƒƒ} |j ƒ|} | |||    ksØ||    krå| |7} n
| |    8} |j d| | fƒdS(Nis+%d+%d( t    is_activeRR4RtbboxRt winfo_widtht winfo_heightt winfo_rootxRtmaxt winfo_rootyRL(RteventttexttxtytcxtcyRst    acw_widtht
acw_heightt
text_widtht text_heighttnew_xtnew_y((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pyRlÙs         &  
cCs|jƒsdS|jƒdS(N(Rvt hide_window(RR}((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pyR`îs cCsJ|jƒsdSt|_t|jjƒdƒ}|j|j|ƒdS(Ni(RvR]RR2RR3R$R (RR}R:((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pyRjós
     cCs;t|jjƒdƒ}|j|j|ƒ|jƒdS(Ni(R2RR3R$R R‰(RR}R:((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pyRnúscsÃ|jƒsdS|j‰t|dƒr4|j}nd}ˆdkrRt|_ntˆƒdks‹ˆd%ks‹|jtkr¼ˆd&kr¼|t    @ r¼tˆƒdkrÀ|j
|j ˆƒn ˆdkrã|j
|j d    ƒn}ˆdkr|j
|j d
ƒnZˆdkr)|j
|j d ƒn7t|j ƒdkrL|j ƒdS|j
|j d  ƒ|j |_ |jjdt|jjƒdƒƒ|jj|j|j ƒƒ|jƒd SˆdkrÖ|j ƒdS|jtkrñˆd'ks|jtkr‘ˆd(kr‘|t    @ r‘t|jjƒdƒ}|j|t|j ƒ |j krƒ|jtksl|j rƒ|j
|j|ƒn|j ƒdSˆd)kr!| r!t|_t|jjƒdƒ}ˆdkrÛd}nˆdkrýt|jƒd}nâˆd*kr‹|jj|jjƒƒ|jjdƒ}ˆdkrVtd||ƒ}q߈dksht‚tt|jƒd||ƒ}nTˆdkr­td|dƒ}n2ˆdks¿t‚tt|jƒd|dƒ}|jj|ƒ|jj|ƒ|jƒ|j
|j|ƒd Sˆdkr‘| r‘|jrxt|jjƒdƒ}|j
|j|ƒ|j ƒd St|_t|_dSn.t‡fd†d+Dƒƒr±dS|j ƒdSdS(,Ntmc_stateitTabit
underscoret    BackSpacetperiodtminust_t.t-iÿÿÿÿtbreaktReturntspacet    parenleftt
parenrightt bracketleftt bracketrighttslasht    backslashtquotedblt
apostrophetHometEndtPriortNexttUptDownc3s|]}|ˆkVqdS(N((t.0R%(tkeysym(sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pys    <genexpr>`stShifttControltAlttMetatCommandtOption(RŒR(RŽR(RŽR•R–R—R˜R™(sslashR›RœR(RžRŸR R¡R¢R£(R R¡(R¦R§R¨R©RªR«(RvR¥thasattrRŠRRRRRRR$RR‰RRt select_clearR2R3R8R(R9RR R]RtnearestRyR{tAssertionErrorRtany(RR}tstateR:tnewseltjump((R¥sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pyRds¤                
 &
 
         #
             #  
    
         
cCs[|jƒsdS|jjdƒ|jjd|jt|jƒfƒkrW|jƒndS(NR s%s+%dc(RvRRIRRRR‰(RR}((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pyRgjs
 +cCs |jdk    S(N(RR(R((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pyRvrscCs|j|j|jƒƒdS(N(R$R-R(R((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pyRpuscCsL|jƒsdSx!tD]}|jjt|ƒqW|jjt|jƒd|_x!tD]}|jjt    |ƒqZW|jjt    |j
ƒd|_
|jjt t ƒ|jjt |j ƒd|_ |jjt|jƒd|_|jjt|jƒd|_|jjƒd|_|jjƒd|_|jjƒd|_dS(N(RvRaRt event_deleteR_tunbindRRReRcRRfRhRRRiRRRkRR    tdestroy(RRt((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pyR‰ys0                                   (t__name__t
__module__RR$R(R-R9RuRlR`RjRnRdRgRvRpR‰(((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pyRs                     $    D                    j            N(s
<FocusOut>s <ButtonPress>(
s<Key>s<Key-BackSpace>s <Key-Return>s    <Key-Tab>s<Key-Up>s
<Key-Down>s
<Key-Home>s    <Key-End>s <Key-Prior>s
<Key-Next>((t__doc__tTkintertidlelib.MultiCallRtidlelib.AutoCompleteRRR_RaRcReRfRhRiRkRmR(((sb/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/idlelib/AutoCompleteWindow.pyt<module>s