a
    lc                      @   s   d Z ddlmZmZ ddlmZmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZ d	d
gZG dd	 d	edZG dd
 d
eZdS )z
Interface for an output.
    )ABCMetaabstractmethod)OptionalTextIO)CursorShapeSize)Attrs   )
ColorDepthOutputDummyOutputc                   @   s  e Zd ZU dZdZee ed< ee	dddZ
eedddZeedd	d
dZeedd	ddZeeddddZeddddZeddddZeddddZeddddZeddddZeddddZeddddZedddd Zeddd!d"Zeddd#d$Zeeedd%d&d'Zeddd(d)Zeddd*d+ZedVe	e	dd-d.d/Zee	dd0d1d2Z ee	dd0d3d4Z!ee	dd0d5d6Z"ee	dd0d7d8Z#eddd9d:Z$eddd;d<Z%ee&dd=d>d?Z'eddd@dAZ(dddBdCZ)e*e+ddDdEZ,ee-ddFdGZ.dddHdIZ/dddJdKZ0dddLdMZ1dddNdOZ2dddPdQZ3e	ddRdSZ4eeddTdUZ5dS )Wr   z
    Base class defining the output interface for a
    :class:`~prompt_toolkit.renderer.Renderer`.

    Actual implementations are
    :class:`~prompt_toolkit.output.vt100.Vt100_Output` and
    :class:`~prompt_toolkit.output.win32.Win32Output`.
    Nstdoutreturnc                 C   s   dS )z@Return the file descriptor to which we can write for the output.N selfr   r   V/var/www/html/django/DPS/env/lib/python3.9/site-packages/prompt_toolkit/output/base.pyfileno   s    zOutput.filenoc                 C   s   dS )z
        Return the encoding for this output, e.g. 'utf-8'.
        (This is used mainly to know which characters are supported by the
        output the data, so that the UI can provide alternatives, when
        required.)
        Nr   r   r   r   r   encoding#   s    zOutput.encodingdatar   c                 C   s   dS )z?Write text (Terminal escape sequences will be removed/escaped.)Nr   r   r   r   r   r   write,   s    zOutput.writec                 C   s   dS )zWrite text.Nr   r   r   r   r   	write_raw0   s    zOutput.write_rawtitler   c                 C   s   dS )zSet terminal title.Nr   r   r   r   r   r   	set_title4   s    zOutput.set_titlec                 C   s   dS )z/Clear title again. (or restore previous title.)Nr   r   r   r   r   clear_title8   s    zOutput.clear_titlec                 C   s   dS )z!Write to output stream and flush.Nr   r   r   r   r   flush<   s    zOutput.flushc                 C   s   dS )zd
        Erases the screen with the background colour and moves the cursor to
        home.
        Nr   r   r   r   r   erase_screen@   s    zOutput.erase_screenc                 C   s   dS )zBGo to the alternate screen buffer. (For full screen applications).Nr   r   r   r   r   enter_alternate_screenG   s    zOutput.enter_alternate_screenc                 C   s   dS )z"Leave the alternate screen buffer.Nr   r   r   r   r   quit_alternate_screenK   s    zOutput.quit_alternate_screenc                 C   s   dS )zEnable mouse.Nr   r   r   r   r   enable_mouse_supportO   s    zOutput.enable_mouse_supportc                 C   s   dS )zDisable mouse.Nr   r   r   r   r   disable_mouse_supportS   s    zOutput.disable_mouse_supportc                 C   s   dS )zY
        Erases from the current cursor position to the end of the current line.
        Nr   r   r   r   r   erase_end_of_lineW   s    zOutput.erase_end_of_linec                 C   s   dS )zc
        Erases the screen from the current line down to the bottom of the
        screen.
        Nr   r   r   r   r   
