Sindbad~EG File Manager

Current Path : /usr/local/lib/python3.12/idlelib/__pycache__/
Upload File :
Current File : //usr/local/lib/python3.12/idlelib/__pycache__/history.cpython-312.opt-1.pyc

�

%Μg���V�dZddlmZGd�d�Zedk(rddlmZeddd	�
�yy)z9Implement Idle Shell history mechanism with History class�)�idleConfc�.�eZdZdZd�Zd�Zd�Zd�Zd�Zy)�Historya@ Implement Idle Shell history mechanism.

    store - Store source statement (called from pyshell.resetoutput).
    fetch - Fetch stored statement matching prefix already entered.
    history_next - Bound to <<history-next>> event (default Alt-N).
    history_prev - Bound to <<history-prev>> event (default Alt-P).
    c���||_g|_d|_d|_t	j
ddddd�|_|jd|j�|jd|j�y)	adInitialize data attributes and bind event methods.

        .text - Idle wrapper of tk Text widget, with .bell().
        .history - source statements, possibly with multiple lines.
        .prefix - source already entered at prompt; filters history list.
        .pointer - index into history.
        .cyclic - wrap around history list (or not).
        N�mainr�cyclic��boolz<<history-previous>>z<<history-next>>)
�text�history�prefix�pointerr�	GetOptionr�bind�history_prev�history_next)�selfrs  �,/usr/local/lib/python3.12/idlelib/history.py�__init__zHistory.__init__sd����	�����������(�(���H�a��P����	�	�(�$�*;�*;�<��	�	�$�d�&7�&7�8�c�(�|jd��y)z5Fetch later statement; start with earliest if cyclic.F��reverse�break��fetch�r�events  rrzHistory.history_nexts���
�
�5�
�!�rc�(�|jd��y)z0Fetch earlier statement; start with most recent.Trrrrs  rrzHistory.history_prev$s���
�
�4�
� �rc�r�t|j�}|j}|j}|�k|�i|jjddd�s,|jj
dd�|j|k7r dx}}|jjdd�|�|�K|jj
dd�}|r|}n*|jrd}n|jj�yt|�}	||rdndz
}|dks||k\r�|jj�|js|dkry|jj
dd�|k7r9|jjdd�|jjd|d	�dx}}n`|j|}|d||k(rHt|�|kDr:|jjdd�|jjd|d	�n��|jjd�|jjd
dd�||_||_y)
a+Fetch statement and replace current line in text widget.

        Set prefix and pointer as needed for successive fetches.
        Reset them to None, None when returning to the start line.
        Sound bell when return to start line or cannot leave a line
        because cyclic is False.
        N�insertz!=zend-1c�iomark���r	r�stdin�selz1.0�end)�lenrrr
r�compare�get�mark_setr�bell�deleter!�see�
tag_remove)rr�nhistrr
�nprefix�items       rrz
History.fetch)s����D�L�L�!���,�,��������6�#5��y�y� � ��4��:��I�I�M�M�(�H�5����g�9N�N�#'�'��&��	�	�"�"�8�X�6��?�f�n��Y�Y�]�]�8�X�6�F�����;�;� �G��I�I�N�N�$���f�+����W�r�!�+�G���{�g��.��	�	��� ��{�{�w��{���y�y�}�}�X�x�8�F�B��	�	�(�(��8�<��	�	�(�(��6�7�C�'+�+�G�f���<�<��(�D��H�W�~��'�C��I��,?��	�	� � ��8�4��	�	� � ��4��9��!�"	
�	�	�
�
�h���	�	���U�E�5�1������rc���|j�}t|�dkDr7	|jj|�|jj|�d|_d|_y#t$rY�5wxYw)z.Store Shell input statement into history list.�N)�stripr'r�remove�
ValueError�appendrr
)r�sources  r�storez
History.storeZse��������v�;��?�
����#�#�F�+�
�L�L����'��������	�
��
�s�A%�%	A1�0A1N)	�__name__�
__module__�__qualname__�__doc__rrrrr9�rrrrs!���9�"�
�
/�brr�__main__)rzidlelib.idle_test.test_historyr3F)�	verbosity�exitN)r=�idlelib.configrrr:�unittestrr>rr�<module>rDs7��;�#�_�_�D�z����	)�Q�U�C�r

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists