Edit File: AutoCompleteWindow.pyc
� ��7ec�������� ���@���s����d��Z��d�d�l�Td�d�l�m�Z�d�d�l�m�Z�m�Z�d�Z�d�Z�d�Z �d�Z �d�Z�d�Z�d�Z �d�Z�d�Z�d�d�d�������YZ�d�S(���sH��� An auto-completion window for IDLE, used by the AutoComplete extension i����(���t���*(���t���MC_SHIFT(���t���COMPLETE_FILESt���COMPLETE_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>t���AutoCompleteWindowc�����������B���s����e��Z�d�����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z�d����Z �d����Z �d ����Z�d ����Z�d����Z �d����Z�d ����Z�d����Z�RS(���c���������C���s����|�|��_��d��|��_�|��_�|��_�d��|��_�|��_�d��|��_�d��|��_�d��|��_ �d��|��_ �d��|��_�d��|��_�d��|��_ �d��|��_�|��_�|��_�|��_�|��_�|��_�t�|��_�d��S(���N(���t���widgett���Nonet���autocompletewindowt���listboxt ���scrollbart���origselforegroundt���origselbackgroundt���completionst���morecompletionst���modet���startt ���startindext���lasttypedstartt���userwantswindowt���hideidt ���keypressidt���listupdateidt���winconfigidt���keyreleaseidt ���doubleclickidt���Falset���lastkey_was_tab(���t���selfR���(����(����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pyt���__init__���s���� ,c���������C���s����t��t�|��j���t�|�����}�d�}�x1�|�|�k��rW�|��j�|�|�|�k�rW�|�d�7}�q'�W|�t�|��j���k��r��|��j�j�d�|��j�|�f�d�|��j�t�|��j���f���n��|�t�|���k��r��|��j�j�d�|��j�|�f�|�|���n��|�|��_�d��S(���Ni����i���s���%s+%dc(���t���mint���lenR���R���t���deleteR���t���insert(���R���t���newstartt���min_lent���i(����(����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pyt ���_change_start8���s����& c���������C���sv���d�}�t��|��j���}�xD�|�|�k�r[�|�|�d�}�|��j�|�|�k�rN�|�}�q�|�d�}�q�Wt�|�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.i����i���i���(���R���R���R���(���R���t���sR#���t���jt���m(����(����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pyt���_binary_searchE���s����� c��� ������C���s5��|��j��|���}�|��j�|�t�|��� |�k�r0�|�S|�d�}�t�|��j���}�xN�|�|�k�r��|�|�d�}�|��j�|�t�|��� |�k�r��|�}�qL�|�d�}�qL�W|�d�}�|�|�k�r��|��j�|�S|��j�|�}�|��j�|�}�t�t�|���t�|�����} �t�|���}�x.�|�| �k��r,|�|�|�|�k�r,|�d�7}�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.i���i���(���R(���R���R���R���( ���R���R%���t���firstR#���R&���R'���t���lastt ���first_compt ���last_compR"���(����(����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pyt���_complete_stringR���s(���� #c���������C���s���t��|��j�j����d���}�|��j�j�|���|��j�}�|��j�|�}�|��j�|���|�k�r]�|�}�n\�t�t�|���t�|�����}�d�}�x.�|�|�k��r��|�|�|�|�k�r��|�d�7}�q��W|�|� }�|��j �|���|��j�|�t�|��j ��� |��j �k�r|��j�j�d�|��j�d�|��j ���n��|��j�j�d�|��j�j�d���d�|��j�j�d�����|��j�r�|��j�|��_�d�|��_�|��j�j�d�t���x$�|��j�D]�}�|��j�j�t�|���qwW|��j�j�|��j�|��j �����|��j����n��d�S(���s|���Should be called when the selection of the Listbox has changed. Updates the Listbox display and calls _change_start.i����i���t���selectbackgroundt���selectforegroundt���bgt���fgN(���t���intR���t���curselectiont���seeR���R���R(���R���R���R$���R���t ���configureR���R ���t���cgetR ���R���R���t���ENDR ���t ���select_sett���_selection_changed(���R���t���curselt���ltst���selstartR!���R"���R#���t���item(����(����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pyR9���q���s2���� # # c���������C���sT��|�\�|��_��|��_�|�|��_�|��j�j�|���|��_�|��j�j�|��j�d���|��_�|�r��|��j�|��j���}�|��j�}�|��j �|���|��j �|���}�|��j��|�|�k�r��|�t�|��j����d�k�s��|��j��|�d�t�|��� |�k�r��|�|�k�Sn��|�|��_�|��j�|��_ �t�|��j���|��_�} �| �j�d���| �j�d���y#�| �j�j�d�d�| �j�d�d���Wn�t�k �r]n�Xt�| �d�t��|��_�} �t�| �d �| �j�d �t�d�d��|��_�}�x!�|��j��D]�}�|�j�t�|���q�W|�j�d ���|��_ �|�j�d���|��_!�| �j"�d�|�j#���| �j$�d�t%�d�t&���|�j$�d�t'�d�t(�d�t)���| �j*����|��j�j+�|��j �|��j�����|��j,����|��j�j-�t.�|��j/���|��_0�x!�t1�D]�} �|��j�j2�t.�| ���q~W|��j�j-�t3�|��j4���|��_5�x!�t6�D]�} �|��j�j2�t3�| ���q�W|��j�j-�t7�|��j8���|��_9�|��j�j2�t7�t:���|�j-�t;�|��j<���|��_=�| �j-�t>�|��j?���|��_@�|�j-�tA�|��jB���|��_C�d�S(���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 ���i���s���+10000+10000s!���::tk::unsupported::MacWindowStylet���stylet���helpt���noActivatest���orientt���yscrollcommandt���exportselectionR0���t���whiteR/���R.���t���commandt���sidet���fillt���expandN(D���R���R ���R���R���t���indexR���t���getR���R-���R$���R(���R���R���R���t���ToplevelR���t���wm_geometryt���wm_overrideredirectt���tkt���callt���_wt���TclErrort ���Scrollbart���VERTICALR ���t���Listboxt���setR���R���R ���R7���R6���R ���R���t���configt���yviewt���packt���RIGHTt���Yt���LEFTt���BOTHt���Truet���liftR8���R9���t���bindt���HIDE_VIRTUAL_EVENT_NAMEt ���hide_eventR���t���HIDE_SEQUENCESt ���event_addt���KEYPRESS_VIRTUAL_EVENT_NAMEt���keypress_eventR���t���KEYPRESS_SEQUENCESt���KEYRELEASE_VIRTUAL_EVENT_NAMEt���keyrelease_eventR���t���KEYRELEASE_SEQUENCEt���LISTUPDATE_SEQUENCEt���listselect_eventR���t���WINCONFIG_SEQUENCEt���winconfig_eventR���t���DOUBLECLICK_SEQUENCEt���doubleclick_eventR���(���R���t ���comp_listsRI���t���completeR���t���userWantsWint ���completedR���R#���t���acwR ���R���R=���t���seq(����(����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pyt���show_window����sh���� ! c���������C���s ��|��j�����s�d��S|��j�}�|�j�|��j���|�j�|��j���\�}�}�}�}�|��j�}�|�j����|�j����}�} �|�j����|�j����} �}�|�j����t �|�t �d�| �|�����}�|�j����|�} �|�|�|�| �k�s��|�| �k��r��| �|�7} �n �| �| �8} �|�j�d�|�| �f���d��S(���Ni����s���+%d+%d( ���t ���is_activeR���R4���R���t���bboxR���t���winfo_widtht���winfo_heightt���winfo_rootxR���t���maxt���winfo_rootyRL���(���R���t���eventt���textt���xt���yt���cxt���cyRt���t ���acw_widtht ���acw_heightt ���text_widtht���text_heightt���new_xt���new_y(����(����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pyRm�������s���� & c���������C���s���|��j�����s�d��S|��j����d��S(���N(���Rw���t���hide_window(���R���R~���(����(����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pyRa�������s����c���������C���sJ���|��j�����s�d��St�|��_�t�|��j�j����d���}�|��j�|��j�|���d��S(���Ni����(���Rw���R]���R���R2���R���R3���R$���R���(���R���R~���R:���(����(����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pyRk�������s ���� c���������C���s;���t��|��j�j����d���}�|��j�|��j�|���|��j����d��S(���Ni����(���R2���R���R3���R$���R���R����(���R���R~���R:���(����(����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pyRo�������s����c������������s���|��j�����s�d��S|�j����t�|�d���r4�|�j�}�n�d�}����d�k�rR�t�|��_�n��t������d�k�s�����d%�k�s��|��j�t�k�r����d&�k�r�|�t �@r�t������d�k�r��|��j �|��j������n�����d�k�r��|��j �|��j�d ���n}����d�k�r|��j �|��j�d ���nZ����d�k�r)|��j �|��j�d���n7�t�|��j���d�k�rL|��j����d��S|��j �|��j�d� ��|��j�|��_ �|��j�j�d�t�|��j�j����d�����|��j�j�|��j�|��j�����|��j����d �S���d�k�r�|��j����d��S|��j�t�k�r����d'�k�s|��j�t�k�r����d(�k�r�|�t �@r�t�|��j�j����d���}�|��j�|�t�|��j��� |��j�k�r�|��j�t�k�sl|��j�r�|��j �|��j�|���n��|��j����d��S���d)�k�r!|�r!t�|��_�t�|��j�j����d���}����d�k�r�d�}�n���d�k�r�t�|��j���d�}�n�����d*�k�r�|��j�j�|��j�j������|��j�j�d���}����d�k�rVt�d�|�|���}�q����d�k�sht���t�t�|��j���d�|�|���}�nT����d�k�r�t�d�|�d���}�n2����d�k�s�t���t�t�|��j���d�|�d���}�|��j�j�|���|��j�j�|���|��j����|��j �|��j�|���d �S���d�k�r�|�r�|��j�rxt�|��j�j����d���}�|��j �|��j�|���|��j����d �St�|��_�t�|��_�d��Sn.�t����f�d����d+�D����r�d��S|��j����d��Sd��S(,���Nt���mc_statei����t���Tabi���t ���underscoret ���BackSpacet���periodt���minust���_t���.t���-i����t���breakt���Returnt���spacet ���parenleftt ���parenrightt���bracketleftt���bracketrightt���slasht ���backslasht���quotedblt ���apostrophet���Homet���Endt���Priort���Nextt���Upt���Downc���������3���s���|��]�}�|����k�Vq�d��S(���N(����(���t���.0R%���(���t���keysym(����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pys ���<genexpr>b��s����t���Shiftt���Controlt���Altt���Metat���Commandt���Option(���R����R����(���R����R����(���R����R����R����R����R����R����(���R����R����R����R����(���R����R����R����R����R����R����(���R����R����(���R����R����R����R����R����R����(���Rw���R����t���hasattrR����R���R���R���R���R���R���R$���R���R����R���R���t���select_clearR2���R3���R8���R(���R9���R���R���R]���R���t���nearestRz���R|���t���AssertionErrorR���t���any(���R���R~���t���stateR:���t���newselt���jump(����(���R����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pyRe�����s����� & � # # c���������C���s[���|��j�����s�d��S|��j�j�d���|��j�j�d�|��j�t�|��j���f���k�rW�|��j����n��d��S(���NR ���s���%s+%dc(���Rw���R���RI���R���R���R���R����(���R���R~���(����(����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pyRh���l��s ����+c���������C���s ���|��j��d��k �S(���N(���R���R���(���R���(����(����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pyRw���t��s����c���������C���s���|��j��|��j�|��j�����d��S(���N(���R$���R-���R���(���R���(����(����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pyRq���w��s����c���������C���sL��|��j�����s�d��Sx!�t�D]�}�|��j�j�t�|���q�W|��j�j�t�|��j���d��|��_�x!�t�D]�}�|��j�j�t �|���qZ�W|��j�j�t �|��j ���d��|��_ �|��j�j�t�t���|��j�j�t�|��j ���d��|��_ �|��j�j�t�|��j���d��|��_�|��j�j�t�|��j���d��|��_�|��j�j����d��|��_�|��j�j����d��|��_�|��j�j����d��|��_�d��S(���N(���Rw���Rb���R���t���event_deleteR`���t���unbindR���R���Rf���Rd���R���Rg���Ri���R���R���Rj���R���R���Rl���R���R ���t���destroy(���R���Ru���(����(����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pyR����{��s0���� (���t���__name__t ���__module__R���R$���R(���R-���R9���Rv���Rm���Ra���Rk���Ro���Re���Rh���Rw���Rq���R����(����(����(����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pyR������s��� $ F 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__t���Tkintert���idlelib.MultiCallR���t���idlelib.AutoCompleteR���R���R`���Rb���Rd���Rf���Rg���Ri���Rj���Rl���Rn���R���(����(����(����s2���/usr/lib64/python2.7/idlelib/AutoCompleteWindow.pyt���<module>���s��� ��