erase_down]   s    zOutput.erase_downc                 C   s   dS )z#Reset color and styling attributes.Nr   r   r   r   r   reset_attributesd   s    zOutput.reset_attributesattrscolor_depthr   c                 C   s   dS )z%Set new color and styling attributes.Nr   r   r+   r,   r   r   r   set_attributesh   s    zOutput.set_attributesc                 C   s   dS )zDisable auto line wrapping.Nr   r   r   r   r   disable_autowrapl   s    zOutput.disable_autowrapc                 C   s   dS )zEnable auto line wrapping.Nr   r   r   r   r   enable_autowrapp   s    zOutput.enable_autowrapr   rowcolumnr   c                 C   s   dS )zMove cursor position.Nr   r   r2   r3   r   r   r   cursor_gotot   s    zOutput.cursor_gotoamountr   c                 C   s   dS )zMove cursor `amount` place up.Nr   r   r7   r   r   r   	cursor_upx   s    zOutput.cursor_upc                 C   s   dS )z Move cursor `amount` place down.Nr   r8   r   r   r   cursor_down|   s    zOutput.cursor_downc                 C   s   dS )z#Move cursor `amount` place forward.Nr   r8   r   r   r   cursor_forward   s    zOutput.cursor_forwardc                 C   s   dS )z$Move cursor `amount` place backward.Nr   r8   r   r   r   cursor_backward   s    zOutput.cursor_backwardc                 C   s   dS )zHide cursor.Nr   r   r   r   r   hide_cursor   s    zOutput.hide_cursorc                 C   s   dS )zShow cursor.Nr   r   r   r   r   show_cursor   s    zOutput.show_cursorcursor_shaper   c                 C   s   dS )z-Set cursor shape to block, beam or underline.Nr   r   r@   r   r   r   set_cursor_shape   s    zOutput.set_cursor_shapec                 C   s   dS )zReset cursor shape.Nr   r   r   r   r   reset_cursor_shape   s    zOutput.reset_cursor_shapec                 C   s   dS )zP
        Asks for a cursor position report (CPR).
        (VT100 only.)
        Nr   r   r   r   r   ask_for_cpr   s    zOutput.ask_for_cprc                 C   s   dS )a  
        `True` if the `Application` can expect to receive a CPR response after
        calling `ask_for_cpr` (this will come back through the corresponding
        `Input`).

        This is used to determine the amount of available rows we have below
        the cursor position. In the first place, we have this so that the drop
        down autocompletion menus are sized according to the available space.

        On Windows, we don't need this, there we have
        `get_rows_below_cursor_position`.
        Fr   r   r   r   r   responds_to_cpr   s    zOutput.responds_to_cprc                 C   s   dS )z%Return the size of the output window.Nr   r   r   r   r   get_size   s    zOutput.get_sizec                 C   s   dS )zSound bell.Nr   r   r   r   r   bell   s    zOutput.bellc                 C   s   dS zFor vt100 only.Nr   r   r   r   r   enable_bracketed_paste   s    zOutput.enable_bracketed_pastec                 C   s   dS rH   r   r   r   r   r   disable_bracketed_paste   s    zOutput.disable_bracketed_pastec                 C   s   dS )z
        For vt100 only.
        Put the terminal in normal cursor mode (instead of application mode).

        See: https://vt100.net/docs/vt100-ug/chapter3.html
        Nr   r   r   r   r   reset_cursor_key_mode   s    zOutput.reset_cursor_key_modec                 C   s   dS )zFor Win32 only.Nr   r   r   r   r   scroll_buffer_to_prompt   s    zOutput.scroll_buffer_to_promptc                 C   s   t dS )zFor Windows only.NNotImplementedErrorr   r   r   r   get_rows_below_cursor_position   s    z%Output.get_rows_below_cursor_positionc                 C   s   dS )a  
        Get default color depth for this output.

        This value will be used if no color depth was explicitely passed to the
        `Application`.

        .. note::

            If the `$PROMPT_TOOLKIT_COLOR_DEPTH` environment variable has been
            set, then `outputs.defaults.create_output` will pass this value to
            the implementation as the default_color_depth, which is returned
            here. (This is not used when the output corresponds to a
            prompt_toolkit SSH/Telnet session.)
        Nr   r   r   r   r   get_default_color_depth   s    zOutput.get_default_color_depth)r   r   )6__name__
__module____qualname____doc__r   r   r   __annotations__r   intr   strr   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r	   r   r.   r/   r0   r5   r9   r:   r;   r<   r=   r>   r   rB   rC   rD   propertyboolrE   r   rF   rG   rI   rJ   rK   rL   rO   rP   r   r   r   r   r      s   
	)	metaclassc                   @   s  e Zd ZdZedddZedddZeddd	d
