U
    ouf                     @  sz   d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	 ddl
mZ ddlmZ dd	lmZ d
gZG dd
 d
eZdS )    )annotations)TextIO)CursorShapeSize)Attrs   )Output)
ColorDepth)flush_stdoutPlainTextOutputc                   @  s$  e Zd ZdZdddddZddd	d
ZddddZdddddZdddddZdddddZ	ddddZ
ddddZddddZddddZddddZddd d!Zddd"d#Zddd$d%Zddd&d'Zddd(d)Zd*d+dd,d-d.Zddd/d0Zddd1d2Zd\dddd4d5d6Zddd7d8d9Zddd7d:d;Zddd7d<d=Zddd7d>d?Zddd@dAZdddBdCZdDddEdFdGZdddHdIZdddJdKZ dddLdMZ!dddNdOZ"dddPdQZ#dddRdSZ$dTddUdVZ%dddWdXZ&d+ddYdZZ'd[S )]r   aR  
    Output that won't include any ANSI escape sequences.

    Useful when stdout is not a terminal. Maybe stdout is redirected to a file.
    In this case, if `print_formatted_text` is used, for instance, we don't
    want to include formatting.

    (The code is mostly identical to `Vt100_Output`, but without the
    formatting.)
    r   None)stdoutreturnc                   s*   t  fdddD st | _g | _d S )Nc                 3  s   | ]}t  |V  qd S N)hasattr).0ar    D/tmp/pip-unpacked-wheel-8milen2s/prompt_toolkit/output/plain_text.py	<genexpr>   s     z+PlainTextOutput.__init__.<locals>.<genexpr>)writeflush)allAssertionErrorr   _buffer)selfr   r   r   r   __init__   s    zPlainTextOutput.__init__int)r   c                 C  s
   | j  S )z*There is no sensible default for fileno().)r   filenor   r   r   r   r    "   s    zPlainTextOutput.filenostrc                 C  s   dS )Nzutf-8r   r!   r   r   r   encoding&   s    zPlainTextOutput.encoding)datar   c                 C  s   | j | d S r   r   appendr   r$   r   r   r   r   )   s    zPlainTextOutput.writec                 C  s   | j | d S r   r%   r'   r   r   r   	write_raw,   s    zPlainTextOutput.write_raw)titler   c                 C  s   d S r   r   )r   r)   r   r   r   	set_title/   s    zPlainTextOutput.set_titlec                 C  s   d S r   r   r!   r   r   r   clear_title2   s    zPlainTextOutput.clear_titlec                 C  s,   | j s
d S d| j }g | _ t| j| d S )N )r   joinr   r   r'   r   r   r   r   5   s
    zPlainTextOutput.flushc                 C  s   d S r   r   r!   r   r   r   erase_screen=   s    zPlainTextOutput.erase_screenc                 C  s   d S r   r   r!   r   r   r   enter_alternate_screen@   s    z&PlainTextOutput.enter_alternate_screenc                 C  s   d S r   r   r!   r   r   r   quit_alternate_screenC   s    z%PlainTextOutput.quit_alternate_screenc                 C  s   d S r   r   r!   r   r   r   enable_mouse_supportF   s    z$PlainTextOutput.enable_mouse_supportc                 C  s   d S r   r   r!   r   r   r   disable_mouse_supportI   s    z%PlainTextOutput.disable_mouse_supportc                 C  s   d S r   r   r!   r   r   r   erase_end_of_lineL   s    z!PlainTextOutput.erase_end_of_linec                 C  s   d S r   r   r!   r   r   r   
erase_downO   s    zPlainTextOutput.erase_downc                 C  s   d S r   r   r!   r   r   r   reset_attributesR   s    z PlainTextOutput.reset_attributesr   r
   )attrscolor_depthr   c                 C  s   d S r   r   )r   r6   r7   r   r   r   set_attributesU   s    zPlainTextOutput.set_attributesc                 C  s   d S r   r   r!   r   r   r   disable_autowrapX   s    z PlainTextOutput.disable_autowrapc                 C  s   d S r   r   r!   r   r   r   enable_autowrap[   s    zPlainTextOutput.enable_autowrapr   )rowcolumnr   c                 C  s   d S r   r   )r   r;   r<   r   r   r   cursor_goto^   s    zPlainTextOutput.cursor_goto)amountr   c                 C  s   d S r   r   r   r>   r   r   r   	cursor_upa   s    zPlainTextOutput.cursor_upc                 C  s   | j d d S )N
r%   r?   r   r   r   cursor_downd   s    zPlainTextOutput.cursor_downc                 C  s   | j d|  d S )N r%   r?   r   r   r   cursor_forwardg   s    zPlainTextOutput.cursor_forwardc                 C  s   d S r   r   r?   r   r   r   cursor_backwardj   s    zPlainTextOutput.cursor_backwardc                 C  s   d S r   r   r!   r   r   r   hide_cursorm   s    zPlainTextOutput.hide_cursorc                 C  s   d S r   r   r!   r   r   r   show_cursorp   s    zPlainTextOutput.show_cursorr   )cursor_shaper   c                 C  s   d S r   r   )r   rH   r   r   r   set_cursor_shapes   s    z PlainTextOutput.set_cursor_shapec                 C  s   d S r   r   r!   r   r   r   reset_cursor_shapev   s    z"PlainTextOutput.reset_cursor_shapec                 C  s   d S r   r   r!   r   r   r   ask_for_cpry   s    zPlainTextOutput.ask_for_cprc                 C  s   d S r   r   r!   r   r   r   bell|   s    zPlainTextOutput.bellc                 C  s   d S r   r   r!   r   r   r   enable_bracketed_paste   s    z&PlainTextOutput.enable_bracketed_pastec                 C  s   d S r   r   r!   r   r   r   disable_bracketed_paste   s    z'PlainTextOutput.disable_bracketed_pastec                 C  s   d S r   r   r!   r   r   r   scroll_buffer_to_prompt   s    z'PlainTextOutput.scroll_buffer_to_promptr   c                 C  s   t dddS )N(   P   )Zrowscolumnsr   r!   r   r   r   get_size   s    zPlainTextOutput.get_sizec                 C  s   dS )N   r   r!   r   r   r   get_rows_below_cursor_position   s    z.PlainTextOutput.get_rows_below_cursor_positionc                 C  s   t jS r   )r
   ZDEPTH_1_BITr!   r   r   r   get_default_color_depth   s    z'PlainTextOutput.get_default_color_depthN)r   r   )(__name__
__module____qualname____doc__r   r    r#   r   r(   r*   r+   r   r.   r/   r0   r1   r2   r3   r4   r5   r8   r9   r:   r=   r@   rB   rD   rE   rF   rG   rI   rJ   rK   rL   rM   rN   rO   rS   rU   rV   r   r   r   r   r      sJ   N)
__future__r   typingr   Zprompt_toolkit.cursor_shapesr   Zprompt_toolkit.data_structuresr   Zprompt_toolkit.stylesr   baser	   r7   r
   r   __all__r   r   r   r   r   <module>   s   