Your IP : 3.144.252.243
3
��2a� � @ s@ d dl mZ G dd� d�Zedkr<d dlmZ edddd � d
S )� )�idleConfc @ s4 e Zd Zdd� Zdd� Zdd� Zdd� Zd d
� ZdS )�Historyc C sL || _ g | _d | _d | _tjddddd�| _|jd| j� |jd| j � d S )N�mainr �cyclic� �boolz<<history-previous>>z<<history-next>>)
�text�history�prefix�pointerr Z GetOptionr Zbind�history_prev�history_next)�selfr � r �,/opt/alt/python36/lib64/python3.6/history.py�__init__ s zHistory.__init__c C s | j dd� dS )NF)�reverse�break)�fetch)r �eventr r r r
s zHistory.history_nextc C s | j dd� dS )NT)r r )r )r r r r r r $ s zHistory.history_prevc C s� t | j�}| j}| j}|d k rd|d k rd| jjddd�sN| jjdd�| j| krdd }}| jjdd� |d kst|d kr�| jjdd�}|r�|}n| jr�d
}n| jj � d S t |�}x�||r�dnd7 }|dk s�||k�r*| jj � | j r�|dk r�d S | jjdd�|k�r | jj
dd� | jjd|� d }}P | j| }|d |� |kr�t |�|kr�| jj
dd� | jjd|� P q�W | jjd� | jj
ddd � || _|| _d S )N�insertz!=zend-1cZiomarkr r Zselz1.0�end���r )�lenr r r
r Zcompare�getZmark_setr Zbell�deleter ZseeZ
tag_remove)r r Znhistr r
Znprefix�itemr r r r ) sJ
z
History.fetchc C sV |j � }t|�dkrFy| jj|� W n tk
r8 Y nX | jj|� d | _d | _d S )N� )�stripr r �remove�
ValueError�appendr r
)r �sourcer r r �storeZ s z
History.storeN)�__name__�
__module__�__qualname__r r
r r r# r r r r r s
1r �__main__)r zidlelib.idle_test.test_historyr F)� verbosity�exitN)Zidlelib.configr r r$ Zunittestr r r r r �<module> s b