U
    üÇ-e=  ã                   @  sN   d dl mZ d dlmZ d dlmZ ddlmZmZ dgZ	G dd„ deƒZ
dS )	é    )Úannotations)Údeque)ÚDequeé   )Ú	ClipboardÚClipboardDataÚInMemoryClipboardc                   @  sP   e Zd ZdZdddddœdd	„Zd
ddœdd„Zd
dœdd„Zddœdd„ZdS )r   z
    Default clipboard implementation.
    Just keep the data in memory.

    This implements a kill-ring, for Emacs mode.
    Né<   zClipboardData | NoneÚintÚNone)ÚdataÚmax_sizeÚreturnc                 C  s0   |dkst ‚|| _tƒ | _|d k	r,|  |¡ d S )Nr   )ÚAssertionErrorr   r   Ú_ringÚset_data)Úselfr   r   © r   úc/var/www/html/Darija-Ai-Train/env/lib/python3.8/site-packages/prompt_toolkit/clipboard/in_memory.pyÚ__init__   s
    zInMemoryClipboard.__init__r   )r   r   c                 C  s,   | j  |¡ t| j ƒ| jkr(| j  ¡  qd S ©N)r   Ú
appendleftÚlenr   Úpop)r   r   r   r   r   r      s    zInMemoryClipboard.set_data)r   c                 C  s   | j r| j d S tƒ S d S )Nr   )r   r   ©r   r   r   r   Úget_data$   s    
zInMemoryClipboard.get_datac                 C  s   | j r| j  | j  ¡ ¡ d S r   )r   ÚappendÚpopleftr   r   r   r   Úrotate*   s    zInMemoryClipboard.rotate)Nr	   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r   r   r      s
   	N)Ú
__future__r   Úcollectionsr   Útypingr   Úbaser   r   Ú__all__r   r   r   r   r   Ú<module>   s   ÿ