관리-도구
편집 파일: history.cpython-37.opt-2.pyc
B YI~d� � @ 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 | _t�ddddd�| _|�d| j� |�d| 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 �4/opt/alt/python37/lib64/python3.7/idlelib/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| j�ddd�sN| j�dd�| j| krdd }}| j�dd� |d kst|d kr�| j�dd�}|r�|}n| jr�d}n| j� � d S t |�}x�||r�dnd7 }|dk s�||k�r(| j� � | js�|dk r�d S | j�dd�|k�r| j� dd� | j�d|� d }}P | j| }|d |� |kr�t |�|kr�| j� dd� | j�d|� P q�W | j�d� | j� dd d � || _|| _d S )N�insertz!=zend-1cZiomark���r r Zselz1.0�end)�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 |� � }t|�dkrFy| j�|� W n tk r8 Y nX | j�|� 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