a
    õ£Beà  ã                   @  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J ‚ˆ | _g | _d S )Nc                 3  s   | ]}t ˆ |ƒV  qd S ©N)Úhasattr)Ú.0Úa©r   © úc/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/prompt_toolkit/output/plain_text.pyÚ	<genexpr>   ó    z+PlainTextOutput.__init__.<locals>.<genexpr>)ÚwriteÚflush)Úallr   Ú_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   )Ú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   rT   rV   rW   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   