ZeddddZ	e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eedd$d%d&Zddd'd(Zddd)d*ZdQeedd,d-d.Zedd/d0d1Zedd/d2d3Zedd/d4d5Zedd/d6d7Zddd8d9Zddd:d;Z e!dd<d=d>Z"ddd?d@Z#dddAdBZ$dddCdDZ%dddEdFZ&dddGdHZ'dddIdJZ(e)ddKdLZ*eddMdNZ+eddOdPZ,dS )Rr   zD
    For testing. An output class that doesn't render anything.
    r   c                 C   s   t dS )z*There is no sensible default for fileno().NrM   r   r   r   r   r      s    zDummyOutput.filenoc                 C   s   dS )Nzutf-8r   r   r   r   r   r      s    zDummyOutput.encodingNr   c                 C   s   d S Nr   r   r   r   r   r      s    zDummyOutput.writec                 C   s   d S r[   r   r   r   r   r   r      s    zDummyOutput.write_rawr   c                 C   s   d S r[   r   r   r   r   r   r      s    zDummyOutput.set_titlec                 C   s   d S r[   r   r   r   r   r   r       s    zDummyOutput.clear_titlec                 C   s   d S r[   r   r   r   r   r   r!      s    zDummyOutput.flushc                 C   s   d S r[   r   r   r   r   r   r"      s    zDummyOutput.erase_screenc                 C   s   d S r[   r   r   r   r   r   r#      s    z"DummyOutput.enter_alternate_screenc                 C   s   d S r[   r   r   r   r   r   r$      s    z!DummyOutput.quit_alternate_screenc                 C   s   d S r[   r   r   r   r   r   r%      s    z DummyOutput.enable_mouse_supportc                 C   s   d S r[   r   r   r   r   r   r&     s    z!DummyOutput.disable_mouse_supportc                 C   s   d S r[   r   r   r   r   r   r'     s    zDummyOutput.erase_end_of_linec                 C   s   d S r[   r   r   r   r   r   r(   	  s    zDummyOutput.erase_downc                 C   s   d S r[   r   r   r   r   r   r)     s    zDummyOutput.reset_attributesr*   c                 C   s   d S r[   r   r-   r   r   r   r.     s    zDummyOutput.set_attributesc                 C   s   d S r[   r   r   r   r   r   r/     s    zDummyOutput.disable_autowrapc                 C   s   d S r[   r   r   r   r   r   r0     s    zDummyOutput.enable_autowrapr   r1   c                 C   s   d S r[   r   r4   r   r   r   r5     s    zDummyOutput.cursor_gotor6   c                 C   s   d S r[   r   r8   r   r   r   r9     s    zDummyOutput.cursor_upc                 C   s   d S r[   r   r8   r   r   r   r:     s    zDummyOutput.cursor_downc                 C   s   d S r[   r   r8   r   r   r   r;   !  s    zDummyOutput.cursor_forwardc                 C   s   d S r[   r   r8   r   r   r   r<   $  s    zDummyOutput.cursor_backwardc                 C   s   d S r[   r   r   r   r   r   r=   '  s    zDummyOutput.hide_cursorc                 C   s   d S r[   r   r   r   r   r   r>   *  s    zDummyOutput.show_cursorr?   c                 C   s   d S r[   r   rA   r   r   r   rB   -  s    zDummyOutput.set_cursor_shapec                 C   s   d S r[   r   r   r   r   r   rC   0  s    zDummyOutput.reset_cursor_shapec                 C   s   d S r[   r   r   r   r   r   rD   3  s    zDummyOutput.ask_for_cprc                 C   s   d S r[   r   r   r   r   r   rG   6  s    zDummyOutput.bellc                 C   s   d S r[   r   r   r   r   r   rI   9  s    z"DummyOutput.enable_bracketed_pastec                 C   s   d S r[   r   r   r   r   r   rJ   <  s    z#DummyOutput.disable_bracketed_pastec                 C   s   d S r[   r   r   r   r   r   rL   ?  s    z#DummyOutput.scroll_buffer_to_promptc                 C   s   t dddS )N(   P   )rowscolumnsr   r   r   r   r   rF   B  s    zDummyOutput.get_sizec                 C   s   dS )Nr\   r   r   r   r   r   rO   E  s    z*DummyOutput.get_rows_below_cursor_positionc                 C   s   t jS r[   )r   ZDEPTH_1_BITr   r   r   r   rP   H  s    z#DummyOutput.get_default_color_depth)r   r   )-rQ   rR   rS   rT   rV   r   rW   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r	   r   r.   r/   r0   r5   r9   r:   r;   r<   r=   r>   r   rB   rC   rD   rG   rI   rJ   rL   r   rF   rO   rP   r   r   r   r   r      sH   N)rT   abcr   r   typingr   r   Zprompt_toolkit.cursor_shapesr   Zprompt_toolkit.data_structuresr   Zprompt_toolkit.stylesr	   r,   r   __all__r   r   r   r   r   r   <module>   s    J